Merge "Provide command to adjust phpunit.xml for code coverage"
[lhc/web/wiklou.git] / includes / Rest / Validator / BodyValidator.php
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 interface BodyValidator {
12
13 /**
14 * Validate the body of a request.
15 *
16 * This may return a data structure representing the parsed body. When used
17 * in the context of Handler::validateParams(), the returned value will be
18 * available to the handler via Handler::getValidatedBody().
19 *
20 * @param RequestInterface $request
21 * @return mixed
22 * @throws HttpException on validation failure
23 */
24 public function validateBody( RequestInterface $request );
25
26 }