array( 'name' => $gadget ) ) */ public function getStructuredList() { $list = array(); foreach ( $this->getGadgetIds() as $id ) { $gadget = $this->getGadget( $id ); $list[$gadget->getCategory()][$gadget->getName()] = $gadget; } return $list; } /** * Get the configured default GadgetRepo. Currently * this hardcodes MediaWikiGadgetsDefinitionRepo since * that is the only implementation * * @return GadgetRepo */ public static function singleton() { if ( self::$instance === null ) { self::$instance = new MediaWikiGadgetsDefinitionRepo(); } return self::$instance; } /** * Should only be used by unit tests * * @param GadgetRepo|null $repo */ public static function setSingleton( $repo = null ) { self::$instance = $repo; } }