Skip to content

Commit

Permalink
Avoid broken XML-output when no prefix is set
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Sep 6, 2024
1 parent c76769a commit 04e6c6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ public function toXML(DOMElement $parent): DOMElement
{
$parent->setAttributeNS(
$this->getNamespaceURI(),
$this->getNamespacePrefix() . ':' . $this->getAttrName(),
($this->getNamespacePrefix() !== null)
? ($this->getNamespacePrefix() . ':' . $this->getAttrName())
: $this->getAttrName(),

Check failure on line 113 in src/Attribute.php

View workflow job for this annotation

GitHub Actions / Quality control

Else branch is unreachable because ternary operator condition is always true.
$this->getAttrValue(),
);

Expand Down

0 comments on commit 04e6c6d

Please sign in to comment.