This wraps a bunch of the API-specific parameter validation logic.
More...
|
| __construct (ApiMain $main, ObjectFactory $objectFactory) |
|
| checkSettings (ApiBase $module, array $params, string $name, array $options) |
| Check settings for the Action API.
|
|
| getHelpInfo (ApiBase $module, string $name, $settings, array $options) |
| Describe parameter settings in human-readable format.
|
|
| getParamInfo (ApiBase $module, string $name, $settings, array $options) |
| Describe parameter settings in a machine-readable format.
|
|
| getValue (ApiBase $module, string $name, $settings, array $options=[]) |
| Get and validate a value.
|
|
| knownTypes () |
| List known type names.
|
|
| normalizeSettings ( $settings) |
| Adjust certain settings where ParamValidator differs from historical Action API behavior.
|
|
| validateValue (ApiBase $module, string $name, $value, $settings, array $options=[]) |
| Valiate a parameter value using a settings array.
|
|
This wraps a bunch of the API-specific parameter validation logic.
It's intended to be used in ApiMain by composition.
- Since
- 1.35
Definition at line 38 of file ApiParamValidator.php.
◆ __construct()
MediaWiki\Api\Validator\ApiParamValidator::__construct |
( |
ApiMain |
$main, |
|
|
ObjectFactory |
$objectFactory |
|
) |
| |
◆ checkSettings()
MediaWiki\Api\Validator\ApiParamValidator::checkSettings |
( |
ApiBase |
$module, |
|
|
array |
$params, |
|
|
string |
$name, |
|
|
array |
$options |
|
) |
| |
Check settings for the Action API.
- Parameters
-
ApiBase | $module | |
array | $params | All module params to test |
string | $name | Parameter to test |
array | $options | Options array |
- Returns
- array As for ParamValidator::checkSettings()
Definition at line 188 of file ApiParamValidator.php.
◆ checkSettingsMessage()
MediaWiki\Api\Validator\ApiParamValidator::checkSettingsMessage |
( |
ApiBase |
$module, |
|
|
string |
$key, |
|
|
|
$value, |
|
|
array & |
$ret |
|
) |
| |
|
private |
◆ convertValidationException()
◆ getHelpInfo()
MediaWiki\Api\Validator\ApiParamValidator::getHelpInfo |
( |
ApiBase |
$module, |
|
|
string |
$name, |
|
|
|
$settings, |
|
|
array |
$options |
|
) |
| |
Describe parameter settings in human-readable format.
- Parameters
-
ApiBase | $module | |
string | $name | Parameter name being described. |
array | mixed | $settings | Default value or an array of settings using PARAM_* constants. |
array | $options | Options array. |
- Returns
- Message[]
Definition at line 421 of file ApiParamValidator.php.
◆ getParamInfo()
MediaWiki\Api\Validator\ApiParamValidator::getParamInfo |
( |
ApiBase |
$module, |
|
|
string |
$name, |
|
|
|
$settings, |
|
|
array |
$options |
|
) |
| |
Describe parameter settings in a machine-readable format.
- Parameters
-
ApiBase | $module | |
string | $name | Parameter name. |
array | mixed | $settings | Default value or an array of settings using PARAM_* constants. |
array | $options | Options array. |
- Returns
- array
Definition at line 405 of file ApiParamValidator.php.
◆ getValue()
MediaWiki\Api\Validator\ApiParamValidator::getValue |
( |
ApiBase |
$module, |
|
|
string |
$name, |
|
|
|
$settings, |
|
|
array |
$options = [] |
|
) |
| |
Get and validate a value.
- Parameters
-
ApiBase | $module | |
string | $name | Parameter name, unprefixed |
array | mixed | $settings | Default value or an array of settings using PARAM_* constants. |
array | $options | Options array |
- Returns
- mixed Validated parameter value
- Exceptions
-
Definition at line 359 of file ApiParamValidator.php.
References ApiBase\encodeParamName().
◆ knownTypes()
MediaWiki\Api\Validator\ApiParamValidator::knownTypes |
( |
| ) |
|
◆ mapDeprecatedSettingsMessages()
MediaWiki\Api\Validator\ApiParamValidator::mapDeprecatedSettingsMessages |
( |
array |
$settings | ) |
|
|
private |
◆ normalizeSettings()
MediaWiki\Api\Validator\ApiParamValidator::normalizeSettings |
( |
|
$settings | ) |
|
Adjust certain settings where ParamValidator differs from historical Action API behavior.
- Parameters
-
- Returns
- array
Definition at line 148 of file ApiParamValidator.php.
◆ validateValue()
MediaWiki\Api\Validator\ApiParamValidator::validateValue |
( |
ApiBase |
$module, |
|
|
string |
$name, |
|
|
|
$value, |
|
|
|
$settings, |
|
|
array |
$options = [] |
|
) |
| |
Valiate a parameter value using a settings array.
- Parameters
-
ApiBase | $module | |
string | $name | Parameter name, unprefixed |
mixed | $value | Parameter value |
array | mixed | $settings | Default value or an array of settings using PARAM_* constants. |
array | $options | Options array |
- Returns
- mixed Validated parameter value(s)
- Exceptions
-
Definition at line 382 of file ApiParamValidator.php.
References ApiBase\encodeParamName().
◆ $messageConverter
MessageConverter MediaWiki\Api\Validator\ApiParamValidator::$messageConverter |
|
private |
◆ $paramValidator
ParamValidator MediaWiki\Api\Validator\ApiParamValidator::$paramValidator |
|
private |
◆ TYPE_DEFS
const MediaWiki\Api\Validator\ApiParamValidator::TYPE_DEFS |
|
private |
The documentation for this class was generated from the following file: