| Conditions | 5 |
| Paths | 5 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 26 | public function leaveNode(Node $node) |
||
| 27 | { |
||
| 28 | if (!$node instanceof ClassMethod) { |
||
| 29 | return; |
||
| 30 | } |
||
| 31 | $doc = $node->getDocComment(); |
||
|
|
|||
| 32 | if (!$doc) { |
||
| 33 | return; |
||
| 34 | } |
||
| 35 | $search = []; |
||
| 36 | $replace = []; |
||
| 37 | foreach ($this->typeMap as $type => $argument) { |
||
| 38 | foreach ($this->annotations as $annotation) { |
||
| 39 | $search[] = sprintf($annotation, $type); |
||
| 40 | $replace[] = sprintf($annotation, $argument); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | $node->setDocComment(new Doc(str_replace($search, $replace, $doc))); |
||
| 44 | } |
||
| 46 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.