MediaWiki
1.34.0
|
Wrapper for ParamValidator. More...
Public Member Functions | |
__construct (ObjectFactory $objectFactory, PermissionManager $permissionManager, RequestInterface $request, UserIdentity $user) | |
validateBody (RequestInterface $request, Handler $handler) | |
Validate the body of a request. More... | |
validateParams (array $paramSettings) | |
Validate parameters. More... | |
Private Attributes | |
ParamValidator | $paramValidator |
Static Private Attributes | |
static string[] | $bodyMethods = [ 'POST', 'PUT' ] |
HTTP request methods that we expect always to have a payload. More... | |
static string[] | $formDataContentTypes |
Content types handled via $_POST. More... | |
static string[] | $noBodyMethods = [ 'GET', 'HEAD', 'DELETE' ] |
HTTP request methods that we expect never to have a payload. More... | |
static array | $typeDefs |
Type defs for ParamValidator. More... | |
Wrapper for ParamValidator.
It's intended to be used in the REST API classes by composition.
Definition at line 29 of file Validator.php.
MediaWiki\Rest\Validator\Validator::__construct | ( | ObjectFactory | $objectFactory, |
PermissionManager | $permissionManager, | ||
RequestInterface | $request, | ||
UserIdentity | $user | ||
) |
ObjectFactory | $objectFactory | |
PermissionManager | $permissionManager | |
RequestInterface | $request | |
UserIdentity | $user |
Definition at line 72 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 125 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 validaton failure |
Definition at line 93 of file Validator.php.
References Wikimedia\ParamValidator\ValidationException\getFailureCode(), Wikimedia\ParamValidator\ValidationException\getFailureData(), Wikimedia\ParamValidator\ValidationException\getParamName(), Wikimedia\ParamValidator\ValidationException\getParamValue(), and MediaWiki\Rest\Handler\PARAM_SOURCE.
Referenced by MediaWiki\Rest\Handler\validate().
|
staticprivate |
HTTP request methods that we expect always to have a payload.
Definition at line 54 of file Validator.php.
|
staticprivate |
Content types handled via $_POST.
Definition at line 57 of file Validator.php.
|
staticprivate |
HTTP request methods that we expect never to have a payload.
Definition at line 51 of file Validator.php.
|
private |
Definition at line 63 of file Validator.php.
|
staticprivate |
Type defs for ParamValidator.
Definition at line 32 of file Validator.php.