Conditions | 4 |
Paths | 5 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | 5 | public function transform(array $values) : array |
|
9 | { |
||
10 | 5 | $arrayFormatted = []; |
|
11 | |||
12 | 5 | foreach ($values as $key => $value) { |
|
13 | 2 | if (\is_array($value)) { |
|
14 | 2 | $value = $this->transform($value); |
|
15 | } |
||
16 | |||
17 | 2 | $keyFormatted = \is_string($key) ? $this->format($key) : $key; |
|
18 | |||
19 | 2 | $arrayFormatted[$keyFormatted] = $value; |
|
20 | } |
||
21 | |||
22 | 5 | return $arrayFormatted; |
|
23 | } |
||
27 |