Conditions | 2 |
Paths | 1 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
59 | public function build(Container $container, $serviceName) |
||
60 | { |
||
61 | $factory = $this->factory; |
||
62 | |||
63 | return \array_reduce( |
||
64 | $this->delegators, |
||
65 | static function ($instance, $delegatorName) use ($serviceName, $container) { |
||
66 | $delegator = \is_callable($delegatorName) ? $delegatorName : new $delegatorName(); |
||
67 | |||
68 | return $delegator($container, $serviceName, static function () use ($instance) { |
||
69 | return $instance; |
||
70 | }); |
||
71 | }, |
||
72 | $factory() |
||
73 | ); |
||
76 |