Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7482256
StaticGadgetRepo.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
538 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
{
/**
* @param Gadget[] $gadgets
*/
public
function
__construct
(
private
readonly
array
$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
Mon, Nov 23, 13:05 (5 d, 16 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
37/1e/5033f14f7674c9052193ef2454f3
Default Alt Text
StaticGadgetRepo.php (538 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment