1 | <?php |
||
19 | class ControllerMethodName extends AbstractRule implements ClassAware |
||
20 | { |
||
21 | /** |
||
22 | * @param AbstractNode|ClassNode $node |
||
23 | */ |
||
24 | 3 | public function apply(AbstractNode $node) |
|
44 | |||
45 | /** |
||
46 | * @param ClassNode|ASTClass $node |
||
47 | * |
||
48 | * @return bool |
||
49 | */ |
||
50 | 3 | private function isController(ClassNode $node) |
|
62 | } |
||
63 |
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.