Skip to content
This repository was archived by the owner on Oct 12, 2024. It is now read-only.

Commit 37abd55

Browse files
authored
Update Element.php
1 parent 794af71 commit 37abd55

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/Element.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,15 @@ class Element extends \DOMElement implements XPathAware
3030
public function appendTextNode($name, $value)
3131
{
3232
$el = new self($name);
33-
$el->appendChild(
33+
$element = $this->appendChild($el);
34+
assert($element instanceof Element);
35+
36+
$element->appendChild(
3437
$this->owner()->createTextNode($value)
3538
);
3639

37-
$element = $this->appendChild($el);
38-
assert($element instanceof Element);
40+
41+
3942

4043
return $element;
4144
}

0 commit comments

Comments
 (0)