1 | <?php |
||
25 | class DetectorVisitor extends NodeVisitorAbstract |
||
26 | { |
||
27 | /** |
||
28 | * @var FileReport |
||
29 | */ |
||
30 | private $fileReport; |
||
31 | |||
32 | /** |
||
33 | * @var Option |
||
34 | */ |
||
35 | private $option; |
||
36 | |||
37 | /** |
||
38 | * @param FileReport $fileReport |
||
39 | * @param Option $option |
||
40 | */ |
||
41 | public function __construct(FileReport $fileReport, Option $option) |
||
46 | |||
47 | /** |
||
48 | * @inheritdoc |
||
49 | */ |
||
50 | public function enterNode(Node $node) |
||
76 | |||
77 | /** |
||
78 | * @param Node $node |
||
79 | * |
||
80 | * @return bool |
||
81 | */ |
||
82 | private function isNumber(Node $node) |
||
96 | |||
97 | /** |
||
98 | * @param Node $node |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | private function isString(Node $node) |
||
106 | |||
107 | /** |
||
108 | * @param LNumber|DNumber|Node $node |
||
109 | * |
||
110 | * @return bool |
||
111 | */ |
||
112 | private function ignoreNumber(Node $node) |
||
116 | |||
117 | /** |
||
118 | * @param String_|Node $node |
||
119 | * |
||
120 | * @return bool |
||
121 | */ |
||
122 | private function ignoreString(Node $node) |
||
126 | |||
127 | /** |
||
128 | * @param Node $node |
||
129 | * |
||
130 | * @return bool |
||
131 | */ |
||
132 | private function hasSign(Node $node) |
||
136 | |||
137 | /** |
||
138 | * @param Node $node |
||
139 | * |
||
140 | * @return bool |
||
141 | */ |
||
142 | private function isMinus(Node $node) |
||
146 | |||
147 | /** |
||
148 | * @param Node $node |
||
149 | * @param Extension $extension |
||
150 | * |
||
151 | * @return bool |
||
152 | */ |
||
153 | private function ignoreFunc(Node $node, Extension $extension) |
||
161 | } |
||
162 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: