From 1fa6061c1524457c0547deb7012c3dad1251bf1f Mon Sep 17 00:00:00 2001 From: Steve Nebes Date: Thu, 28 Feb 2019 13:49:30 -0600 Subject: [PATCH] fixes --- src/NodeVisitor/TagNodeVisitor.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/NodeVisitor/TagNodeVisitor.php b/src/NodeVisitor/TagNodeVisitor.php index dae942c..740aebc 100644 --- a/src/NodeVisitor/TagNodeVisitor.php +++ b/src/NodeVisitor/TagNodeVisitor.php @@ -71,13 +71,24 @@ public function supports(\DOMNode $domNode, Cursor $cursor): bool return $this->getDomNodeName() === $domNode->nodeName; } + /** + * @param \DOMNode $domNode + * @param Cursor $cursor + * @return TagNodeInterface + */ + public function createNode(\DOMNode $domNode, Cursor $cursor): TagNodeInterface + { + return new TagNode($cursor->node, $this->qName); + } + /** * @param \DOMNode $domNode * @param Cursor $cursor */ public function enterNode(\DOMNode $domNode, Cursor $cursor) { - $node = new TagNode($cursor->node, $this->qName); + + $node = $this->createNode($domNode, $cursor); $this->setAttributes($domNode, $node); $cursor->node->addChild($node);