*/ class OATHAuthServices { /** @var MediaWikiServices */ private MediaWikiServices $services; /** * @param MediaWikiServices $services */ public function __construct( MediaWikiServices $services ) { $this->services = $services; } /** * @param MediaWikiServices|null $services * @return OATHAuthServices */ public static function getInstance( MediaWikiServices $services = null ): OATHAuthServices { return new self( $services ?? MediaWikiServices::getInstance(), ); } /** * @return OATHAuthDatabase */ public function getDatabase(): OATHAuthDatabase { return $this->services->getService( 'OATHAuthDatabase' ); } /** * @return OATHAuthModuleRegistry */ public function getModuleRegistry(): OATHAuthModuleRegistry { return $this->services->getService( 'OATHAuthModuleRegistry' ); } }