1 | <?php |
||
19 | class VariableBuilder extends BaseBuilder |
||
20 | { |
||
21 | /** |
||
22 | * @var string[] |
||
23 | */ |
||
24 | private const VARIABLE_DEFINITIONS = [ |
||
25 | 'ConstantDefinition', |
||
26 | 'VariableDefinition', |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * @param RuleInterface $rule |
||
31 | * @return bool |
||
32 | */ |
||
33 | public function match(RuleInterface $rule): bool |
||
37 | |||
38 | /** |
||
39 | * @param ContextInterface $ctx |
||
40 | * @param RuleInterface $rule |
||
41 | * @return \Generator|mixed|void |
||
42 | */ |
||
43 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
||
59 | |||
60 | /** |
||
61 | * @param RuleInterface $rule |
||
62 | * @return mixed |
||
63 | */ |
||
64 | private function getValue(RuleInterface $rule) |
||
68 | |||
69 | /** |
||
70 | * @param RuleInterface $rule |
||
71 | * @return bool |
||
72 | */ |
||
73 | private function isConstant(RuleInterface $rule): bool |
||
77 | } |
||
78 |
This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.