Represents a Key-value pair.
More...
|
| __construct ( $k, $v, ?KVSourceRange $srcOffsets=null, ?string $ksrc=null, ?string $vsrc=null) |
|
| keyOffset () |
| Return the key portion of the KV's source offsets, or else null if no source offsets are known.
|
|
| valueOffset () |
| Return the value portion of the KV's source offsets, or else null if no source offsets are known.
|
|
| jsonSerialize () |
|
|
static | lookupKV (?array $kvs, string $key) |
| Lookup a string key in a KV array and return the first matching KV object.
|
|
static | lookup (?array $kvs, string $key) |
| Lookup a string key (first occurrence) in a KV array and return the value of the KV object.
|
|
|
| $k |
|
| $v |
|
| $srcOffsets |
|
| $ksrc |
|
| $vsrc |
|
Represents a Key-value pair.
◆ __construct()
Wikimedia\Parsoid\Tokens\KV::__construct |
( |
| $k, |
|
|
| $v, |
|
|
?KVSourceRange | $srcOffsets = null, |
|
|
?string | $ksrc = null, |
|
|
?string | $vsrc = null ) |
- Parameters
-
| string|Token|array<Token|string> | $k Commonly a string, but where the key might be templated, this can be an array of tokens even. |
| string|Token|array<Token|string>|KV[] | $v The value: string, token, of an array of tokens |
?KVSourceRange | $srcOffsets | wikitext source offsets |
?string | $ksrc | |
?string | $vsrc | |
◆ keyOffset()
Wikimedia\Parsoid\Tokens\KV::keyOffset |
( |
| ) |
|
Return the key portion of the KV's source offsets, or else null if no source offsets are known.
- Returns
- SourceRange|null
◆ lookup()
static Wikimedia\Parsoid\Tokens\KV::lookup |
( |
?array | $kvs, |
|
|
string | $key ) |
|
static |
Lookup a string key (first occurrence) in a KV array and return the value of the KV object.
- Parameters
-
KV[] | null | $kvs | |
string | $key | |
- Returns
- string|Token|Token[]|null
◆ lookupKV()
static Wikimedia\Parsoid\Tokens\KV::lookupKV |
( |
?array | $kvs, |
|
|
string | $key ) |
|
static |
Lookup a string key in a KV array and return the first matching KV object.
- Parameters
-
KV[] | null | $kvs | |
string | $key | |
- Returns
- ?KV
◆ valueOffset()
Wikimedia\Parsoid\Tokens\KV::valueOffset |
( |
| ) |
|
Return the value portion of the KV's source offsets, or else null if no source offsets are known.
- Returns
- SourceRange|null
The documentation for this class was generated from the following file: