1 | <?php |
||
13 | class VariableVariableUsage implements Pass\AnalyzerPassInterface, Pass\ConfigurablePassInterface |
||
14 | { |
||
15 | /** |
||
16 | * @param Expr\Assign $expr |
||
17 | * @param Context $context |
||
18 | * @return bool |
||
19 | */ |
||
20 | 11 | public function pass(Expr\Assign $expr, Context $context) |
|
28 | |||
29 | 11 | private function analyzeAssign(Expr\Assign $expr, Context $context) |
|
38 | |||
39 | 1 | private function analyzeList(Expr\List_ $expr, Context $context) |
|
49 | |||
50 | 1 | private function analyzeArrayDimFetch(Expr\ArrayDimFetch $expr, Context $context) |
|
54 | |||
55 | 11 | private function analyzeVar(Expr\Variable $var, Context $context) |
|
65 | |||
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | 1 | public function getRegister() |
|
75 | |||
76 | /** |
||
77 | * @return TreeBuilder |
||
78 | */ |
||
79 | public function getConfiguration() |
||
88 | } |
||
89 |
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.