Skip to content

Commit cfc05d1

Browse files
authored
use interface HttpExceptionInterface instead of HttpException (#3533)
1 parent f52a17e commit cfc05d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GraphQl/Serializer/Exception/HttpExceptionNormalizer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
use GraphQL\Error\Error;
1717
use GraphQL\Error\FormattedError;
18-
use Symfony\Component\HttpKernel\Exception\HttpException;
18+
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
1919
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
2020

2121
/**
@@ -32,7 +32,7 @@ final class HttpExceptionNormalizer implements NormalizerInterface
3232
*/
3333
public function normalize($object, $format = null, array $context = []): array
3434
{
35-
/** @var HttpException */
35+
/** @var HttpExceptionInterface */
3636
$httpException = $object->getPrevious();
3737
$error = FormattedError::createFromException($object);
3838
$error['message'] = $httpException->getMessage();
@@ -47,6 +47,6 @@ public function normalize($object, $format = null, array $context = []): array
4747
*/
4848
public function supportsNormalization($data, $format = null): bool
4949
{
50-
return $data instanceof Error && $data->getPrevious() instanceof HttpException;
50+
return $data instanceof Error && $data->getPrevious() instanceof HttpExceptionInterface;
5151
}
5252
}

0 commit comments

Comments
 (0)