@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | $xml = self::getXMLRoot(); |
| 44 | 44 | $xml->appendChild(self::convert($nodeName, $data)); |
| 45 | 45 | |
| 46 | - self::$xml = null;// clear the xml node in the class for 2nd time use. |
|
| 46 | + self::$xml = null; // clear the xml node in the class for 2nd time use. |
|
| 47 | 47 | |
| 48 | 48 | return $xml; |
| 49 | 49 | } |
@@ -80,13 +80,13 @@ discard block |
||
| 80 | 80 | // else check if its directly stored as string |
| 81 | 81 | if (array_key_exists(self::$prefixAttributes . 'value', $data)) { |
| 82 | 82 | $node->appendChild($xml->createTextNode(self::bool2str($data[self::$prefixAttributes . 'value']))); |
| 83 | - unset($data[self::$prefixAttributes . 'value']); //remove the key from the array once done. |
|
| 83 | + unset($data[self::$prefixAttributes . 'value']); //remove the key from the array once done. |
|
| 84 | 84 | //return from recursion, as a note with value cannot have child nodes. |
| 85 | 85 | return $node; |
| 86 | 86 | } else { |
| 87 | 87 | if (array_key_exists(self::$prefixAttributes . 'cdata', $data)) { |
| 88 | 88 | $node->appendChild($xml->createCDATASection(self::bool2str($data[self::$prefixAttributes . 'cdata']))); |
| 89 | - unset($data[self::$prefixAttributes . 'cdata']); //remove the key from the array once done. |
|
| 89 | + unset($data[self::$prefixAttributes . 'cdata']); //remove the key from the array once done. |
|
| 90 | 90 | //return from recursion, as a note with cdata cannot have child nodes. |
| 91 | 91 | return $node; |
| 92 | 92 | } |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | trait CommonsTrait |
| 13 | 13 | { |
| 14 | - private static ?\DOMDocument $xml = null; |
|
| 14 | + private static ? \DOMDocument $xml = null; |
|
| 15 | 15 | |
| 16 | 16 | private static string $encoding = 'UTF-8'; |
| 17 | 17 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @throws \InvalidArgumentException |
| 38 | 38 | */ |
| 39 | - public static function createArray(string|\DOMDocument $inputXml): array |
|
| 39 | + public static function createArray(string | \DOMDocument $inputXml): array |
|
| 40 | 40 | { |
| 41 | 41 | $xml = self::getXMLRoot(); |
| 42 | 42 | if (is_string($inputXml)) { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | $array = []; |
| 53 | 53 | $array[$xml->documentElement->tagName] = self::convert($xml->documentElement); |
| 54 | - self::$xml = null;// clear the xml node in the class for 2nd time use. |
|
| 54 | + self::$xml = null; // clear the xml node in the class for 2nd time use. |
|
| 55 | 55 | |
| 56 | 56 | return $array; |
| 57 | 57 | } |