Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
70.00% covered (warning)
70.00%
7 / 10
CRAP
86.75% covered (warning)
86.75%
72 / 83
TestFormatter
0.00% covered (danger)
0.00%
0 / 1
70.00% covered (warning)
70.00%
7 / 10
43.72
86.75% covered (warning)
86.75%
72 / 83
 startDocument
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 doctype
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
5 / 5
 characters
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 formatCharacters
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 element
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 formatElement
0.00% covered (danger)
0.00%
0 / 1
13.06
93.10% covered (success)
93.10%
27 / 29
 comment
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 formatComment
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 formatDOMNode
0.00% covered (danger)
0.00%
0 / 1
11.48
84.21% covered (warning)
84.21%
16 / 19
 formatDOMElement
0.00% covered (danger)
0.00%
0 / 1
7.99
72.73% covered (warning)
72.73%
16 / 22
<?php
namespace RemexHtml\Serializer;
use RemexHtml\DOM\DOMFormatter;
use RemexHtml\DOM\DOMUtils;
use RemexHtml\HTMLData;
use RemexHtml\Tokenizer\Attribute;
/**
 * A Formatter which is used to format documents in (almost) the way they
 * appear in the html5lib tests. A little bit of post-processing is required
 * in the PHPUnit tests.
 */
class TestFormatter implements Formatter, DOMFormatter {
    private static $attrNamespaces = [
        HTMLData::NS_XML => 'xml',
        HTMLData::NS_XLINK => 'xlink',
        HTMLData::NS_XMLNS => 'xmlns',
    ];
    public function startDocument( $fragmentNamespace, $fragmentName ) {
        return '';
    }
    public function doctype( $name, $public, $system ) {
        $ret = "<!DOCTYPE $name";
        if ( $public !== '' || $system !== '' ) {