Represents a Key-value pair.
More...
|
| | __construct ( $k, $v, ?KVSourceRange $srcOffsets=null, ?string $ksrc=null, ?string $vsrc=null) |
| |
|
| __clone () |
| |
| | 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 () |
| |
|
| toJsonArray () |
| |
|
| static | lookupKV (?array $kvs, string $key) |
| | BUG: When there are multiple matching attributes, Sanitizer lets the last one win whereas this method is letting the first one win.
|
| |
| static | lookup (?array $kvs, string $key) |
| | Lookup a string key (first occurrence) in a KV array and return the value of the KV object.
|
| |
|
static | newFromJsonArray (array $json) |
| |
|
static | jsonClassHintFor (string $keyName) |
| |
|
|
| $k |
| |
|
| $v |
| |
|
KVSourceRange | $srcOffsets |
| | Wikitext source offsets.
|
| |
|
string | $ksrc |
| | Wikitext source.
|
| |
|
string | $vsrc |
| | Wikitext source.
|
| |
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|array<Token|string>|null
◆ lookupKV()
| static Wikimedia\Parsoid\Tokens\KV::lookupKV |
( |
?array | $kvs, |
|
|
string | $key ) |
|
static |
BUG: When there are multiple matching attributes, Sanitizer lets the last one win whereas this method is letting the first one win.
This can introduce subtle bugs!
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: