diff --git a/src/DOMImproved.php b/src/DOMImproved.php index 1be2639..8b74df2 100755 --- a/src/DOMImproved.php +++ b/src/DOMImproved.php @@ -283,14 +283,17 @@ public function addArrayChild(?DOMElement &$parent, $arr) /** * Adicona um atributo a uma tag - * @param DOMElement $node + * @param \DOMElement $node * @param string $name - * @param string $value + * @param string|null $value * @return void * @throws \DOMException */ - public function addAttribute(DOMElement &$node, string $name, string $value) + public function addAttribute(\DOMElement &$node, string $name, string $value = null) { + if (is_null($value)) { + return; + } $att = $this->createAttribute($name); $att->value = $value; $node->appendChild($att);