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) |
|
76 | |||
77 | /** |
||
78 | * @inheritDoc |
||
79 | */ |
||
80 | public function has($id): bool |
||
92 | |||
93 | /** |
||
94 | * @param bool $autowire |
||
95 | */ |
||
96 | 6 | public function setAutowire(bool $autowire): void |
|
100 | |||
101 | 5 | public function isAutowire(): bool |
|
105 | |||
106 | /** |
||
107 | * @param array $definitions |
||
108 | * |
||
109 | * @throws ContainerException |
||
110 | */ |
||
111 | 6 | public function addDefinitions(array $definitions): void |
|
117 | |||
118 | /** |
||
119 | * @param string $id |
||
120 | * @param $definition |
||
121 | * |
||
122 | * @throws ContainerException |
||
123 | */ |
||
124 | 6 | public function addDefinition(string $id, $definition): void |
|
132 | |||
133 | /** |
||
134 | * @param string $id |
||
135 | * |
||
136 | * @return null|mixed |
||
137 | */ |
||
138 | 6 | public function getDefinition(string $id) |
|
142 | |||
143 | /** |
||
144 | * @param string $id |
||
145 | * |
||
146 | * @return bool |
||
147 | */ |
||
148 | 6 | public function hasDefinition(string $id): bool |
|
152 | |||
153 | /** |
||
154 | * @param string $id |
||
155 | * @param mixed $entry |
||
156 | * |
||
157 | * @return mixed |
||
158 | */ |
||
159 | 6 | private function addEntry(string $id, $entry) |
|
163 | |||
164 | /** |
||
165 | * @param string $id |
||
166 | * |
||
167 | * @return null|mixed |
||
168 | */ |
||
169 | 6 | public function getEntry(string $id) |
|
173 | } |
||
174 |