Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6046234
StaticGadgetRepo.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
565 B
Referenced Files
None
Subscribers
None
StaticGadgetRepo.php
View Options
<?php
namespace
MediaWiki\Extension\Gadgets
;
use
InvalidArgumentException
;
/**
* @internal For use in tests.
*/
class
StaticGadgetRepo
extends
GadgetRepo
{
/**
* @var Gadget[]
*/
private
array
$gadgets
;
public
function
__construct
(
array
$gadgets
)
{
$this
->
gadgets
=
$gadgets
;
}
public
function
getGadgetIds
():
array
{
return
array_keys
(
$this
->
gadgets
);
}
public
function
getGadget
(
string
$id
):
Gadget
{
if
(
!
array_key_exists
(
$id
,
$this
->
gadgets
)
)
{
throw
new
InvalidArgumentException
();
}
return
$this
->
gadgets
[
$id
];
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Oct 4 2026, 21:53 (5 w, 5 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
24/df/351146c766e3930408179bed5aa9
Default Alt Text
StaticGadgetRepo.php (565 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment