diff --git a/includes/ApiQueryLintErrors.php b/includes/ApiQueryLintErrors.php index 6b5c52bd..8f5d5c63 100644 --- a/includes/ApiQueryLintErrors.php +++ b/includes/ApiQueryLintErrors.php @@ -25,6 +25,7 @@ use ApiQuery; use ApiQueryBase; use ApiResult; use Title; +use Wikimedia\ParamValidator\ParamValidator; use Wikimedia\ParamValidator\TypeDef\IntegerDef; class ApiQueryLintErrors extends ApiQueryBase { @@ -116,31 +117,31 @@ class ApiQueryLintErrors extends ApiQueryBase { $visibleCats = ( new CategoryManager() )->getVisibleCategories(); return [ 'categories' => [ - ApiBase::PARAM_TYPE => $visibleCats, - ApiBase::PARAM_ISMULTI => true, + ParamValidator::PARAM_TYPE => $visibleCats, + ParamValidator::PARAM_ISMULTI => true, // Default is to show all categories - ApiBase::PARAM_DFLT => implode( '|', $visibleCats ), + ParamValidator::PARAM_DEFAULT => implode( '|', $visibleCats ), ], 'limit' => [ - ApiBase::PARAM_DFLT => 10, - ApiBase::PARAM_TYPE => 'limit', + ParamValidator::PARAM_DEFAULT => 10, + ParamValidator::PARAM_TYPE => 'limit', IntegerDef::PARAM_MIN => 1, IntegerDef::PARAM_MAX => ApiBase::LIMIT_BIG1, IntegerDef::PARAM_MAX2 => ApiBase::LIMIT_BIG2 ], 'namespace' => [ - ApiBase::PARAM_TYPE => 'namespace', - ApiBase::PARAM_ISMULTI => true, + ParamValidator::PARAM_TYPE => 'namespace', + ParamValidator::PARAM_ISMULTI => true, ], 'pageid' => [ - ApiBase::PARAM_TYPE => 'integer', - ApiBase::PARAM_ISMULTI => true, + ParamValidator::PARAM_TYPE => 'integer', + ParamValidator::PARAM_ISMULTI => true, ], 'title' => [ - ApiBase::PARAM_TYPE => 'string', + ParamValidator::PARAM_TYPE => 'string', ], 'from' => [ - ApiBase::PARAM_TYPE => 'integer', + ParamValidator::PARAM_TYPE => 'integer', ], ]; } diff --git a/includes/ApiRecordLint.php b/includes/ApiRecordLint.php index 0e34b23a..1ed5d85d 100644 --- a/includes/ApiRecordLint.php +++ b/includes/ApiRecordLint.php @@ -23,6 +23,7 @@ namespace MediaWiki\Linter; use ApiBase; use FormatJson; use Wikimedia\IPSet; +use Wikimedia\ParamValidator\ParamValidator; /** * API module for an external service to record @@ -60,16 +61,16 @@ class ApiRecordLint extends ApiBase { public function getAllowedParams() { return [ 'data' => [ - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true, + ParamValidator::PARAM_TYPE => 'string', + ParamValidator::PARAM_REQUIRED => true, ], 'page' => [ - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true, + ParamValidator::PARAM_TYPE => 'string', + ParamValidator::PARAM_REQUIRED => true, ], 'revision' => [ - ApiBase::PARAM_TYPE => 'integer', - ApiBase::PARAM_REQUIRED => true, + ParamValidator::PARAM_TYPE => 'integer', + ParamValidator::PARAM_REQUIRED => true, ], ]; }