Conditions | 3 |
Paths | 3 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
43 | public function transform($raw, array $mapping, $transformed = []) |
||
44 | { |
||
45 | foreach ($mapping as $destination => $source) { |
||
46 | $value = $this->propertyAccessor->isReadable($raw, $source) ? |
||
47 | $this->propertyAccessor->getValue($raw, $source) : null; |
||
48 | $this->propertyAccessor->setValue($transformed, $destination, $value); |
||
49 | } |
||
50 | return $transformed; |
||
51 | } |
||
52 | } |
||
53 |