10000 Fix #34661 Support typehint to deprecated `Symfony\Component\Debug\Ex… · andrew-demb/symfony@d13e28a · GitHub
[go: up one dir, main page]

Skip to content

Commit d13e28a

Browse files
authored
Fix symfony#34661 Support typehint to deprecated Symfony\Component\Debug\Exception\FlattenException in controller
1 parent cde2538 commit d13e28a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/HttpKernel/EventListener/ErrorListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\ErrorHandler\Exception\FlattenException;
1616
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
1717
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
18+
use Symfony\Component\Debug\Exception\FlattenException as LegacyFlattenException;
1819
use Symfony\Component\HttpFoundation\Request;
1920
use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent;
2021
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
@@ -98,7 +99,7 @@ public function onControllerArguments(ControllerArgumentsEvent $event)
9899
$r = new \ReflectionFunction(\Closure::fromCallable($event->getController()));
99100
$r = $r->getParameters()[$k] ?? null;
100101

101-
if ($r && (!$r->hasType() || FlattenException::class === $r->getType()->getName())) {
102+
if ($r && (!$r->hasType() || FlattenException::class === $r->getType()->getName() || LegacyFlattenException::class === $r->getType()->getName())) {
102103
$arguments = $event->getArguments();
103104
$arguments[$k] = FlattenException::createFromThrowable($e);
104105
$event->setArguments($arguments);

0 commit comments

Comments
 (0)
0