Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Rest\Validator; |
4 | |
5 | use MediaWiki\Rest\HttpException; |
6 | use MediaWiki\Rest\RequestInterface; |
7 | |
8 | /** |
9 | * Interface for validating a request body |
10 | * |
11 | * @stable to implement |
12 | * @see \MediaWiki\Rest\Handler::getBodyValidator() |
13 | */ |
14 | interface BodyValidator { |
15 | |
16 | /** |
17 | * Validate the body of a request. |
18 | * |
19 | * This may return a data structure representing the parsed body. When used |
20 | * in the context of Handler::validateParams(), the returned value will be |
21 | * available to the handler via Handler::getValidatedBody(). |
22 | * |
23 | * @param RequestInterface $request |
24 | * @return mixed|null |
25 | * @throws HttpException on validation failure |
26 | */ |
27 | public function validateBody( RequestInterface $request ); |
28 | |
29 | } |