1 | <?php |
||
21 | class Container implements ContainerInterface |
||
22 | { |
||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $definitions = []; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private $entries = []; |
||
32 | |||
33 | /** |
||
34 | * @var bool |
||
35 | */ |
||
36 | private $autowire = true; |
||
37 | |||
38 | /** |
||
39 | * @var ResolverFactoryInterface |
||
40 | */ |
||
41 | private $resolverFactory; |
||
42 | |||
43 | /** |
||
44 | * @param ResolverFactoryInterface $resolverFactory |
||
45 | */ |
||
46 | 7 | public function __construct(ResolverFactoryInterface $resolverFactory) |
|
51 | |||
52 | /** |
||
53 | * @inheritDoc |
||
54 | */ |
||
55 | 7 | public function get($id) |
|
84 | |||
85 | /** |
||
86 | * @inheritDoc |
||
87 | */ |
||
88 | public function has($id): bool |
||
100 | |||
101 | /** |
||
102 | * @param bool $autowire |
||
103 | */ |
||
104 | 7 | public function setAutowire(bool $autowire): void |
|
108 | |||
109 | 6 | public function isAutowire(): bool |
|
113 | |||
114 | /** |
||
115 | * @param array $definitions |
||
116 | * |
||
117 | * @throws ContainerException |
||
118 | */ |
||
119 | 7 | public function addDefinitions(array $definitions): void |
|
125 | |||
126 | /** |
||
127 | * @param string $id |
||
128 | * @param $definition |
||
129 | * |
||
130 | * @throws ContainerException |
||
131 | */ |
||
132 | 7 | public function addDefinition(string $id, $definition): void |
|
140 | |||
141 | /** |
||
142 | * @param string $id |
||
143 | * |
||
144 | * @return null|mixed |
||
145 | */ |
||
146 | 7 | public function getDefinition(string $id) |
|
150 | |||
151 | /** |
||
152 | * @param $definition |
||
153 | * |
||
154 | * @return mixed |
||
155 | */ |
||
156 | 7 | private function transformDefinition($definition) |
|
168 | |||
169 | /** |
||
170 | * @param string $id |
||
171 | * |
||
172 | * @return bool |
||
173 | */ |
||
174 | 7 | public function hasDefinition(string $id): bool |
|
178 | |||
179 | /** |
||
180 | * @param string $id |
||
181 | * @param mixed $entry |
||
182 | * |
||
183 | * @return mixed |
||
184 | */ |
||
185 | 7 | private function addEntry(string $id, $entry) |
|
189 | |||
190 | /** |
||
191 | * @param string $id |
||
192 | * |
||
193 | * @return null|mixed |
||
194 | */ |
||
195 | 7 | public function getEntry(string $id) |
|
199 | } |
||
200 |