Conditions | 4 |
Paths | 6 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
28 | 9 | public function __invoke(ContainerInterface $container) |
|
29 | { |
||
30 | 9 | $args = []; |
|
31 | 9 | foreach ($this->dependencies as $dependecy) { |
|
32 | 6 | $args[] = $container->get($dependecy); |
|
33 | } |
||
34 | 9 | if (count($args) > 0) { |
|
35 | 6 | $variadic = array_pop($args); |
|
36 | 6 | if (!is_array($variadic)) { |
|
37 | 3 | throw new InvalidArgumentException('must be array'); |
|
38 | } |
||
39 | 3 | $args = array_merge($args, $variadic); |
|
40 | } |
||
41 | 6 | return new $this->className(...$args); |
|
42 | } |
||
44 |