1 | <?php |
||
15 | class ControllerMethodName extends AbstractRule implements ClassAware |
||
16 | { |
||
17 | /** |
||
18 | * @param AbstractNode|ClassNode $node |
||
19 | */ |
||
20 | 6 | public function apply(AbstractNode $node) |
|
39 | |||
40 | /** |
||
41 | * @param ClassNode|ASTClass $node |
||
42 | * |
||
43 | * @return bool |
||
44 | */ |
||
45 | 6 | private function isController(ClassNode $node) |
|
57 | } |
||
58 |
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.