| 1 |
<?php |
| 2 |
declare( strict_types = 1 ); |
| 3 |
|
| 4 |
namespace Wikimedia\Parsoid\Html2Wt\ConstrainedText; |
| 5 |
|
| 6 |
class State { |
| 7 |
/** @var string */ |
| 8 |
public $leftContext; |
| 9 |
/** @var string */ |
| 10 |
public $rightContext; |
| 11 |
/** @var ConstrainedText[] */ |
| 12 |
public $line; |
| 13 |
/** @var int */ |
| 14 |
public $pos; |
| 15 |
|
| 16 |
/** |
| 17 |
* @param ConstrainedText[] $line |
| 18 |
*/ |
| 19 |
public function __construct( array $line ) { |
| 20 |
$this->leftContext = ''; |
| 21 |
$this->rightContext = implode( '', array_map( static function ( $ct ) { |
| 22 |
return $ct->text; |
| 23 |
}, $line ) ); |
| 24 |
$this->line = $line; |
| 25 |
$this->pos = 0; |
| 26 |
} |
| 27 |
} |