Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Decouples AcceptAndContentTypeMiddleware from ResponseManagerInterface #3

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
12 changes: 12 additions & 0 deletions src/Manager/AcceptAndContentTypeMiddlewareResponseManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ public function __construct(ResponseManagerInterface $responseManager)
$this->responseManager = $responseManager;
}

/**
* @param string $accept
* @param array|string[] $acceptableMimeTypes
TiMESPLiNTER marked this conversation as resolved.
Show resolved Hide resolved
* @param string $mimeType
* @return ResponseInterface
*/
public function createForNotAcceptable(
string $accept,
array $acceptableMimeTypes,
Expand All @@ -33,6 +39,12 @@ public function createForNotAcceptable(
);
}

/**
* @param string $mediaType
* @param array|string[] $supportedMediaTypes
TiMESPLiNTER marked this conversation as resolved.
Show resolved Hide resolved
* @param string $mimeType
* @return ResponseInterface
*/
public function createForUnsupportedMediaType(
string $mediaType,
array $supportedMediaTypes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,24 @@

interface AcceptAndContentTypeMiddlewareResponseFactoryInterface
{
/**
* @param string $accept
* @param array|string[] $acceptableMimeTypes
TiMESPLiNTER marked this conversation as resolved.
Show resolved Hide resolved
* @param string $mimeType
* @return ResponseInterface
*/
public function createForNotAcceptable(
string $accept,
array $acceptableMimeTypes,
string $mimeType
): ResponseInterface;

/**
* @param string $mediaType
* @param array|string[] $supportedMediaTypes
TiMESPLiNTER marked this conversation as resolved.
Show resolved Hide resolved
* @param string $mimeType
* @return ResponseInterface
*/
public function createForUnsupportedMediaType(
string $mediaType,
array $supportedMediaTypes,
Expand Down