diff --git a/src/XmlTv.php b/src/XmlTv.php index fdf13ca..4232b77 100644 --- a/src/XmlTv.php +++ b/src/XmlTv.php @@ -70,9 +70,7 @@ private static function buildDocument(DOMNode $domNode, XmlElement $xmlElement): self::buildDocument($node, $child); } } else { - if (!is_null($xmlElement->getValue())) { - $node->textContent = $xmlElement->getValue(); - } + $node->textContent = $xmlElement->getValue() ?? ''; } } @@ -111,6 +109,6 @@ private static function isEmptyElement(XmlElement $xmlElement): bool empty($xmlElement->getValue()) && !$xmlElement->hasChildren() && !$xmlElement->hasAttributes() && - !in_array($xmlElement->getName(), self::EMPTY_ELEMENTS); + !in_array($xmlElement->getName(), self::EMPTY_ELEMENTS, $strict = true); } }