MediaWiki master
UnsupportedContentTypeBodyValidator.php
Go to the documentation of this file.
1<?php
2
4
8
22
23 private string $contentType;
24
25 public function __construct( string $contentType ) {
26 $this->contentType = $contentType;
27 }
28
33 public function validateBody( RequestInterface $request ): never {
34 throw new LocalizedHttpException(
35 new MessageValue( 'rest-unsupported-content-type', [ $this->contentType ] ),
36 415
37 );
38 }
39
40}
validateBody(RequestInterface $request)
Validate the body of a request.This may return a data structure representing the parsed body....
Value object representing a message for i18n.
A request interface similar to PSR-7's ServerRequestInterface.
Interface for validating a request body.