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