*/ 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 OATHAuthModuleRegistry */ public function getModuleRegistry(): OATHAuthModuleRegistry { return $this->services->getService( 'OATHAuthModuleRegistry' ); } /** * @return OATHUserRepository */ public function getUserRepository(): OATHUserRepository { return $this->services->getService( 'OATHUserRepository' ); } }