| Conditions | 4 |
| Paths | 2 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 16 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | 135 | public function dump(Template $template) |
|
| 17 | { |
||
| 18 | 135 | $metadata = $template->getMetadata(); |
|
| 19 | 135 | $dom = $template->getDocument(); |
|
| 20 | 135 | $dom->preserveWhiteSpace = true; |
|
| 21 | 135 | $dom->formatOutput = false; |
|
| 22 | |||
| 23 | 135 | if ($metadata['xmldeclaration']) { |
|
| 24 | 1 | $xml = $dom->saveXML(); |
|
| 25 | 1 | } else { |
|
| 26 | 134 | $xml = ''; |
|
| 27 | 134 | foreach ($dom->childNodes as $node) { |
|
| 28 | 133 | $xml .= $dom->saveXML($node, LIBXML_NOEMPTYTAG); |
|
| 29 | 133 | if ($node instanceof \DOMDocumentType) { |
|
| 30 | 1 | $xml .= PHP_EOL; |
|
| 31 | 1 | } |
|
| 32 | 134 | } |
|
| 33 | } |
||
| 34 | |||
| 35 | 135 | return $this->replaceShortTags($xml); |
|
| 36 | } |
||
| 37 | |||
| 65 |