1 | <?php |
||
19 | class Container implements ContainerInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $definitions = []; |
||
25 | |||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | private $entries = []; |
||
30 | |||
31 | /** |
||
32 | * @var bool |
||
33 | */ |
||
34 | private $autowire = true; |
||
35 | |||
36 | /** |
||
37 | * @var ResolverFactoryInterface |
||
38 | */ |
||
39 | private $resolverFactory; |
||
40 | |||
41 | /** |
||
42 | * @param ResolverFactoryInterface $resolverFactory |
||
43 | */ |
||
44 | 6 | public function __construct(ResolverFactoryInterface $resolverFactory) |
|
49 | |||
50 | /** |
||
51 | * @inheritDoc |
||
52 | */ |
||
53 | 6 | public function get($id) |
|
81 | |||
82 | /** |
||
83 | * @inheritDoc |
||
84 | */ |
||
85 | public function has($id): bool |
||
97 | |||
98 | /** |
||
99 | * @param bool $autowire |
||
100 | */ |
||
101 | 6 | public function setAutowire(bool $autowire): void |
|
105 | |||
106 | 5 | public function isAutowire(): bool |
|
110 | |||
111 | /** |
||
112 | * @param array $definitions |
||
113 | * |
||
114 | * @throws ContainerException |
||
115 | */ |
||
116 | 6 | public function addDefinitions(array $definitions): void |
|
122 | |||
123 | /** |
||
124 | * @param string $id |
||
125 | * @param $definition |
||
126 | * |
||
127 | * @throws ContainerException |
||
128 | */ |
||
129 | 6 | public function addDefinition(string $id, $definition): void |
|
137 | |||
138 | /** |
||
139 | * @param string $id |
||
140 | * |
||
141 | * @return null|mixed |
||
142 | */ |
||
143 | 6 | public function getDefinition(string $id) |
|
147 | |||
148 | /** |
||
149 | * @param string $id |
||
150 | * |
||
151 | * @return bool |
||
152 | */ |
||
153 | 6 | public function hasDefinition(string $id): bool |
|
157 | |||
158 | /** |
||
159 | * @param string $id |
||
160 | * @param mixed $entry |
||
161 | * |
||
162 | * @return mixed |
||
163 | */ |
||
164 | 6 | private function addEntry(string $id, $entry) |
|
168 | |||
169 | /** |
||
170 | * @param string $id |
||
171 | * |
||
172 | * @return null|mixed |
||
173 | */ |
||
174 | 6 | public function getEntry(string $id) |
|
178 | } |
||
179 |