phpinspectionsea
phpinspectionsea copied to clipboard
"Property is used only in constructor" doesn't take care of trait
Subject | Details |
---|---|
Plugin | Php Inspections (EA Ultimate) |
Language level | PHP 7.2 |
Current behaviour
I have this warning "[EA] Property is used only in constructor, perhaps we are dealing with dead code here." because the property is used in a trait only.
Expected behaviour
No warning. Should look into trait ?
Environment details
class BlogController extends AbstractController
{
use Post13Trait,Post26Trait,Post51Trait,Post59Trait;
This Post13Trait uses the property that is reported by the warning.
The trait :
/**
* @property ValidatorInterface $validator
*/
trait Post13Trait
{
Yep, it should look into traits as well. Thank you for pointing out @COil!
@COil: checked, the inspection looks up for traits as well. Will it be possible to share simplified case with the false-positive?