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

Commit b1fe6fc

Browse files
authored
Update Element.php
1 parent 774e6ce commit b1fe6fc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/Element.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,19 @@
2020
class Element extends \DOMElement implements XPathAware
2121
{
2222
/**
23-
* Create and append a text-node with the given value.
23+
* Create and append a text-node with the given name and given value.
2424
*
25+
* @param string $name
2526
* @param string $value
2627
*
2728
* @return Element
2829
*/
29-
public function appendTextNode($value)
30-
{
31-
$element = $this->appendChild($this->owner()->createTextNode($value));
30+
public function appendTextNode($name, $value)
31+
{
32+
$el = new self($name)
33+
$el->appendChild($this->owner()->createTextNode($value));
34+
35+
$element = $this->appendChild($el);
3236
assert($element instanceof Element);
3337

3438
return $element;

0 commit comments

Comments
 (0)