Conditions | 7 |
Paths | 5 |
Total Lines | 25 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 7.0178 |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | 5 | public function process(array &$symfonyService): array |
|
11 | { |
||
12 | 5 | $invokables = []; |
|
13 | |||
14 | 5 | foreach ($symfonyService as $name => $service) { |
|
15 | 5 | if (is_array($service) && array_key_exists('factory', $service)) { |
|
16 | continue; |
||
17 | } |
||
18 | |||
19 | 5 | if (empty($service)) { |
|
20 | 1 | $invokables[$name] = $name; |
|
21 | 1 | unset($symfonyService[$name]); |
|
22 | 1 | continue; |
|
23 | } |
||
24 | |||
25 | 5 | if (empty($service['arguments']) && isset($service['class'])) { |
|
26 | 2 | $invokables[$name] = $service['class']; |
|
27 | 2 | unset($symfonyService[$name]); |
|
28 | 2 | continue; |
|
29 | } |
||
30 | } |
||
31 | |||
32 | return [ |
||
33 | 'dependencies' => [ |
||
34 | 5 | 'services' => $invokables, |
|
35 | ], |
||
39 |