1 | <?php |
||
14 | abstract class AbstractMethodNumberOf extends AbstractTestRule |
||
15 | { |
||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | private $names; |
||
20 | |||
21 | /** |
||
22 | * @var bool |
||
23 | */ |
||
24 | private $match; |
||
25 | |||
26 | /** |
||
27 | * @param AbstractNode|ClassNode $node |
||
28 | */ |
||
29 | 5 | public function apply(AbstractNode $node) |
|
47 | |||
48 | /** |
||
49 | * @param MethodNode $node |
||
50 | * |
||
51 | * @return int |
||
52 | */ |
||
53 | 3 | private function count(MethodNode $node) |
|
66 | |||
67 | /** |
||
68 | * @param AbstractNode $methodPostfix |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | 3 | private function isMethodPostfixInNames(AbstractNode $methodPostfix) |
|
80 | |||
81 | /** |
||
82 | * @param AbstractNode $methodPostfix |
||
83 | * |
||
84 | * @return bool |
||
85 | */ |
||
86 | 2 | private function isMethodPostfixContainsNames(AbstractNode $methodPostfix) |
|
96 | } |
||
97 |
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.