|
MediaWiki master
|
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. | |
| overrideTypeDef (string $name, $typeDef) | |
| Register a type handler, overriding any existing handler. | |
| validateValue (ApiBase $module, string $name, $value, $settings, array $options=[]) | |
| Validate 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.
Definition at line 41 of file ApiParamValidator.php.
| MediaWiki\Api\Validator\ApiParamValidator::__construct | ( | ApiMain | $main, |
| ObjectFactory | $objectFactory ) |
| ApiMain | $main | |
| ObjectFactory | $objectFactory |
Definition at line 96 of file ApiParamValidator.php.
References MediaWiki\Api\ApiBase\LIMIT_SML1, and MediaWiki\Api\ApiBase\LIMIT_SML2.
| 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 203 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 449 of file ApiParamValidator.php.
References MediaWiki\Message\Message\newFromSpecifier().
| 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 433 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 387 of file ApiParamValidator.php.
References MediaWiki\Api\ApiBase\encodeParamName(), and normalizeSettings().
| MediaWiki\Api\Validator\ApiParamValidator::knownTypes | ( | ) |
List known type names.
Definition at line 124 of file ApiParamValidator.php.
References knownTypes(), and return.
Referenced by knownTypes().
| MediaWiki\Api\Validator\ApiParamValidator::normalizeSettings | ( | $settings | ) |
Adjust certain settings where ParamValidator differs from historical Action API behavior.
| array | mixed | $settings |
Definition at line 162 of file ApiParamValidator.php.
References if, and MediaWiki\Api\ApiBase\PARAM_RANGE_ENFORCE.
Referenced by getValue(), and validateValue().
| MediaWiki\Api\Validator\ApiParamValidator::overrideTypeDef | ( | string | $name, |
| $typeDef ) |
Register a type handler, overriding any existing handler.
| string | $name | Type name |
| TypeDef | array | null | $typeDef | As for addTypeDef, or null to unregister a type. |
Definition at line 116 of file ApiParamValidator.php.
| MediaWiki\Api\Validator\ApiParamValidator::validateValue | ( | ApiBase | $module, |
| string | $name, | ||
| $value, | |||
| $settings, | |||
| array | $options = [] ) |
Validate 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 410 of file ApiParamValidator.php.
References MediaWiki\Api\ApiBase\encodeParamName(), and normalizeSettings().