| 1 | <?php  | 
            ||
| 23 | final class HeaderAnnotHandler implements AnnotationHandler  | 
            ||
| 24 | { | 
            ||
| 25 | /**  | 
            ||
| 26 | * Adds header param handler  | 
            ||
| 27 | *  | 
            ||
| 28 | * @param AbstractAnnotation $annotation The annotation to handle  | 
            ||
| 29 | * @param ServiceMethodBuilder $serviceMethodBuilder Used to construct a [@see ServiceMethod]  | 
            ||
| 30 | * @param Converter|StringConverter $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 | 2 | public function handle(  | 
            |
| 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.