Skip to content

Commit 86ee6fe

Browse files
committed
actually fixing the thing.
1 parent c63d792 commit 86ee6fe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

template/types/class_xhtml.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,15 @@ public function setNode(null|string|\DOMNode $node): self
127127
*/
128128
public function xmlSerialize(\DOMElement $element = null, null|int|<?php echo PHPFHIR_INTERFACE_XML_SERIALIZALE_CONFIG ?> $config = null): \DOMElement
129129
{
130+
if (is_int($config)) {
131+
$libxmlOpts = $config;
132+
$config = null;
133+
} else {
134+
$libxmlOpts = $config?->getLibxmlOpts() ?? <?php echo PHPFHIR_INTERFACE_XML_SERIALIZALE_CONFIG; ?>::DEFAULT_LIBXML_OPTS;
135+
}
130136
if (null === $element) {
131137
$dom = new \DOMDocument();
132-
$dom->loadXML($this->_getFHIRXMLElementDefinition('<?php echo $xmlName; ?>'), $config?->getLibxmlOpts() ?? 0);
138+
$dom->loadXML($this->_getFHIRXMLElementDefinition('<?php echo $xmlName; ?>'), $libxmlOpts);
133139
$element = $dom->documentElement;
134140
}
135141
$node = $this->getNode();

0 commit comments

Comments
 (0)