Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 12
CRAP
0.00% covered (danger)
0.00%
0 / 20
DestructTracer
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 12
156
0.00% covered (danger)
0.00%
0 / 19
 __construct
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
 startDocument
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 endDocument
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 characters
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 3
 insertElement
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 4
 endTag
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 doctype
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 comment
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 error
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 mergeAttributes
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 removeNode
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 reparentChildren
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 2
<?php
namespace Wikimedia\RemexHtml\TreeBuilder;
use Wikimedia\RemexHtml\Tokenizer\Attributes;
/**
 * A debugging helper which calls a callback function with a descriptive message
 * each time an Element node is destroyed.
 */
class DestructTracer implements TreeHandler {
    private $callback;
    public function __construct( $callback ) {
        $this->callback = $callback;
    }
    public function startDocument( $fragmentNamespace, $fragmentName ) {
    }
    public function endDocument( $pos ) {
    }
    public function characters( $preposition, $ref, $text, $start, $length,
        $sourceStart, $sourceLength
    ) {
    }
    public function insertElement( $preposition, $ref, Element $element, $void,
        $sourceStart, $sourceLength
    ) {
        $element->userData = new DestructTracerNode( $this->callback, $element->getDebugTag() );
    }
    public function endTag( Element $element, $sourceStart, $sourceLength ) {
    }
    public function doctype( $name, $public, $system, $quirks, $sourceStart, $sourceLength ) {
    }
    public function comment( $preposition, $ref, $text, $sourceStart, $sourceLength ) {
    }
    public function error( $text, $pos ) {
    }
    public function mergeAttributes( Element $element, Attributes $attrs, $sourceStart ) {
    }
    public function removeNode( Element $element, $sourceStart ) {
    }
    public function reparentChildren( Element $element, Element $newParent, $sourceStart ) {
        $newParent->userData = new DestructTracerNode( $this->callback, $newParent->getDebugTag() );
    }
}
// Retain the old namespace for backwards compatibility.
class_alias( DestructTracer::class, 'RemexHtml\TreeBuilder\DestructTracer' );