| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4.125 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 48 | 1 | public function toNode(DOMDocument $document = null) |
|
| 49 | { |
||
| 50 | 1 | if (null === $document) { |
|
| 51 | $document = new DOMDocument(); |
||
| 52 | } |
||
| 53 | |||
| 54 | 1 | $node = $document->createElement('PackingListInfo'); |
|
| 55 | |||
| 56 | 1 | foreach ($this->packageAssociated as $object) { |
|
| 57 | $packageAssociated = $document->createElement('PackageAssociated'); |
||
| 58 | $packageAssociated->appendChild($document->createElement('PackageNumber', $object->PackageNumber)); |
||
| 59 | $packageAssociated->appendChild($document->createElement('ProductAmount', $object->ProductAmount)); |
||
| 60 | $node->appendChild($packageAssociated); |
||
| 61 | 1 | } |
|
| 62 | |||
| 63 | 1 | return $node; |
|
| 64 | } |
||
| 65 | } |
||
| 66 |