Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
13 | 17 | public static function map($object, SimpleXMLElement $xml, array $mapping) |
|
14 | { |
||
15 | 17 | foreach ($mapping as $line) { |
|
16 | 17 | $setter = $line[0]; |
|
17 | 17 | $xmlValue = $line[1]; |
|
18 | |||
19 | 17 | if (isset($xml->$xmlValue)) { |
|
20 | 17 | $object->$setter((string) $xml->$xmlValue); |
|
21 | 17 | } |
|
22 | 17 | } |
|
23 | 17 | } |
|
24 | } |
||
25 |