Page MenuHomeWickedGov Phorge

StaticGadgetRepo.php
No OneTemporary

Size
538 B
Referenced Files
None
Subscribers
None

StaticGadgetRepo.php

<?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

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)

Event Timeline