Conditions | 8 |
Paths | 8 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 8 |
Changes | 0 |
1 | <?php |
||
27 | 4 | public function enterNode(Node $node): int|Node|null |
|
28 | { |
||
29 | 4 | if ($node instanceof Namespace_) { |
|
30 | 4 | $this->namespace = (string) $node->name; |
|
31 | } |
||
32 | |||
33 | 4 | if ($node instanceof Class_ || $node instanceof Trait_ || $node instanceof Interface_ || $node instanceof Enum_) { |
|
34 | 4 | $this->className = (string) $node->name; |
|
35 | } |
||
36 | |||
37 | 4 | if ($this->namespace !== null && $this->className !== null) { |
|
38 | 4 | $this->classDependencies->setFqn(new Fqn(sprintf('%s\%s', $this->namespace, $this->className))); |
|
39 | } |
||
40 | |||
41 | 4 | return parent::enterNode($node); |
|
|
|||
42 | } |
||
44 |
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.