Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
13 / 13
CRAP
100.00% covered (success)
100.00%
32 / 32
DOMSerializer
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
13 / 13
14
100.00% covered (success)
100.00%
32 / 32
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 getResult
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
5 / 5
 startDocument
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 endDocument
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 characters
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 insertElement
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 endTag
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 doctype
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 comment
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 error
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 mergeAttributes
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 removeNode
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 reparentChildren
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
<?php
namespace RemexHtml\DOM;
use RemexHtml\Serializer\AbstractSerializer;
use RemexHtml\Tokenizer\Attributes;
use RemexHtml\TreeBuilder\Element;
/**
 * This class providers a Serializer-like interface to DOMBuilder, allowing
 * DOMBuilder and direct serialization to be used interchangeably.
 *
 * HtmlFormatter::formatDOMNode() can be used directly if this interface is
 * not required.
 */
class DOMSerializer implements AbstractSerializer {
    private $formatter;
    private $builder;
    /**
     * @param DOMBuilder $builder
     * @param DOMFormatter $formatter This may be, for example, an HtmlFormatter object
     */
    public function __construct( DOMBuilder $builder, DOMFormatter $formatter ) {
        $this->builder = $builder;
        $this->formatter = $formatter;