MediaWiki REL1_35
Wikimedia\ParamValidator\ValidationException Class Reference

Error reporting for ParamValidator. More...

Inheritance diagram for Wikimedia\ParamValidator\ValidationException:
Collaboration diagram for Wikimedia\ParamValidator\ValidationException:

Public Member Functions

 __construct (DataMessageValue $failureMessage, $name, $value, $settings, Throwable $previous=null)
 Stable to call.
 
 getFailureMessage ()
 Fetch the validation failure message.
 
 getParamName ()
 Fetch the parameter name that failed validation.
 
 getParamValue ()
 Fetch the parameter value that failed validation.
 
 getSettings ()
 Fetch the settings array that failed validation.
 

Protected Attributes

DataMessageValue $failureMessage
 
string $paramName
 
mixed $paramValue
 
array $settings
 

Detailed Description

Error reporting for ParamValidator.

@newable

Since
1.34 @unstable

Definition at line 16 of file ValidationException.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\ParamValidator\ValidationException::__construct ( DataMessageValue  $failureMessage,
  $name,
  $value,
  $settings,
Throwable  $previous = null 
)

Stable to call.

Parameters
DataMessageValue$failureMessageFailure message.
string$nameParameter name being validated
mixed$valueValue of the parameter
array$settingsSettings array being used for validation
Throwable | null$previousPrevious throwable causing this failure

Definition at line 38 of file ValidationException.php.

References Wikimedia\ParamValidator\ValidationException\$failureMessage, Wikimedia\ParamValidator\ValidationException\$settings, Wikimedia\Message\DataMessageValue\getCode(), and Wikimedia\Message\DataMessageValue\getData().

Member Function Documentation

◆ getFailureMessage()

Wikimedia\ParamValidator\ValidationException::getFailureMessage ( )

Fetch the validation failure message.

Users are encouraged to use this with an appropriate message formatter rather than relying on the limited English text returned by getMessage().

Returns
DataMessageValue

Definition at line 63 of file ValidationException.php.

References Wikimedia\ParamValidator\ValidationException\$failureMessage.

Referenced by MediaWiki\Rest\Validator\Validator\validateParams(), and Wikimedia\ParamValidator\ParamValidator\validateValue().

◆ getParamName()

Wikimedia\ParamValidator\ValidationException::getParamName ( )

Fetch the parameter name that failed validation.

Returns
string

Definition at line 71 of file ValidationException.php.

References Wikimedia\ParamValidator\ValidationException\$paramName.

Referenced by MediaWiki\Rest\Validator\Validator\validateParams().

◆ getParamValue()

Wikimedia\ParamValidator\ValidationException::getParamValue ( )

Fetch the parameter value that failed validation.

Returns
mixed

Definition at line 79 of file ValidationException.php.

References Wikimedia\ParamValidator\ValidationException\$paramValue.

Referenced by MediaWiki\Rest\Validator\Validator\validateParams().

◆ getSettings()

Wikimedia\ParamValidator\ValidationException::getSettings ( )

Fetch the settings array that failed validation.

Returns
array

Definition at line 87 of file ValidationException.php.

References Wikimedia\ParamValidator\ValidationException\$settings.

Member Data Documentation

◆ $failureMessage

DataMessageValue Wikimedia\ParamValidator\ValidationException::$failureMessage
protected

◆ $paramName

string Wikimedia\ParamValidator\ValidationException::$paramName
protected

◆ $paramValue

mixed Wikimedia\ParamValidator\ValidationException::$paramValue
protected

◆ $settings

array Wikimedia\ParamValidator\ValidationException::$settings
protected

The documentation for this class was generated from the following file: