| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | 52 | public function getNode(): BaseToken |
|
| 18 | { |
||
| 19 | 52 | $stack = $this->tokenStream->getStack(); |
|
| 20 | 52 | $offset = $stack->current()->getOffset(); |
|
| 21 | 52 | $token = new TokenArray($this->getArrayItems(), $offset, $stack); |
|
| 22 | |||
| 23 | 40 | while ($this->hasMethodCall()) { |
|
| 24 | 8 | $token = $this->getMethod($token)->call(...$this->getArguments()); |
|
|
|
|||
| 25 | } |
||
| 26 | |||
| 27 | 40 | return $token; |
|
| 28 | } |
||
| 29 | } |
||
| 30 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: