Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6039645
ParsoidValidator.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
ParsoidValidator.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
Cite\Parsoid
;
use
Wikimedia\Parsoid\NodeData\DataMwError
;
/**
* @license GPL-2.0-or-later
*/
class
ParsoidValidator
{
public
function
validateDir
(
string
$refDir
,
RefGroupItem
$ref
):
?
DataMwError
{
if
(
$ref
->
dir
!==
''
&&
$ref
->
dir
!==
$refDir
)
{
return
new
DataMwError
(
'cite_error_ref_conflicting_dir'
,
[
$ref
->
name
]
);
}
return
null
;
}
public
function
validateName
(
string
$name
,
?
RefGroup
$refGroup
,
ReferencesData
$referencesData
):
?
DataMwError
{
if
(
!
$refGroup
->
lookupRefByName
(
$name
)
&&
$referencesData
->
inReferenceList
()
)
{
return
new
DataMwError
(
'cite_error_references_missing_key'
,
[
$name
]
);
}
return
null
;
}
public
function
validateFollow
(
string
$followName
,
?
RefGroup
$refGroup
):
?
DataMwError
{
if
(
!
$refGroup
->
lookupRefByName
(
$followName
)
)
{
// FIXME: This key isn't exactly appropriate since this
// is more general than just being in a <references>
// section and it's the $followName we care about, but the
// extension to the legacy parser doesn't have an
// equivalent key and just outputs something wacky.
return
new
DataMwError
(
'cite_error_references_missing_key'
,
[
$followName
]
);
}
return
null
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 20:17 (6 w, 9 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
62/17/b59bba6a4e06d1bd9d615037a78f
Default Alt Text
ParsoidValidator.php (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment