Replace usage of ApiBase::PARAM_* with ParamValidator::PARAM_*
Change-Id: I4c7c16f8b3380cdaf32fbedc9d33f12b14050774
This commit is contained in:
@@ -18,6 +18,8 @@
|
|||||||
* @license MIT
|
* @license MIT
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Wikimedia\ParamValidator\ParamValidator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup API
|
* @ingroup API
|
||||||
*/
|
*/
|
||||||
@@ -34,12 +36,12 @@ class ApiLanguageSearch extends ApiBase {
|
|||||||
public function getAllowedParams() {
|
public function getAllowedParams() {
|
||||||
return [
|
return [
|
||||||
'search' => [
|
'search' => [
|
||||||
ApiBase::PARAM_REQUIRED => true
|
ParamValidator::PARAM_REQUIRED => true
|
||||||
],
|
],
|
||||||
'typos' => [
|
'typos' => [
|
||||||
ApiBase::PARAM_REQUIRED => false,
|
ParamValidator::PARAM_REQUIRED => false,
|
||||||
ApiBase::PARAM_TYPE => 'integer',
|
ParamValidator::PARAM_TYPE => 'integer',
|
||||||
ApiBase::PARAM_DFLT => 1
|
ParamValidator::PARAM_DEFAULT => 1
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use MediaWiki\Languages\LanguageNameUtils;
|
use MediaWiki\Languages\LanguageNameUtils;
|
||||||
|
use Wikimedia\ParamValidator\ParamValidator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup API
|
* @ingroup API
|
||||||
@@ -66,8 +67,8 @@ class ApiULSLocalization extends ApiBase {
|
|||||||
public function getAllowedParams() {
|
public function getAllowedParams() {
|
||||||
return [
|
return [
|
||||||
'language' => [
|
'language' => [
|
||||||
ApiBase::PARAM_REQUIRED => true,
|
ParamValidator::PARAM_REQUIRED => true,
|
||||||
ApiBase::PARAM_TYPE => 'string',
|
ParamValidator::PARAM_TYPE => 'string',
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use MediaWiki\User\UserOptionsManager;
|
use MediaWiki\User\UserOptionsManager;
|
||||||
|
use Wikimedia\ParamValidator\ParamValidator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup API
|
* @ingroup API
|
||||||
@@ -83,7 +84,7 @@ class ApiULSSetLanguage extends ApiBase {
|
|||||||
public function getAllowedParams() {
|
public function getAllowedParams() {
|
||||||
return [
|
return [
|
||||||
'languagecode' => [
|
'languagecode' => [
|
||||||
ApiBase::PARAM_REQUIRED => true,
|
ParamValidator::PARAM_REQUIRED => true,
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user