Conditions | 5 |
Paths | 8 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | public function handle($value): mixed |
||
22 | { |
||
23 | if (is_array($value) && isset($value['className'])) { |
||
24 | try { |
||
25 | $object = $this->createInstance($value['className'], $value['arguments'] ?? []); |
||
26 | foreach ($value['methods'] ?? [] as $method) { |
||
27 | $this->callMethod($object, $method['methodName'], $method['arguments'] ?? []); |
||
28 | } |
||
29 | } catch (ReflectionException $exception) { |
||
30 | throw new ContainerException($exception->getMessage()); |
||
31 | } |
||
32 | |||
33 | return $object; |
||
34 | } |
||
35 | |||
36 | return parent::handle($value); |
||
37 | } |
||
39 |