Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1432449
ParamInfo.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ParamInfo.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Wikimedia\Parsoid\NodeData
;
use
Wikimedia\JsonCodec\JsonCodecable
;
use
Wikimedia\JsonCodec\JsonCodecableTrait
;
use
Wikimedia\Parsoid\Tokens\KVSourceRange
;
class
ParamInfo
implements
JsonCodecable
{
use
JsonCodecableTrait
;
/**
* The parameter key
*/
public
string
$k
;
/**
* The key source wikitext, if different from $k
*/
public
?
string
$keyWt
=
null
;
/**
* The parameter value source wikitext
*/
public
?
string
$valueWt
=
null
;
public
?
KVSourceRange
$srcOffsets
=
null
;
public
bool
$named
=
false
;
/**
* @var string[]|null
*/
public
?
array
$spc
=
null
;
public
?
string
$html
=
null
;
public
function
__construct
(
string
$key
,
?
KVSourceRange
$srcOffsets
=
null
)
{
$this
->
k
=
$key
;
$this
->
srcOffsets
=
$srcOffsets
;
}
/**
* Create an object from unserialized data-parsoid.pi
* @param array $data
* @return self
*/
public
static
function
newFromJsonArray
(
array
$data
):
ParamInfo
{
$info
=
new
self
(
$data
[
'k'
]
??
''
);
$info
->
named
=
$data
[
'named'
]
??
false
;
$info
->
spc
=
$data
[
'spc'
]
??
null
;
return
$info
;
}
/**
* Serialize for data-parsoid.pi. The rest of the data is temporary, it is
* not needed across requests.
*
* @return array
*/
public
function
toJsonArray
():
array
{
$ret
=
[
'k'
=>
$this
->
k
];
if
(
$this
->
named
)
{
$ret
[
'named'
]
=
true
;
}
if
(
$this
->
spc
)
{
$ret
[
'spc'
]
=
$this
->
spc
;
}
return
$ret
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 16, 21:46 (1 d, 3 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f2/64/ad20316c0248b832c319e9901ace
Default Alt Text
ParamInfo.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment