1 | <?php |
||
23 | final class BodyAnnotHandler implements AnnotationHandler |
||
24 | { |
||
25 | /** |
||
26 | * Sets the request method as 'json' and adds a parameter handler for body json data |
||
27 | * |
||
28 | * @param AbstractAnnotation $annotation The annotation to handle |
||
29 | * @param ServiceMethodBuilder $serviceMethodBuilder Used to construct a [@see ServiceMethod] |
||
30 | * @param Converter|RequestBodyConverter $converter Converter used to convert types before sending to service method |
||
31 | * @param int|null $index The position of the parameter or null if annotation does not reference parameter |
||
32 | * @return void |
||
33 | */ |
||
34 | 4 | public function handle( |
|
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.