1 | <?php |
||
23 | class Container implements ContainerInterface |
||
24 | { |
||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private $definitions = []; |
||
29 | |||
30 | /** |
||
31 | * @var array |
||
32 | */ |
||
33 | private $entries = []; |
||
34 | |||
35 | /** |
||
36 | * @var bool |
||
37 | */ |
||
38 | private $autowire = true; |
||
39 | |||
40 | /** |
||
41 | * @var ResolverFactoryInterface |
||
42 | */ |
||
43 | private $resolverFactory; |
||
44 | |||
45 | /** |
||
46 | * @var DefinitionFactoryInterface |
||
47 | */ |
||
48 | private $definitionFactory; |
||
49 | |||
50 | /** |
||
51 | * @param DefinitionFactoryInterface $definitionFactory |
||
52 | * @param ResolverFactoryInterface $resolverFactory |
||
53 | */ |
||
54 | 7 | public function __construct(DefinitionFactoryInterface $definitionFactory, ResolverFactoryInterface $resolverFactory) |
|
60 | |||
61 | /** |
||
62 | * @inheritDoc |
||
63 | */ |
||
64 | 7 | public function get($id) |
|
91 | |||
92 | /** |
||
93 | * @inheritDoc |
||
94 | */ |
||
95 | public function has($id): bool |
||
107 | |||
108 | /** |
||
109 | * @param bool $autowire |
||
110 | */ |
||
111 | 7 | public function setAutowire(bool $autowire): void |
|
115 | |||
116 | 6 | public function isAutowire(): bool |
|
120 | |||
121 | /** |
||
122 | * @param array $definitions |
||
123 | * |
||
124 | * @throws ContainerException |
||
125 | */ |
||
126 | 7 | public function addDefinitions(array $definitions): void |
|
132 | |||
133 | /** |
||
134 | * @param string $id |
||
135 | * @param $definition |
||
136 | * |
||
137 | * @throws ContainerException |
||
138 | */ |
||
139 | 7 | public function addDefinition(string $id, $definition): void |
|
147 | |||
148 | /** |
||
149 | * @param string $id |
||
150 | * |
||
151 | * @throws DefinitionNotFoundException |
||
152 | * @throws InvalidDefinitionException |
||
153 | * |
||
154 | * @return DefinitionInterface |
||
155 | */ |
||
156 | 7 | public function getDefinition(string $id): DefinitionInterface |
|
166 | |||
167 | /** |
||
168 | * @param string $id |
||
169 | * |
||
170 | * @return bool |
||
171 | */ |
||
172 | 7 | public function hasDefinition(string $id): bool |
|
176 | |||
177 | /** |
||
178 | * @param string $id |
||
179 | * @param mixed $entry |
||
180 | * |
||
181 | * @return mixed |
||
182 | */ |
||
183 | 7 | private function addEntry(string $id, $entry) |
|
187 | |||
188 | /** |
||
189 | * @param string $id |
||
190 | * |
||
191 | * @return null|mixed |
||
192 | */ |
||
193 | 7 | public function getEntry(string $id) |
|
197 | } |
||
198 |