Exemple #1
0
 /**
  * @param string|null                       $content
  * @param int                               $statusCode
  * @param MediaTypeInterface                $mediaType
  * @param SupportedExtensionsInterface|null $supportedExtensions
  * @param array                             $headers
  *
  * @return mixed
  */
 private function createResponse($content, $statusCode, MediaTypeInterface $mediaType, SupportedExtensionsInterface $supportedExtensions = null, array $headers = [])
 {
     is_int($statusCode) === true ?: Exceptions::throwInvalidArgument('statusCode', $statusCode);
     $headers[self::HEADER_CONTENT_TYPE] = $this->getContentTypeHeader($mediaType, $supportedExtensions);
     return $this->responses->createResponse($content, $statusCode, $headers);
 }
Exemple #2
0
 /**
  * @param string|null                       $content
  * @param int                               $statusCode
  * @param MediaTypeInterface                $mediaType
  * @param SupportedExtensionsInterface|null $supportedExtensions
  * @param array                             $headers
  *
  * @return mixed
  */
 private function createResponse($content, $statusCode, MediaTypeInterface $mediaType, SupportedExtensionsInterface $supportedExtensions = null, array $headers = [])
 {
     assert('is_int($statusCode)');
     $headers[self::HEADER_CONTENT_TYPE] = $this->getContentTypeHeader($mediaType, $supportedExtensions);
     return $this->responses->createResponse($content, $statusCode, $headers);
 }