Skip to content

Commit

Permalink
Merge pull request #4 from snebes/fixes
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
snebes authored Feb 28, 2019
2 parents 10b5ebd + 1fa6061 commit bfa3ed8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/NodeVisitor/TagNodeVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bfa3ed8

Please sign in to comment.