MediaWiki master
|
Type definition for array structures, typically used for validating JSON request bodies. More...
Inherits Wikimedia\ParamValidator\TypeDef.
Public Member Functions | |
supportsArrays () | |
Whether the value may be an array. | |
validate ( $name, $value, array $settings, array $options) | |
Validate the value. | |
Public Member Functions inherited from Wikimedia\ParamValidator\TypeDef | |
__construct (Callbacks $callbacks) | |
checkSettings (string $name, $settings, array $options, array $ret) | |
Validate a parameter settings array. | |
getEnumValues ( $name, array $settings, array $options) | |
Get the values for enum-like parameters. | |
getHelpInfo ( $name, array $settings, array $options) | |
Describe parameter settings in human-readable format. | |
getParamInfo ( $name, array $settings, array $options) | |
Describe parameter settings in a machine-readable format. | |
getValue ( $name, array $settings, array $options) | |
Get the value from the request. | |
normalizeSettings (array $settings) | |
Normalize a settings array. | |
stringifyValue ( $name, $value, array $settings, array $options) | |
Convert a value to a string representation. | |
Additional Inherited Members | |
Protected Member Functions inherited from Wikimedia\ParamValidator\TypeDef | |
failure ( $failure, $name, $value, array $settings, array $options, $fatal=true) | |
Record a failure message. | |
failureMessage ( $code, array $data=null, $suffix=null) | |
Create a DataMessageValue representing a failure. | |
Protected Attributes inherited from Wikimedia\ParamValidator\TypeDef | |
Callbacks | $callbacks |
Type definition for array structures, typically used for validating JSON request bodies.
Failure codes:
Definition at line 18 of file ArrayDef.php.
MediaWiki\ParamValidator\TypeDef\ArrayDef::supportsArrays | ( | ) |
Whether the value may be an array.
Note that this is different from multi-value. This should only return true if each value can be an array.
Reimplemented from Wikimedia\ParamValidator\TypeDef.
Definition at line 20 of file ArrayDef.php.
MediaWiki\ParamValidator\TypeDef\ArrayDef::validate | ( | $name, | |
$value, | |||
array | $settings, | ||
array | $options ) |
Validate the value.
When ParamValidator is processing a multi-valued parameter, this will be called once for each of the supplied values. Which may mean zero calls.
When getValue() returned null, this will not be called.
string | $name | Parameter name being validated. |
mixed | $value | Value to validate, from getValue(). |
array | $settings | Parameter settings array. |
array | $options | Options array. Note the following values that may be set by ParamValidator:
|
ValidationException | if the value is invalid |
Reimplemented from Wikimedia\ParamValidator\TypeDef.
Definition at line 24 of file ArrayDef.php.
References Wikimedia\ParamValidator\TypeDef\failure().