Conditions | 3 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | protected function iOc(string $key, $object, $params = null): void |
||
40 | { |
||
41 | $reflection = new ReflectionClass($object); |
||
42 | $constructor = $reflection->getConstructor(); |
||
43 | |||
44 | if ($constructor && $constructor->getNumberOfParameters()) { |
||
45 | $paramsIoC = $this->getParamsIoC($constructor, $params); |
||
46 | $this->objects[$key] = $reflection->newInstanceArgs($paramsIoC); |
||
47 | return; |
||
48 | } |
||
49 | |||
50 | $this->objects[$key] = new $object; |
||
51 | } |
||
79 | } |