Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5976493
TestUtils.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
683 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
(
fn
(
$groupRefs
)
=>
array_map
(
[
self
::
class
,
'refFromArray'
],
$groupRefs
),
$refs
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 19:10 (1 d, 23 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d5/c2/9e42790ac449ec8a56c3aade667f
Default Alt Text
TestUtils.php (683 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment