Skip to content

Commit 4bfeda9

Browse files
committed
Merge branch '2.4'
2 parents 3e6a154 + d46ac32 commit 4bfeda9

File tree

6 files changed

+10
-14
lines changed

6 files changed

+10
-14
lines changed

src/GraphQl/Serializer/ItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function supportsNormalization($data, $format = null): bool
6767
*/
6868
public function normalize($object, $format = null, array $context = [])
6969
{
70-
if (null !== $outputClass = $this->getOutputClass($this->getObjectClass($object), $context)) {
70+
if (null !== $this->getOutputClass($this->getObjectClass($object), $context)) {
7171
return parent::normalize($object, $format, $context);
7272
}
7373

src/Hal/Serializer/ItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function supportsNormalization($data, $format = null): bool
4848
*/
4949
public function normalize($object, $format = null, array $context = [])
5050
{
51-
if (null !== $outputClass = $this->getOutputClass($this->getObjectClass($object), $context)) {
51+
if (null !== $this->getOutputClass($this->getObjectClass($object), $context)) {
5252
return parent::normalize($object, $format, $context);
5353
}
5454

src/JsonApi/Serializer/ItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function supportsNormalization($data, $format = null): bool
6666
*/
6767
public function normalize($object, $format = null, array $context = [])
6868
{
69-
if (null !== $outputClass = $this->getOutputClass($this->getObjectClass($object), $context)) {
69+
if (null !== $this->getOutputClass($this->getObjectClass($object), $context)) {
7070
return parent::normalize($object, $format, $context);
7171
}
7272

src/JsonLd/Serializer/ItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function supportsNormalization($data, $format = null): bool
6565
*/
6666
public function normalize($object, $format = null, array $context = [])
6767
{
68-
if (null !== $outputClass = $this->getOutputClass($this->getObjectClass($object), $context)) {
68+
if (null !== $this->getOutputClass($this->getObjectClass($object), $context)) {
6969
return parent::normalize($object, $format, $context);
7070
}
7171

src/Security/ResourceAccessChecker.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
namespace ApiPlatform\Core\Security;
1515

16-
use ApiPlatform\Core\Util\ClassInfoTrait;
1716
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
1817
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
1918
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
@@ -29,8 +28,6 @@
2928
*/
3029
final class ResourceAccessChecker implements ResourceAccessCheckerInterface
3130
{
32-
use ClassInfoTrait;
33-
3431
private $expressionLanguage;
3532
private $authenticationTrustResolver;
3633
private $roleHierarchy;

tests/Action/ExceptionActionTest.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,12 @@ public function testActionWithCatchableException()
4646
$request = new Request();
4747
$request->setFormat('jsonproblem', 'application/problem+json');
4848

49-
$expected = new Response('', Response::HTTP_BAD_REQUEST, [
50-
'Content-Type' => 'application/problem+json; charset=utf-8',
51-
'X-Content-Type-Options' => 'nosniff',
52-
'X-Frame-Options' => 'deny',
53-
]);
54-
55-
$this->assertEquals($expected, $exceptionAction($flattenException, $request));
49+
$response = $exceptionAction($flattenException, $request);
50+
$this->assertSame('', $response->getContent());
51+
$this->assertSame(Response::HTTP_BAD_REQUEST, $response->getStatusCode());
52+
$this->assertTrue($response->headers->contains('Content-Type', 'application/problem+json; charset=utf-8'));
53+
$this->assertTrue($response->headers->contains('X-Content-Type-Options', 'nosniff'));
54+
$this->assertTrue($response->headers->contains('X-Frame-Options', 'deny'));
5655
}
5756

5857
public function testActionWithUncatchableException()

0 commit comments

Comments
 (0)