Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
TokenHandlerResult
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
20
1<?php
2
3declare( strict_types = 1 );
4
5namespace Wikimedia\Parsoid\Wt2Html\TT;
6
7class TokenHandlerResult {
8    /** @var array|null */
9    public $tokens;
10    /** @var bool */
11    public $skipOnAny;
12
13    /**
14     * @param array|null $tokens The new array of tokens, or null to retain the
15     *   current token
16     * @param bool $skipOnAny Don't call this handler's onAny() method for this token
17     */
18    public function __construct( array $tokens = null, $skipOnAny = false ) {
19        if ( $tokens ) {
20            foreach ( $tokens as $token ) {
21                if ( $token === null ) {
22                    throw new \InvalidArgumentException( "Invalid token" );
23                }
24            }
25        }
26        $this->tokens = $tokens;
27        $this->skipOnAny = $skipOnAny;
28    }
29}