Skip to content

Commit

Permalink
Merge branch '2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
dunglas committed Jun 27, 2019
2 parents 3e6a154 + d46ac32 commit 4bfeda9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/GraphQl/Serializer/ItemNormalizer.php
Expand Up @@ -67,7 +67,7 @@ public function supportsNormalization($data, $format = null): bool
*/
public function normalize($object, $format = null, array $context = [])
{
if (null !== $outputClass = $this->getOutputClass($this->getObjectClass($object), $context)) {
if (null !== $this->getOutputClass($this->getObjectClass($object), $context)) {
return parent::normalize($object, $format, $context);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Hal/Serializer/ItemNormalizer.php
Expand Up @@ -48,7 +48,7 @@ public function supportsNormalization($data, $format = null): bool
*/
public function normalize($object, $format = null, array $context = [])
{
if (null !== $outputClass = $this->getOutputClass($this->getObjectClass($object), $context)) {
if (null !== $this->getOutputClass($this->getObjectClass($object), $context)) {
return parent::normalize($object, $format, $context);
}

Expand Down
2 changes: 1 addition & 1 deletion src/JsonApi/Serializer/ItemNormalizer.php
Expand Up @@ -66,7 +66,7 @@ public function supportsNormalization($data, $format = null): bool
*/
public function normalize($object, $format = null, array $context = [])
{
if (null !== $outputClass = $this->getOutputClass($this->getObjectClass($object), $context)) {
if (null !== $this->getOutputClass($this->getObjectClass($object), $context)) {
return parent::normalize($object, $format, $context);
}

Expand Down
2 changes: 1 addition & 1 deletion src/JsonLd/Serializer/ItemNormalizer.php
Expand Up @@ -65,7 +65,7 @@ public function supportsNormalization($data, $format = null): bool
*/
public function normalize($object, $format = null, array $context = [])
{
if (null !== $outputClass = $this->getOutputClass($this->getObjectClass($object), $context)) {
if (null !== $this->getOutputClass($this->getObjectClass($object), $context)) {
return parent::normalize($object, $format, $context);
}

Expand Down
3 changes: 0 additions & 3 deletions src/Security/ResourceAccessChecker.php
Expand Up @@ -13,7 +13,6 @@

namespace ApiPlatform\Core\Security;

use ApiPlatform\Core\Util\ClassInfoTrait;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
Expand All @@ -29,8 +28,6 @@
*/
final class ResourceAccessChecker implements ResourceAccessCheckerInterface
{
use ClassInfoTrait;

private $expressionLanguage;
private $authenticationTrustResolver;
private $roleHierarchy;
Expand Down
13 changes: 6 additions & 7 deletions tests/Action/ExceptionActionTest.php
Expand Up @@ -46,13 +46,12 @@ public function testActionWithCatchableException()
$request = new Request();
$request->setFormat('jsonproblem', 'application/problem+json');

$expected = new Response('', Response::HTTP_BAD_REQUEST, [
'Content-Type' => 'application/problem+json; charset=utf-8',
'X-Content-Type-Options' => 'nosniff',
'X-Frame-Options' => 'deny',
]);

$this->assertEquals($expected, $exceptionAction($flattenException, $request));
$response = $exceptionAction($flattenException, $request);
$this->assertSame('', $response->getContent());
$this->assertSame(Response::HTTP_BAD_REQUEST, $response->getStatusCode());
$this->assertTrue($response->headers->contains('Content-Type', 'application/problem+json; charset=utf-8'));
$this->assertTrue($response->headers->contains('X-Content-Type-Options', 'nosniff'));
$this->assertTrue($response->headers->contains('X-Frame-Options', 'deny'));
}

public function testActionWithUncatchableException()
Expand Down

0 comments on commit 4bfeda9

Please sign in to comment.