Skip to content

Commit

Permalink
Fix issues found by Psalm and Phan
Browse files Browse the repository at this point in the history
  • Loading branch information
jaylinski committed May 22, 2021
1 parent 4584d26 commit 8ce7e4d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/XmlTv.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() ?? '';
}
}

Expand Down Expand Up @@ -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);
}
}

0 comments on commit 8ce7e4d

Please sign in to comment.