1 | <?php |
||
24 | class Container implements ContainerInterface |
||
25 | { |
||
26 | /** |
||
27 | * @var ArrayObject |
||
28 | */ |
||
29 | private $definitions; |
||
30 | |||
31 | /** |
||
32 | * @var ArrayObject |
||
33 | */ |
||
34 | private $entries; |
||
35 | |||
36 | /** |
||
37 | * @var bool |
||
38 | */ |
||
39 | private $autowire = true; |
||
40 | |||
41 | /** |
||
42 | * @var ResolverFactoryInterface |
||
43 | */ |
||
44 | private $resolverFactory; |
||
45 | |||
46 | /** |
||
47 | * @var DefinitionFactoryInterface |
||
48 | */ |
||
49 | private $definitionFactory; |
||
50 | |||
51 | /** |
||
52 | * @param DefinitionFactoryInterface $definitionFactory |
||
53 | * @param ResolverFactoryInterface $resolverFactory |
||
54 | */ |
||
55 | 7 | public function __construct(DefinitionFactoryInterface $definitionFactory, ResolverFactoryInterface $resolverFactory) |
|
63 | |||
64 | /** |
||
65 | * @inheritDoc |
||
66 | */ |
||
67 | 7 | public function get($id) |
|
83 | |||
84 | /** |
||
85 | * @inheritDoc |
||
86 | */ |
||
87 | public function has($id): bool |
||
99 | |||
100 | /** |
||
101 | * @param string $id |
||
102 | * |
||
103 | * @throws ContainerException |
||
104 | * @throws DefinitionNotFoundException |
||
105 | * @throws InvalidDefinitionException |
||
106 | * @throws NotFoundException |
||
107 | * |
||
108 | * @return mixed |
||
109 | */ |
||
110 | 7 | private function resolveEntry(string $id) |
|
119 | |||
120 | /** |
||
121 | * @param bool $autowire |
||
122 | */ |
||
123 | 7 | public function setAutowire(bool $autowire): void |
|
127 | |||
128 | 6 | public function isAutowire(): bool |
|
132 | |||
133 | /** |
||
134 | * @param array $definitions |
||
135 | * |
||
136 | * @throws ContainerException |
||
137 | */ |
||
138 | 7 | public function addDefinitions(array $definitions): void |
|
144 | |||
145 | /** |
||
146 | * @param string $id |
||
147 | * @param $definition |
||
148 | * |
||
149 | * @throws ContainerException |
||
150 | */ |
||
151 | 7 | public function addDefinition(string $id, $definition): void |
|
159 | |||
160 | /** |
||
161 | * @param string $id |
||
162 | * |
||
163 | * @throws DefinitionNotFoundException |
||
164 | * @throws InvalidDefinitionException |
||
165 | * |
||
166 | * @return DefinitionInterface |
||
167 | */ |
||
168 | 7 | public function getDefinition(string $id): DefinitionInterface |
|
184 | } |
||
185 |