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