* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace HtmlSanitizer\Extension\Extra\NodeVisitor; use HtmlSanitizer\Model\Cursor; use HtmlSanitizer\Extension\Extra\Node\HrNode; use HtmlSanitizer\Node\NodeInterface; use HtmlSanitizer\Visitor\AbstractNodeVisitor; use HtmlSanitizer\Visitor\IsChildlessTagVisitorTrait; use HtmlSanitizer\Visitor\NamedNodeVisitorInterface; /** * @author Titouan Galopin * * @final */ class HrNodeVisitor extends AbstractNodeVisitor implements NamedNodeVisitorInterface { use IsChildlessTagVisitorTrait; protected function getDomNodeName(): string { return 'hr'; } protected function createNode(\DOMNode $domNode, Cursor $cursor): NodeInterface { return new HrNode($cursor->node); } }