Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4046557
TestUtils.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
690 B
Referenced Files
None
Subscribers
None
TestUtils.php
View Options
<?php
namespace
Cite\Tests
;
use
Cite\ReferenceStackItem
;
/**
* @license GPL-2.0-or-later
*/
class
TestUtils
{
/**
* Factory to create internal ref data structures from array fixtures.
*/
public
static
function
refFromArray
(
?
array
$val
):
?
ReferenceStackItem
{
if
(
$val
===
null
)
{
return
null
;
}
$ref
=
new
ReferenceStackItem
();
foreach
(
$val
as
$k
=>
$v
)
{
$ref
->{
$k
}
=
$v
;
}
return
$ref
;
}
/**
* @return array<string,array<string|int,?ReferenceStackItem>>
*/
public
static
function
refGroupsFromArray
(
array
$refs
)
{
return
array_map
(
static
fn
(
$groupRefs
)
=>
array_map
(
[
self
::
class
,
'refFromArray'
],
$groupRefs
),
$refs
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Aug 15 2026, 11:12 (13 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
95/74/e09af10e459a9943a15cfd000c7c
Default Alt Text
TestUtils.php (690 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment