|
MediaWiki REL1_35
|
This wraps a bunch of the API-specific parameter validation logic. More...

Public Member Functions | |
| __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. | |
Private Member Functions | |
| checkSettingsMessage (ApiBase $module, string $key, $value, array &$ret) | |
| Check an API settings message. | |
| convertValidationException (ApiBase $module, ValidationException $ex) | |
| Convert a ValidationException to an ApiUsageException. | |
| mapDeprecatedSettingsMessages (array $settings) | |
| Map deprecated styles for messages for ParamValidator. | |
Private Attributes | |
| MessageConverter | $messageConverter |
| ParamValidator | $paramValidator |
| const | TYPE_DEFS |
| Type defs for ParamValidator. | |
This wraps a bunch of the API-specific parameter validation logic.
It's intended to be used in ApiMain by composition.
Definition at line 37 of file ApiParamValidator.php.
| MediaWiki\Api\Validator\ApiParamValidator::__construct | ( | ApiMain | $main, |
| ObjectFactory | $objectFactory | ||
| ) |
Definition at line 82 of file ApiParamValidator.php.
| MediaWiki\Api\Validator\ApiParamValidator::checkSettings | ( | ApiBase | $module, |
| array | $params, | ||
| string | $name, | ||
| array | $options | ||
| ) |
Check settings for the Action API.
| ApiBase | $module | |
| array | $params | All module params to test |
| string | $name | Parameter to test |
| array | $options | Options array |
Definition at line 177 of file ApiParamValidator.php.
|
private |
Check an API settings message.
| ApiBase | $module | |
| string | $key | |
| mixed | $value | |
| array | &$ret |
Definition at line 160 of file ApiParamValidator.php.
|
private |
Convert a ValidationException to an ApiUsageException.
| ApiBase | $module | |
| ValidationException | $ex |
| ApiUsageException | always |
Definition at line 325 of file ApiParamValidator.php.
| MediaWiki\Api\Validator\ApiParamValidator::getHelpInfo | ( | ApiBase | $module, |
| string | $name, | ||
| $settings, | |||
| array | $options | ||
| ) |
Describe parameter settings in human-readable format.
| 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. |
Definition at line 409 of file ApiParamValidator.php.
| MediaWiki\Api\Validator\ApiParamValidator::getParamInfo | ( | ApiBase | $module, |
| string | $name, | ||
| $settings, | |||
| array | $options | ||
| ) |
Describe parameter settings in a machine-readable format.
| ApiBase | $module | |
| string | $name | Parameter name. |
| array | mixed | $settings | Default value or an array of settings using PARAM_* constants. |
| array | $options | Options array. |
Definition at line 393 of file ApiParamValidator.php.
| MediaWiki\Api\Validator\ApiParamValidator::getValue | ( | ApiBase | $module, |
| string | $name, | ||
| $settings, | |||
| array | $options = [] |
||
| ) |
Get and validate a value.
| ApiBase | $module | |
| string | $name | Parameter name, unprefixed |
| array | mixed | $settings | Default value or an array of settings using PARAM_* constants. |
| array | $options | Options array |
| ApiUsageException | if the value is invalid |
Definition at line 347 of file ApiParamValidator.php.
References ApiBase\encodeParamName().
| MediaWiki\Api\Validator\ApiParamValidator::knownTypes | ( | ) |
|
private |
Map deprecated styles for messages for ParamValidator.
| array | $settings |
Definition at line 107 of file ApiParamValidator.php.
References ApiMessage\create().
| MediaWiki\Api\Validator\ApiParamValidator::normalizeSettings | ( | $settings | ) |
Adjust certain settings where ParamValidator differs from historical Action API behavior.
| array | mixed | $settings |
Definition at line 137 of file ApiParamValidator.php.
| MediaWiki\Api\Validator\ApiParamValidator::validateValue | ( | ApiBase | $module, |
| string | $name, | ||
| $value, | |||
| $settings, | |||
| array | $options = [] |
||
| ) |
Valiate a parameter value using a settings array.
| 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 |
| ApiUsageException | if the value is invalid |
Definition at line 370 of file ApiParamValidator.php.
References ApiBase\encodeParamName().
|
private |
Definition at line 43 of file ApiParamValidator.php.
|
private |
Definition at line 40 of file ApiParamValidator.php.
|
private |
Type defs for ParamValidator.
Definition at line 46 of file ApiParamValidator.php.