1 | <?php |
||
20 | class RuleResolver implements ResolverInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var array|array[] |
||
24 | */ |
||
25 | private $rules = []; |
||
26 | |||
27 | /** |
||
28 | * @var string|null |
||
29 | */ |
||
30 | private $current; |
||
31 | |||
32 | /** |
||
33 | * @var array|string[] |
||
34 | */ |
||
35 | private $keep = []; |
||
36 | |||
37 | /** |
||
38 | * @var array|string[] |
||
39 | */ |
||
40 | private $delegates = []; |
||
41 | |||
42 | /** |
||
43 | * @var array|Readable[] |
||
44 | */ |
||
45 | private $files = []; |
||
46 | |||
47 | /** |
||
48 | * @param Readable $readable |
||
49 | * @param TokenInterface $token |
||
50 | * @throws \Railt\Io\Exception\ExternalFileException |
||
51 | */ |
||
52 | public function resolve(Readable $readable, TokenInterface $token): void |
||
68 | |||
69 | /** |
||
70 | * @param Readable $readable |
||
71 | * @param TokenInterface $token |
||
72 | * @return bool |
||
73 | * @throws \Railt\Io\Exception\ExternalFileException |
||
74 | */ |
||
75 | private function next(Readable $readable, TokenInterface $token): bool |
||
89 | |||
90 | /** |
||
91 | * @param Readable $readable |
||
92 | * @param TokenInterface $token |
||
93 | * @throws \Railt\Io\Exception\ExternalFileException |
||
94 | */ |
||
95 | private function resolveCurrent(Readable $readable, TokenInterface $token): void |
||
109 | |||
110 | /** |
||
111 | * @param string $delegate |
||
112 | * @param Readable $readable |
||
113 | * @param TokenInterface $token |
||
114 | * @throws \Railt\Io\Exception\ExternalFileException |
||
115 | */ |
||
116 | private function resolveDelegate(string $delegate, Readable $readable, TokenInterface $token): void |
||
132 | |||
133 | /** |
||
134 | * @return array |
||
135 | */ |
||
136 | public function getRules(): array |
||
140 | |||
141 | /** |
||
142 | * @return array |
||
143 | */ |
||
144 | public function getParsedRules(): array |
||
148 | |||
149 | /** |
||
150 | * @return array|string[] |
||
151 | */ |
||
152 | public function getKeep(): array |
||
156 | |||
157 | /** |
||
158 | * @return array|string[] |
||
159 | */ |
||
160 | public function getDelegates(): array |
||
164 | |||
165 | /** |
||
166 | * @return array |
||
167 | */ |
||
168 | public function getFiles(): array |
||
172 | } |
||
173 |
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.