Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
9 | public function __construct(string $fileName, \DOMElement $domElement, bool $formatOutput = false) |
||
10 | { |
||
11 | $domDocument = new \DOMDocument(); |
||
12 | $domDocument->preserveWhiteSpace = false; |
||
13 | if ($formatOutput) { |
||
14 | $domDocument->formatOutput = true; |
||
15 | } |
||
16 | $element = $domDocument->importNode($domElement, true); |
||
17 | $domDocument->appendChild($element); |
||
18 | $fileData = (string) $domDocument->saveXML(); |
||
19 | |||
20 | // phpcs:ignore SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable |
||
21 | $domDocument = null; |
||
|
|||
22 | // phpcs:ignore SlevomatCodingStandard.Variables.UnusedVariable.UnusedVariable |
||
23 | $element = null; |
||
24 | |||
25 | parent::__construct($fileName, $fileData, XmlFile::CONTENT_TYPE); |
||
26 | } |
||
28 |