Parsoid
A bidirectional parser between wikitext and HTML5
Wikimedia\Parsoid\Tokens\KVSourceRange Class Reference

Represents a source offset range for a key-value pair. More...

+ Inheritance diagram for Wikimedia\Parsoid\Tokens\KVSourceRange:
+ Collaboration diagram for Wikimedia\Parsoid\Tokens\KVSourceRange:

Public Member Functions

 __construct (int $keyStart, int $keyEnd, int $valueStart, int $valueEnd)
 Create a new key-value source offset range. More...
 
 offset (int $amount)
 Return a new key-value source offset range shifted by $amount. More...
 
 jsonSerialize ()
 

Static Public Member Functions

static fromArray (array $so)
 Create a new key-value source offset range from an array of integers (such as created during JSON serialization). More...
 

Public Attributes

 $key
 
 $value
 

Detailed Description

Represents a source offset range for a key-value pair.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Parsoid\Tokens\KVSourceRange::__construct ( int  $keyStart,
int  $keyEnd,
int  $valueStart,
int  $valueEnd 
)

Create a new key-value source offset range.

Parameters
int$keyStartThe start index of the key (unicode code points, inclusive)
int$keyEndThe end index of the key (unicode code points, exclusive)
int$valueStartThe start index of the value (unicode code points, inclusive)
int$valueEndThe end index of the value (unicode code points, exclusive)

Member Function Documentation

◆ fromArray()

static Wikimedia\Parsoid\Tokens\KVSourceRange::fromArray ( array  $so)
static

Create a new key-value source offset range from an array of integers (such as created during JSON serialization).

Parameters
int[]$so
Returns
KVSourceRange

◆ offset()

Wikimedia\Parsoid\Tokens\KVSourceRange::offset ( int  $amount)

Return a new key-value source offset range shifted by $amount.

Parameters
int$amountThe amount to shift by
Returns
KVSourceRange

The documentation for this class was generated from the following file: