diff options
author | Reedy <reedy@wikimedia.org> | 2022-06-06 00:18:50 +0100 |
---|---|---|
committer | Reedy <reedy@wikimedia.org> | 2022-06-06 00:18:50 +0100 |
commit | 0b5084f868262e96fe226b412c14fc3a61a9f21f (patch) | |
tree | 1cf3d5845115fb51e5658cc174556d7066e95a8e /includes/api/ApiProtect.php | |
parent | 59809d6b217a29b1a34de374164ab1b59a4a2f13 (diff) | |
download | mediawikicore-0b5084f868262e96fe226b412c14fc3a61a9f21f.tar.gz mediawikicore-0b5084f868262e96fe226b412c14fc3a61a9f21f.zip |
api: Replace numerous deprecated constants
Change-Id: I34ffcb70efbfa257da8dab6e0790aa0d697caf5b
Diffstat (limited to 'includes/api/ApiProtect.php')
-rw-r--r-- | includes/api/ApiProtect.php | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/includes/api/ApiProtect.php b/includes/api/ApiProtect.php index bc9ea1c6dc01..c3139079f718 100644 --- a/includes/api/ApiProtect.php +++ b/includes/api/ApiProtect.php @@ -24,6 +24,7 @@ use MediaWiki\MainConfigNames; use MediaWiki\Permissions\RestrictionStore; use MediaWiki\User\UserOptionsLookup; use MediaWiki\Watchlist\WatchlistManager; +use Wikimedia\ParamValidator\ParamValidator; /** * @ingroup API @@ -182,28 +183,28 @@ class ApiProtect extends ApiBase { public function getAllowedParams() { return [ 'title' => [ - ApiBase::PARAM_TYPE => 'string', + ParamValidator::PARAM_TYPE => 'string', ], 'pageid' => [ - ApiBase::PARAM_TYPE => 'integer', + ParamValidator::PARAM_TYPE => 'integer', ], 'protections' => [ - ApiBase::PARAM_ISMULTI => true, - ApiBase::PARAM_REQUIRED => true, + ParamValidator::PARAM_ISMULTI => true, + ParamValidator::PARAM_REQUIRED => true, ], 'expiry' => [ - ApiBase::PARAM_ISMULTI => true, - ApiBase::PARAM_ALLOW_DUPLICATES => true, - ApiBase::PARAM_DFLT => 'infinite', + ParamValidator::PARAM_ISMULTI => true, + ParamValidator::PARAM_ALLOW_DUPLICATES => true, + ParamValidator::PARAM_DEFAULT => 'infinite', ], 'reason' => '', 'tags' => [ - ApiBase::PARAM_TYPE => 'tags', - ApiBase::PARAM_ISMULTI => true, + ParamValidator::PARAM_TYPE => 'tags', + ParamValidator::PARAM_ISMULTI => true, ], 'cascade' => false, 'watch' => [ - ApiBase::PARAM_DFLT => false, + ParamValidator::PARAM_DEFAULT => false, ApiBase::PARAM_DEPRECATED => true, ], ] + $this->getWatchlistParams(); |