Skip to content

Commit 70f8a8b

Browse files
authored
Merge pull request #8 from PcComponentes/feature/symfony-5.0
Feature/symfony 5.0
2 parents a44a388 + 5c3200b commit 70f8a8b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": "^7.4",
22-
"symfony/framework-bundle": "^4.0",
22+
"symfony/framework-bundle": "^4.4|^5.0",
2323
"ext-json": "*"
2424
},
2525
"autoload": {

src/Core/ApixceptionDispatcher.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55

66
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
77
use Symfony\Component\HttpFoundation\JsonResponse;
8-
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
98
use Symfony\Component\HttpKernel\KernelEvents;
9+
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
10+
1011

1112
class ApixceptionDispatcher implements EventSubscriberInterface
1213
{
@@ -28,9 +29,9 @@ public function add(string $exception, int $httpCode, string $transformerClass):
2829
);
2930
}
3031

31-
public function onKernelException(GetResponseForExceptionEvent $event): void
32+
public function onKernelException(ExceptionEvent $event): void
3233
{
33-
$exception = $event->getException();
34+
$exception = $event->getThrowable();
3435

3536
foreach ($this->subscribers as $subscriber) {
3637
if (false === \is_a($exception, $subscriber->exception(), true)) {

0 commit comments

Comments
 (0)