Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
2 / 4
CRAP
98.20% covered (success)
98.20%
109 / 111
InHead
0.00% covered (danger)
0.00%
0 / 1
50.00% covered (danger)
50.00%
2 / 4
32
98.18% covered (success)
98.18%
108 / 110
 characters
0.00% covered (danger)
0.00%
0 / 1
4.00
93.33% covered (success)
93.33%
14 / 15
 startTag
0.00% covered (danger)
0.00%
0 / 1
19
98.39% covered (success)
98.39%
61 / 62
 endTag
100.00% covered (success)
100.00%
1 / 1
8
100.00% covered (success)
100.00%
29 / 29
 endDocument
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
4 / 4
<?php
namespace Wikimedia\RemexHtml\TreeBuilder;
use Wikimedia\RemexHtml\Tokenizer\Attributes;
use Wikimedia\RemexHtml\Tokenizer\Tokenizer;
/**
 * The "in head" insertion mode
 */
class InHead extends InsertionMode {
    public function characters( $text, $start, $length, $sourceStart, $sourceLength ) {
        // Split and insert whitespace
        list( $part1, $part2 ) = $this->splitInitialMatch(
            true, "\t\n\f\r ", $text, $start, $length, $sourceStart, $sourceLength );
        list( $start, $length, $sourceStart, $sourceLength ) = $part1;
        if ( $length ) {
            $this->builder->insertCharacters( $text, $start, $length, $sourceStart,
                $sourceLength );
        }
        // Handle non-whitespace specially
        list( $start, $length, $sourceStart, $sourceLength ) = $part2;
        if ( !$length ) {
            return;
        }
        $elt = $this->builder->pop( $sourceStart, 0 );