| 1 |
<?php |
| 2 |
|
| 3 |
declare( strict_types = 1 ); |
| 4 |
|
| 5 |
namespace Wikimedia\Parsoid\Wt2Html\TT; |
| 6 |
|
| 7 |
class 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 |
} |