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