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
96.83% covered (success)
96.83%
61 / 63
InTemplate
0.00% covered (danger)
0.00%
0 / 1
75.00% covered (warning)
75.00%
3 / 4
25
96.83% covered (success)
96.83%
61 / 63
 characters
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 startTag
100.00% covered (success)
100.00%
1 / 1
20
100.00% covered (success)
100.00%
39 / 39
 endTag
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
8 / 8
 endDocument
0.00% covered (danger)
0.00%
0 / 1
2.01
84.62% covered (warning)
84.62%
11 / 13
<?php
namespace RemexHtml\TreeBuilder;
use RemexHtml\Tokenizer\Attributes;
/**
 * The "in template" insertion mode
 */
class InTemplate extends InsertionMode {
    public function characters( $text, $start, $length, $sourceStart, $sourceLength ) {
        $this->dispatcher->inBody->characters(
            $text, $start, $length, $sourceStart, $sourceLength );
    }
    public function startTag( $name, Attributes $attrs, $selfClose, $sourceStart, $sourceLength ) {
        $dispatcher = $this->dispatcher;
        switch ( $name ) {
        case 'base':
        case 'basefont':
        case 'bgsound':
        case 'link':
        case 'meta':
        case 'noframes':
        case 'script':
        case 'style':
        case 'template':
        case 'title':
            $dispatcher->inHead->startTag(
                $name, $attrs, $selfClose, $sourceStart, $sourceLength );
            return;
        case 'caption':
        case 'colgroup':
        case 'tbody':
        case 'tfoot':
        case 'thead':
            $mode = Dispatcher::IN_TABLE;
            break;
        case 'col':
            $mode = Dispatcher::IN_COLUMN_GROUP;
            break;
        case 'tr':
            $mode = Dispatcher::IN_TABLE_BODY;
            break;
        case 'td':
        case 'th':
            $mode = Dispatcher::IN_ROW;
            break;
        default:
            $mode = Dispatcher::IN_BODY;
            break;
        }