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
91.67% covered (success)
91.67%
11 / 12
Text
0.00% covered (danger)
0.00%
0 / 1
75.00% covered (warning)
75.00%
3 / 4
4.01
90.91% covered (success)
90.91%
10 / 11
 characters
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%
5 / 5
 startTag
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 endTag
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
<?php
namespace Wikimedia\RemexHtml\TreeBuilder;
use Wikimedia\RemexHtml\Tokenizer\Attributes;
/**
 * The "text" insertion mode
 */
class Text extends InsertionMode {
    public function characters( $text, $start, $length, $sourceStart, $sourceLength ) {
        $this->builder->insertCharacters( $text, $start, $length, $sourceStart, $sourceLength );
    }
    public function endDocument( $pos ) {
        $this->builder->error( 'unexpected end of input in text mode', $pos );
        $this->builder->pop( $pos, 0 );
        $this->dispatcher->restoreMode()
            ->endDocument( $pos );
    }
    public function startTag( $name, Attributes $attrs, $selfClose, $sourceStart, $sourceLength ) {
        // @phan-suppress-previous-line PhanPluginNeverReturnMethod
        throw new TreeBuilderError( 'unexpected token' );
    }
    public function endTag( $name, $sourceStart, $sourceLength ) {
        // I think this is complete if we have no support for executing scripts
        $this->builder->pop( $sourceStart, $sourceLength );
        $this->dispatcher->restoreMode();