WoohooLabs\Yin\JsonApi\Exception\ExceptionFactoryInterface::createMediaTypeUnsupportedException PHP Method

createMediaTypeUnsupportedException() public method

public createMediaTypeUnsupportedException ( WoohooLabs\Yin\JsonApi\Request\RequestInterface $request, string $mediaTypeName ) : Exception
$request WoohooLabs\Yin\JsonApi\Request\RequestInterface
$mediaTypeName string
return Exception
    public function createMediaTypeUnsupportedException(RequestInterface $request, $mediaTypeName);

Usage Example

示例#1
0
 /**
  * @throws \WoohooLabs\Yin\JsonApi\Exception\MediaTypeUnsupported
  */
 public function validateContentTypeHeader()
 {
     if ($this->isValidMediaTypeHeader("Content-Type") === false) {
         throw $this->exceptionFactory->createMediaTypeUnsupportedException($this, $this->getHeaderLine("Content-Type"));
     }
 }