diff options
author | Umherirrender <umherirrender_de.wp@web.de> | 2022-04-13 22:03:34 +0200 |
---|---|---|
committer | Umherirrender <umherirrender_de.wp@web.de> | 2022-04-13 20:34:10 +0000 |
commit | a7e8f87d9ffc310d10477f75f0fb430895d648f0 (patch) | |
tree | 513bd6e3b38fbc418cc64716128b2656204a98bf /includes/api/ApiQueryInfo.php | |
parent | e5077e20590f5ef74f373ccc32e5bd991c8fc42c (diff) | |
download | mediawikicore-a7e8f87d9ffc310d10477f75f0fb430895d648f0.tar.gz mediawikicore-a7e8f87d9ffc310d10477f75f0fb430895d648f0.zip |
Remove usages of deprecated Title::getRestrictionTypes
Bug: T306131
Change-Id: Id7b2849bb1c31dbd79acbeb607dfc4f7869e6142
Diffstat (limited to 'includes/api/ApiQueryInfo.php')
-rw-r--r-- | includes/api/ApiQueryInfo.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index d9aac4335ec1..ac6b9e74550c 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -26,6 +26,7 @@ use MediaWiki\MainConfigNames; use MediaWiki\MediaWikiServices; use MediaWiki\ParamValidator\TypeDef\TitleDef; use MediaWiki\Permissions\PermissionStatus; +use MediaWiki\Permissions\RestrictionStore; /** * A query module to show basic page information. @@ -46,6 +47,8 @@ class ApiQueryInfo extends ApiQueryBase { private $titleFormatter; /** @var WatchedItemStore */ private $watchedItemStore; + /** @var RestrictionStore */ + private $restrictionStore; private $fld_protection = false, $fld_talkid = false, $fld_subjectid = false, $fld_url = false, @@ -106,6 +109,7 @@ class ApiQueryInfo extends ApiQueryBase { * @param TitleFormatter $titleFormatter * @param WatchedItemStore $watchedItemStore * @param LanguageConverterFactory $languageConverterFactory + * @param RestrictionStore $restrictionStore */ public function __construct( ApiQuery $queryModule, @@ -116,7 +120,8 @@ class ApiQueryInfo extends ApiQueryBase { TitleFactory $titleFactory, TitleFormatter $titleFormatter, WatchedItemStore $watchedItemStore, - LanguageConverterFactory $languageConverterFactory + LanguageConverterFactory $languageConverterFactory, + RestrictionStore $restrictionStore ) { parent::__construct( $queryModule, $moduleName, 'in' ); $this->languageConverter = $languageConverterFactory->getLanguageConverter( $contentLanguage ); @@ -125,6 +130,7 @@ class ApiQueryInfo extends ApiQueryBase { $this->titleFactory = $titleFactory; $this->titleFormatter = $titleFormatter; $this->watchedItemStore = $watchedItemStore; + $this->restrictionStore = $restrictionStore; } /** @@ -519,7 +525,7 @@ class ApiQueryInfo extends ApiQueryBase { } // Applicable protection types $this->restrictionTypes[$title->getNamespace()][$title->getDBkey()] = - array_values( $title->getRestrictionTypes() ); + array_values( $this->restrictionStore->listApplicableRestrictionTypes( $title ) ); } $linksMigration = MediaWikiServices::getInstance()->getLinksMigration(); |