1 | <?php |
||
11 | abstract class AbstractNumberOf extends AbstractTest |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private $names; |
||
17 | |||
18 | /** |
||
19 | * @var bool |
||
20 | */ |
||
21 | private $match; |
||
22 | |||
23 | /** |
||
24 | * @param AbstractNode|ClassNode $node |
||
25 | */ |
||
26 | 3 | public function apply(AbstractNode $node) |
|
44 | |||
45 | /** |
||
46 | * @param MethodNode $node |
||
47 | * |
||
48 | * @return int |
||
49 | */ |
||
50 | 2 | private function count(MethodNode $node) |
|
63 | |||
64 | /** |
||
65 | * @param AbstractNode $methodPostfix |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | 2 | private function isMethodPostfixInNames(AbstractNode $methodPostfix) |
|
77 | |||
78 | /** |
||
79 | * @param AbstractNode $methodPostfix |
||
80 | * |
||
81 | * @return bool |
||
82 | */ |
||
83 | 2 | private function isMethodPostfixContainsNames(AbstractNode $methodPostfix) |
|
93 | } |
||
94 |
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.