| Conditions | 3 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 25 | 4 | public function invoke($calls) |
|
| 26 | { |
||
| 27 | 4 | $collection = $this->client->invoke($calls); |
|
| 28 | |||
| 29 | 4 | if (!$this->lazyCollection || $this->lazyCollection->getInnerCollection() !== $collection) { |
|
| 30 | 4 | $this->lazyCollection = new ExtraLazyResponseCollection($collection); |
|
|
|
|||
| 31 | 4 | } |
|
| 32 | |||
| 33 | 4 | return $this->lazyCollection; |
|
| 34 | } |
||
| 35 | } |
||
| 36 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.