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

Commit 4e946f4

Browse files
author
Dominik Zogg
committed
use camelCase variable keys
1 parent ae06ce3 commit 4e946f4

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Middleware/AcceptAndContentTypeMiddleware.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ public function __construct(
2525
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
2626
{
2727
if (null === $accept = $this->acceptNegotiator->negotiate($request)) {
28-
$supportedMediaTypes = $this->acceptNegotiator->getSupportedMediaTypes();
28+
$supportedAccepts = $this->acceptNegotiator->getSupportedMediaTypes();
2929

3030
return $this->responseManager->createFromHttpException(
3131
HttpException::createNotAcceptable([
3232
'accept' => $request->getHeaderLine('Accept'),
33-
'supported-accepts' => $supportedMediaTypes,
33+
'supportedAccepts' => $supportedAccepts,
3434
]),
35-
$supportedMediaTypes[0],
35+
$supportedAccepts[0],
3636
);
3737
}
3838

@@ -42,8 +42,8 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
4242
if (null === $contentType = $this->contentTypeNegotiator->negotiate($request)) {
4343
return $this->responseManager->createFromHttpException(
4444
HttpException::createUnsupportedMediaType([
45-
'content-type' => $request->getHeaderLine('Content-Type'),
46-
'supported-content-types' => $this->contentTypeNegotiator->getSupportedMediaTypes(),
45+
'contentType' => $request->getHeaderLine('Content-Type'),
46+
'supportedContentTypes' => $this->contentTypeNegotiator->getSupportedMediaTypes(),
4747
]),
4848
$accept->getValue(),
4949
);

tests/Unit/Middleware/AcceptAndContentTypeMiddlewareTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
6464
$data = $httpException->jsonSerialize();
6565

6666
self::assertSame('application/xml', $data['accept']);
67-
self::assertSame(['application/json'], $data['supported-accepts']);
67+
self::assertSame(['application/json'], $data['supportedAccepts']);
6868
}),
6969
'application/json',
7070
)
@@ -164,8 +164,8 @@ public function handle(ServerRequestInterface $request): ResponseInterface
164164

165165
$data = $httpException->jsonSerialize();
166166

167-
self::assertSame('application/xml', $data['content-type']);
168-
self::assertSame(['application/json'], $data['supported-content-types']);
167+
self::assertSame('application/xml', $data['contentType']);
168+
self::assertSame(['application/json'], $data['supportedContentTypes']);
169169
}),
170170
'application/json',
171171
)

0 commit comments

Comments
 (0)