| Conditions | 4 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | 12 | public function __construct(\SimpleXMLElement $xml) |
|
| 43 | { |
||
| 44 | 12 | if (empty($xml)) { |
|
| 45 | 6 | return; |
|
| 46 | } |
||
| 47 | |||
| 48 | // Single elements are by default not an array. |
||
| 49 | 12 | if (1 < count($xml->DeliveryFile)) { |
|
| 50 | 12 | foreach ($xml->DeliveryFile as $fileXml) { |
|
| 51 | 12 | $this->files[] = new InfoFile($fileXml); |
|
| 52 | 12 | } |
|
| 53 | 12 | return; |
|
| 54 | } |
||
| 55 | |||
| 56 | // Add a single file to the collection. |
||
| 57 | 3 | $this->files[] = new InfoFile($xml->DeliveryFile); |
|
| 58 | 3 | } |
|
| 59 | |||
| 110 |