Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
75.00% covered (warning)
75.00%
3 / 4
CRAP
97.10% covered (success)
97.10%
67 / 69
AfterHead
0.00% covered (danger)
0.00%
0 / 1
75.00% covered (warning)
75.00%
3 / 4
23
97.10% covered (success)
97.10%
67 / 69
 characters
100.00% covered (success)
100.00%
1 / 1
3
100.00% covered (success)
100.00%
14 / 14
 startTag
100.00% covered (success)
100.00%
1 / 1
14
100.00% covered (success)
100.00%
35 / 35
 endTag
0.00% covered (danger)
0.00%
0 / 1
5.05
87.50% covered (warning)
87.50%
14 / 16
 endDocument
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
4 / 4
<?php
namespace RemexHtml\TreeBuilder;
use RemexHtml\Tokenizer\Attributes;
use RemexHtml\Tokenizer\PlainAttributes;
/**
 * The "after head" insertion mode
 */
class AfterHead extends InsertionMode {
    public function characters( $text, $start, $length, $sourceStart, $sourceLength ) {
        $builder = $this->builder;
        $dispatcher = $this->dispatcher;
        // 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 ) {
            $builder->insertCharacters( $text, $start, $length,
                $sourceStart, $sourceLength );
        }
        // Switch mode on non-whitespace
        list( $start, $length, $sourceStart, $sourceLength ) = $part2;
        if ( $length ) {