1 | <?php |
||
11 | class DebugNodeVisitor extends NodeVisitorAbstract |
||
12 | { |
||
13 | protected $level = 0; |
||
14 | |||
15 | public function enterNode(NodeInterface $node) |
||
19 | |||
20 | public function leaveNode(NodeInterface $node) |
||
24 | |||
25 | public function beforeTraverse(array $nodes) |
||
30 | |||
31 | public function afterTraverse(array $nodes) |
||
36 | |||
37 | /** |
||
38 | * @param string $text |
||
39 | */ |
||
40 | protected function debug($text) |
||
44 | } |
||
45 |
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: