1 | <?php |
||
25 | class Container implements ContainerInterface |
||
26 | { |
||
27 | /** |
||
28 | * @var ArrayObject |
||
29 | */ |
||
30 | private $definitions; |
||
31 | |||
32 | /** |
||
33 | * @var ArrayObject |
||
34 | */ |
||
35 | private $entries; |
||
36 | |||
37 | /** |
||
38 | * @var ArrayObject |
||
39 | */ |
||
40 | private $resolving; |
||
41 | |||
42 | /** |
||
43 | * @var bool |
||
44 | */ |
||
45 | private $autowire; |
||
46 | |||
47 | /** |
||
48 | * @var bool |
||
49 | */ |
||
50 | private $annotations; |
||
51 | |||
52 | /** |
||
53 | * @var ResolverFactoryInterface |
||
54 | */ |
||
55 | private $resolverFactory; |
||
56 | |||
57 | /** |
||
58 | * @var DefinitionFactoryInterface |
||
59 | */ |
||
60 | private $definitionFactory; |
||
61 | |||
62 | /** |
||
63 | * @param DefinitionFactoryInterface $definitionFactory |
||
64 | * @param ResolverFactoryInterface $resolverFactory |
||
65 | */ |
||
66 | 19 | public function __construct(DefinitionFactoryInterface $definitionFactory, ResolverFactoryInterface $resolverFactory) |
|
75 | |||
76 | /** |
||
77 | * @inheritDoc |
||
78 | */ |
||
79 | 19 | public function get($id) |
|
95 | |||
96 | /** |
||
97 | * @inheritDoc |
||
98 | */ |
||
99 | 3 | public function has($id): bool |
|
111 | |||
112 | /** |
||
113 | * @param string $id |
||
114 | * |
||
115 | * @throws CircularDependencyFoundException |
||
116 | * @throws ClassNotFoundException |
||
117 | * @throws ContainerException |
||
118 | * @throws DefinitionNotFoundException |
||
119 | * @throws InvalidDefinitionException |
||
120 | * |
||
121 | * @return mixed |
||
122 | */ |
||
123 | 17 | private function resolveEntry(string $id) |
|
133 | |||
134 | /** |
||
135 | * @param bool $autowire |
||
136 | */ |
||
137 | 19 | public function setAutowire(bool $autowire): void |
|
141 | |||
142 | 11 | private function isAutowireEnabled(): bool |
|
146 | |||
147 | /** |
||
148 | * @param bool $annotations |
||
149 | */ |
||
150 | 19 | public function setAnnotations(bool $annotations): void |
|
154 | |||
155 | /** |
||
156 | * @return bool |
||
157 | */ |
||
158 | 9 | public function areAnnotationsEnabled(): bool |
|
162 | |||
163 | /** |
||
164 | * @param ArrayObject $definitions |
||
165 | */ |
||
166 | 19 | public function setDefinitions(ArrayObject $definitions): void |
|
170 | |||
171 | /** |
||
172 | * @param string $id |
||
173 | * |
||
174 | * @throws DefinitionNotFoundException |
||
175 | * @throws InvalidDefinitionException |
||
176 | * |
||
177 | * @return DefinitionInterface |
||
178 | */ |
||
179 | 17 | private function getDefinition(string $id): DefinitionInterface |
|
195 | |||
196 | /** |
||
197 | * @param string $id |
||
198 | * |
||
199 | * @throws CircularDependencyFoundException |
||
200 | * |
||
201 | * @return void |
||
202 | */ |
||
203 | 15 | private function startResolving(string $id): void |
|
211 | |||
212 | /** |
||
213 | * @param string $id |
||
214 | * |
||
215 | * @return void |
||
216 | */ |
||
217 | 10 | private function endResolving(string $id): void |
|
223 | } |
||
224 |