Conditions | 5 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 5.0342 |
Changes | 0 |
1 | <?php |
||
50 | 1 | public function map(array $passedData, array $context = []) |
|
51 | { |
||
52 | 1 | $data = $passedData[$this->key]; |
|
53 | 1 | $result = []; |
|
54 | 1 | foreach ($this->mappers as $mapper) { |
|
55 | 1 | $this->outputKey = $mapper->outputKey(); |
|
56 | 1 | if (null === $data || !array_key_exists($mapper->key(), $data)) { |
|
57 | $result = null; |
||
58 | } else { |
||
59 | 1 | $result = $mapper->map($data, $context ?: $data); |
|
60 | } |
||
61 | } |
||
62 | |||
63 | 1 | return $result; |
|
64 | } |
||
65 | } |
||
66 |