diff --git "a/include/class-web\\MediaWikis.php" "b/include/class-web\\MediaWikis.php" index 970e8a5..b4f7485 100644 --- "a/include/class-web\\MediaWikis.php" +++ "b/include/class-web\\MediaWikis.php" @@ -1,68 +1,67 @@ . # websites in the Internet namespace web; /** * All the MediaWiki instances in the Internet :^) */ abstract class MediaWikis { /** * Get all the registered MediaWiki classes * * @return array */ protected static function allClasses() { return [ \wm\WikipediaIt ::class, \wm\Wikidata ::class, \wm\Commons ::class, \wm\MetaWiki ::class, \web\LandscapeforWiki::class, ]; } /** * Get all the registered MediaWiki instances * * @generator */ public static function all() { foreach( self::allClasses() as $classname ) { yield $classname::getInstance(); } } /** * Get a specific MediaWiki instance from its UID * - * * @param $uid string * @return mw\StaticSite|false */ public static function findFromUID( $uid ) { foreach( self::all() as $one ) { if( $one::UID === $uid ) { return $one; } } - throw new \InvalidArgumentException( "unregistered wiki $uid" ); + return false; } }