Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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