Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | protected function createUseNode(array $nodePrefixParts, Node $useNode) |
||
26 | { |
||
27 | $fullClassName = array_merge($nodePrefixParts, [$useNode->name]); |
||
|
|||
28 | |||
29 | $nameNode = new Node\Name($fullClassName); |
||
30 | |||
31 | $alias = ($useNode->alias == $useNode->name) ? null : $useNode->alias; |
||
32 | |||
33 | $useNode = new Node\Stmt\Use_([new Node\Stmt\UseUse($nameNode, $alias)], $useNode->type); |
||
34 | |||
35 | return $useNode; |
||
36 | } |
||
37 | } |
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: