for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* (c) Steve Nebes <[email protected]>.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace SN\HtmlSanitizer\NodeVisitor;
use DOMNode;
use SN\HtmlSanitizer\Model\Cursor;
class RemoveNodeVisitor extends TagNodeVisitor
{
* @param DOMNode $domNode
* @param Cursor $cursor
public function enterNode(DOMNode $domNode, Cursor $cursor)
while ($domNode->hasChildNodes()) {
$domNode->removeChild($domNode->childNodes[0]);
}
public function leaveNode(DOMNode $domNode, Cursor $cursor)