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 = true; |
||
46 | |||
47 | /** |
||
48 | * @var ResolverFactoryInterface |
||
49 | */ |
||
50 | private $resolverFactory; |
||
51 | |||
52 | /** |
||
53 | * @var DefinitionFactoryInterface |
||
54 | */ |
||
55 | private $definitionFactory; |
||
56 | |||
57 | /** |
||
58 | * @param DefinitionFactoryInterface $definitionFactory |
||
59 | * @param ResolverFactoryInterface $resolverFactory |
||
60 | */ |
||
61 | 18 | public function __construct(DefinitionFactoryInterface $definitionFactory, ResolverFactoryInterface $resolverFactory) |
|
70 | |||
71 | /** |
||
72 | * @inheritDoc |
||
73 | */ |
||
74 | 18 | public function get($id) |
|
90 | |||
91 | /** |
||
92 | * @inheritDoc |
||
93 | */ |
||
94 | 3 | public function has($id): bool |
|
106 | |||
107 | /** |
||
108 | * @param string $id |
||
109 | * |
||
110 | * @throws CircularDependencyFoundException |
||
111 | * @throws ClassNotFoundException |
||
112 | * @throws ContainerException |
||
113 | * @throws DefinitionNotFoundException |
||
114 | * @throws InvalidDefinitionException |
||
115 | * |
||
116 | * @return mixed |
||
117 | */ |
||
118 | 16 | private function resolveEntry(string $id) |
|
128 | |||
129 | /** |
||
130 | * @param bool $autowire |
||
131 | */ |
||
132 | 18 | public function setAutowire(bool $autowire): void |
|
136 | |||
137 | 10 | private function isAutowire(): bool |
|
141 | |||
142 | /** |
||
143 | * @param ArrayObject $definitions |
||
144 | */ |
||
145 | 18 | public function setDefinitions(ArrayObject $definitions): void |
|
149 | |||
150 | /** |
||
151 | * @param string $id |
||
152 | * |
||
153 | * @throws DefinitionNotFoundException |
||
154 | * @throws InvalidDefinitionException |
||
155 | * |
||
156 | * @return DefinitionInterface |
||
157 | */ |
||
158 | 16 | private function getDefinition(string $id): DefinitionInterface |
|
174 | |||
175 | /** |
||
176 | * @param string $id |
||
177 | * |
||
178 | * @throws CircularDependencyFoundException |
||
179 | * |
||
180 | * @return void |
||
181 | */ |
||
182 | 14 | private function startResolving(string $id): void |
|
190 | |||
191 | /** |
||
192 | * @param string $id |
||
193 | * |
||
194 | * @return void |
||
195 | */ |
||
196 | 9 | private function endResolving(string $id): void |
|
202 | } |
||
203 |