Conditions | 5 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 1 | public function map(array &$data, array $structure) |
|
19 | { |
||
20 | 1 | foreach ($structure as $key => $value) { |
|
21 | |||
22 | 1 | $keyData = &$data[$key]; |
|
23 | |||
24 | 1 | if (!isset($value['prefix'])) { |
|
25 | 1 | $this->map($keyData, $value); |
|
26 | 1 | } else { |
|
27 | 1 | foreach ((array) $value['type'] as $type) { |
|
28 | 1 | $type = $this->factory->create($type, $this->mapper, [ |
|
29 | 1 | 'prefix' => $value['prefix'], |
|
30 | 1 | 'use' => isset($value['use']) ? $value['use'] : '' |
|
31 | 1 | ]); |
|
32 | 1 | $type->run($keyData); |
|
33 | 1 | } |
|
34 | } |
||
35 | 1 | } |
|
36 | 1 | } |
|
37 | } |
||
38 |