| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| 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( |
|
| 41 | 2 | $index, |
|
| 42 | 2 | new HeaderParamHandler($converter, $annotation->getValue()) |
|
|
|
|||
| 43 | ); |
||
| 44 | 2 | } |
|
| 45 | } |
||
| 46 |
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.