1 | <?php |
||
6 | class Container |
||
7 | { |
||
8 | /** |
||
9 | * |
||
10 | * @var mixed[] |
||
11 | */ |
||
12 | protected $config = array(); |
||
13 | |||
14 | /** |
||
15 | * |
||
16 | * @var \DICIT\ArrayResolver |
||
17 | */ |
||
18 | protected $parameters; |
||
19 | |||
20 | /** |
||
21 | * |
||
22 | * @var \DICIT\ArrayResolver |
||
23 | */ |
||
24 | protected $classes; |
||
25 | |||
26 | /** |
||
27 | * |
||
28 | * @var \DICIT\Registry |
||
29 | */ |
||
30 | protected $registry = null; |
||
31 | |||
32 | /** |
||
33 | * |
||
34 | * @var \DICIT\ActivatorFactory |
||
35 | */ |
||
36 | protected $activatorFactory = null; |
||
37 | |||
38 | /** |
||
39 | * |
||
40 | * @var \DICIT\InjectorFactory |
||
41 | */ |
||
42 | protected $injectorFactory = null; |
||
43 | |||
44 | /** |
||
45 | * |
||
46 | * @var \DICIT\EncapsulatorFactory |
||
47 | */ |
||
48 | protected $encapsulatorFactory = null; |
||
49 | |||
50 | /** |
||
51 | * |
||
52 | * @var \DICIT\ReferenceResolver |
||
53 | */ |
||
54 | protected $referenceResolver = null; |
||
55 | |||
56 | /** |
||
57 | * |
||
58 | * @param Config\AbstractConfig $cfg |
||
59 | * @param ActivatorFactory $activatorFactory |
||
60 | * @param InjectorFactory $injectorFactory |
||
61 | */ |
||
62 | public function __construct(Config\AbstractConfig $cfg, |
||
76 | |||
77 | /** |
||
78 | * Binds an existing object or an object definition to a key in the container. |
||
79 | * @param string $key The key to which the new object/definition should be bound. |
||
80 | * @param mixed $item An array or an object to bind. |
||
81 | * If $item is an object, it will be registered as a singleton in the |
||
82 | * object registry. Otherwise, $item will be handled as an object definition. |
||
83 | */ |
||
84 | public function bind($key, $item) |
||
92 | |||
93 | /** |
||
94 | * Set a parameter in the container on any key |
||
95 | * @param [type] $key [description] |
||
96 | * @param [type] $value [description] |
||
97 | */ |
||
98 | public function setParameter($key, $value) |
||
123 | |||
124 | /** |
||
125 | * Retrieve the parameter value configured in the container |
||
126 | * @param string $parameterName |
||
127 | * @return mixed |
||
128 | */ |
||
129 | public function getParameter($parameterName) |
||
139 | |||
140 | public function has($serviceName) |
||
148 | |||
149 | |||
150 | /** |
||
151 | * Retrieve a class configured in the container |
||
152 | * @param string $serviceName |
||
153 | * @return object |
||
154 | */ |
||
155 | public function get($serviceName) |
||
175 | |||
176 | |||
177 | public function resolve($reference) |
||
181 | |||
182 | /** |
||
183 | * Resolves an array of references. |
||
184 | * @param array $references |
||
185 | * @return array containing all the resolved references |
||
186 | */ |
||
187 | public function resolveMany(array $references = null) |
||
195 | |||
196 | /** |
||
197 | * Flush the registry |
||
198 | * @return Container |
||
199 | */ |
||
200 | public function flushRegistry() |
||
205 | |||
206 | /** |
||
207 | * Chain of command of the class loader |
||
208 | * @param array $serviceConfig |
||
209 | * @param string $serviceName |
||
210 | * @return object |
||
211 | */ |
||
212 | protected function loadService($serviceName, $serviceConfig) |
||
232 | |||
233 | /** |
||
234 | * Handles class instanciation |
||
235 | * @param array $serviceConfig |
||
236 | * @param string $serviceName |
||
237 | * @return object |
||
238 | */ |
||
239 | protected function activate($serviceName, $serviceConfig) |
||
245 | |||
246 | /** |
||
247 | * Handle method invocations in the class |
||
248 | * @param object $class |
||
249 | * @param array $serviceConfig |
||
250 | * @return boolean |
||
251 | */ |
||
252 | protected function inject($class, $serviceConfig) |
||
262 | |||
263 | /** |
||
264 | * Interceptor handler |
||
265 | * @param object $class |
||
266 | * @param array $serviceConfig |
||
267 | * @return object |
||
268 | */ |
||
269 | protected function encapsulate($class, $serviceConfig) |
||
279 | |||
280 | /** |
||
281 | * Check that the value to bind is a scalar, or an array multi-dimensional of scalars |
||
282 | * @param string $key |
||
283 | * @param mixed $value |
||
284 | * @return boolean |
||
285 | * |
||
286 | * @throws IllegalTypeException |
||
287 | * |
||
288 | */ |
||
289 | protected function validateParameter($key, $value) |
||
310 | } |
||
311 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..