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 | * @param ResolverFactoryInterface $resolverFactory |
||
47 | */ |
||
48 | 7 | public function __construct(ResolverFactoryInterface $resolverFactory) |
|
53 | |||
54 | /** |
||
55 | * @inheritDoc |
||
56 | */ |
||
57 | 7 | public function get($id) |
|
90 | |||
91 | /** |
||
92 | * @inheritDoc |
||
93 | */ |
||
94 | public function has($id): bool |
||
106 | |||
107 | /** |
||
108 | * @param bool $autowire |
||
109 | */ |
||
110 | 7 | public function setAutowire(bool $autowire): void |
|
114 | |||
115 | 6 | public function isAutowire(): bool |
|
119 | |||
120 | /** |
||
121 | * @param array $definitions |
||
122 | * |
||
123 | * @throws ContainerException |
||
124 | */ |
||
125 | 7 | public function addDefinitions(array $definitions): void |
|
131 | |||
132 | /** |
||
133 | * @param string $id |
||
134 | * @param $definition |
||
135 | * |
||
136 | * @throws ContainerException |
||
137 | */ |
||
138 | 7 | public function addDefinition(string $id, $definition): void |
|
146 | |||
147 | /** |
||
148 | * @param string $id |
||
149 | * |
||
150 | * @return null|mixed |
||
151 | */ |
||
152 | 7 | public function getDefinition(string $id) |
|
156 | |||
157 | /** |
||
158 | * @param string $id |
||
159 | * |
||
160 | * @return bool |
||
161 | */ |
||
162 | 7 | public function hasDefinition(string $id): bool |
|
166 | |||
167 | /** |
||
168 | * @param string $id |
||
169 | * @param mixed $entry |
||
170 | * |
||
171 | * @return mixed |
||
172 | */ |
||
173 | 7 | private function addEntry(string $id, $entry) |
|
177 | |||
178 | /** |
||
179 | * @param string $id |
||
180 | * |
||
181 | * @return null|mixed |
||
182 | */ |
||
183 | 7 | public function getEntry(string $id) |
|
187 | } |
||
188 |