Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| DTState | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | declare( strict_types = 1 ); |
| 3 | |
| 4 | namespace Wikimedia\Parsoid\Utils; |
| 5 | |
| 6 | use stdClass; |
| 7 | use Wikimedia\Parsoid\Config\Env; |
| 8 | use Wikimedia\Parsoid\Wt2Html\PegTokenizer; |
| 9 | |
| 10 | /** |
| 11 | * State carried while DOM Traversing. |
| 12 | * |
| 13 | * FIXME: As it stands, DTState cannot be constructed outside of Parsoid. |
| 14 | * However, extensions and core code might benefit from a non-Parsoid-specific |
| 15 | * state object that DOMTraverser users outside of Parsoid could use. |
| 16 | */ |
| 17 | class DTState { |
| 18 | public Env $env; |
| 19 | public array $options; |
| 20 | public bool $atTopLevel; |
| 21 | public ?stdClass $tplInfo = null; |
| 22 | public array $abouts = []; |
| 23 | public array $seenIds = []; |
| 24 | public ?PegTokenizer $tokenizer = null; // Needed by TableFixups handlers |
| 25 | |
| 26 | public function __construct( Env $env, array $options = [], bool $atTopLevel = false ) { |
| 27 | $this->env = $env; |
| 28 | $this->options = $options; |
| 29 | $this->atTopLevel = $atTopLevel; |
| 30 | } |
| 31 | } |