MediaWiki REL1_39
|
Wrapper for ParamValidator. More...
Public Member Functions | |
__construct (ObjectFactory $objectFactory, RequestInterface $request, Authority $authority) | |
validateBody (RequestInterface $request, Handler $handler) | |
Validate the body of a request. | |
validateParams (array $paramSettings) | |
Validate parameters. | |
Wrapper for ParamValidator.
It's intended to be used in the REST API classes by composition.
Definition at line 32 of file Validator.php.
MediaWiki\Rest\Validator\Validator::__construct | ( | ObjectFactory | $objectFactory, |
RequestInterface | $request, | ||
Authority | $authority ) |
ObjectFactory | $objectFactory | |
RequestInterface | $request | |
Authority | $authority |
Definition at line 87 of file Validator.php.
MediaWiki\Rest\Validator\Validator::validateBody | ( | RequestInterface | $request, |
Handler | $handler ) |
Validate the body of a request.
This may return a data structure representing the parsed body. When used in the context of Handler::validateParams(), the returned value will be available to the handler via Handler::getValidatedBody().
RequestInterface | $request | |
Handler | $handler | Used to call getBodyValidator() |
HttpException | on validation failure |
Definition at line 139 of file Validator.php.
References MediaWiki\Rest\RequestInterface\getBody(), MediaWiki\Rest\Handler\getBodyValidator(), MediaWiki\Rest\RequestInterface\getHeaderLine(), and MediaWiki\Rest\RequestInterface\getMethod().
Referenced by MediaWiki\Rest\Handler\validate().
MediaWiki\Rest\Validator\Validator::validateParams | ( | array | $paramSettings | ) |
Validate parameters.
array[] | $paramSettings | Parameter settings |
HttpException | on validation failure |
Definition at line 107 of file Validator.php.
References Wikimedia\ParamValidator\ValidationException\getFailureMessage(), Wikimedia\ParamValidator\ValidationException\getParamName(), Wikimedia\ParamValidator\ValidationException\getParamValue(), and MediaWiki\Rest\Handler\PARAM_SOURCE.
Referenced by MediaWiki\Rest\Handler\validate().