| Conditions | 4 |
| Paths | 4 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4.0119 |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | 2 | public function process(array $config, array $service): array |
|
| 13 | { |
||
| 14 | 2 | $arguments = []; |
|
| 15 | /** |
||
| 16 | * @var string $argument |
||
| 17 | * @var string $value |
||
| 18 | */ |
||
| 19 | 2 | foreach ($service['arguments'] as $argument => $value) { |
|
| 20 | 2 | $isService = 0 === strpos($value, '@'); |
|
| 21 | 2 | if ($isService) { |
|
| 22 | 2 | $arguments[str_replace('$', '', $argument)] = str_replace('@', '', $value); |
|
| 23 | } else { |
||
| 24 | 2 | $index = str_replace(['%config%', '%config.', '%'], '', $value); |
|
| 25 | 2 | $arguments[str_replace('$', '', $argument)] = empty($index) |
|
| 26 | ? $config |
||
| 27 | 2 | : $config[$index]; |
|
| 28 | } |
||
| 29 | } |
||
| 30 | |||
| 31 | 2 | return $arguments; |
|
| 32 | } |
||
| 34 |