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