1 | <?php |
||
24 | class SystemManager |
||
25 | { |
||
26 | /** |
||
27 | * @var string[] |
||
28 | */ |
||
29 | private const DEFAULT_SYSTEMS = [ |
||
30 | DefinitionSystem::class |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * @var array|SystemInterface[] |
||
35 | */ |
||
36 | private $systems = []; |
||
37 | |||
38 | /** |
||
39 | * @var Pipeline |
||
40 | */ |
||
41 | private $pipeline; |
||
42 | |||
43 | /** |
||
44 | * SystemManager constructor. |
||
45 | */ |
||
46 | public function __construct() |
||
52 | |||
53 | /** |
||
54 | * @return void |
||
55 | */ |
||
56 | private function bootDefaultSystems(): void |
||
62 | |||
63 | /** |
||
64 | * @param SystemInterface $system |
||
65 | * @return SystemManager |
||
66 | */ |
||
67 | public function addSystem(SystemInterface $system): SystemManager |
||
73 | |||
74 | /** |
||
75 | * @param Readable $readable |
||
76 | * @param RuleInterface $ast |
||
77 | * @return \Generator |
||
78 | */ |
||
79 | public function run(Readable $readable, RuleInterface $ast): \Generator |
||
86 | |||
87 | /** |
||
88 | * @return \Generator |
||
89 | */ |
||
90 | private function runDeferred(): \Generator |
||
103 | |||
104 | /** |
||
105 | * Applies additional result analyse. |
||
106 | * |
||
107 | * @param Readable $readable |
||
108 | * @param \Generator $result |
||
109 | * @return \Generator |
||
110 | */ |
||
111 | private function extract(Readable $readable, \Generator $result): \Generator |
||
132 | |||
133 | /** |
||
134 | * @param int $priority |
||
135 | * @param callable $value |
||
136 | * @return Emittable|DeferredInterface |
||
137 | */ |
||
138 | private function deferred(int $priority, callable $value): Emittable |
||
144 | |||
145 | /** |
||
146 | * Applies systems to all AST nodes. |
||
147 | * |
||
148 | * @param Readable $readable |
||
149 | * @param RuleInterface $ast |
||
150 | * @return \Generator |
||
151 | */ |
||
152 | private function apply(Readable $readable, RuleInterface $ast): \Generator |
||
164 | } |
||
165 |
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.