| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 2 | public function handle( |
|
| 35 | AbstractAnnotation $annotation, |
||
| 36 | ServiceMethodBuilder $serviceMethodBuilder, |
||
| 37 | ?Converter $converter, |
||
| 38 | ?int $index |
||
| 39 | ): void { |
||
| 40 | 2 | $serviceMethodBuilder->addParameterHandler($index, new PathParamHandler($converter, $annotation->getValue())); |
|
|
|
|||
| 41 | 2 | } |
|
| 42 | } |
||
| 43 |
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.