[HttpKernel] Support typehint to deprecated FlattenException in controller
This commit is contained in:
parent
cde2538849
commit
26b4e372dd
@ -12,6 +12,7 @@
|
||||
namespace Symfony\Component\HttpKernel\EventListener;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\Debug\Exception\FlattenException as LegacyFlattenException;
|
||||
use Symfony\Component\ErrorHandler\Exception\FlattenException;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
@ -98,7 +99,7 @@ class ErrorListener implements EventSubscriberInterface
|
||||
$r = new \ReflectionFunction(\Closure::fromCallable($event->getController()));
|
||||
$r = $r->getParameters()[$k] ?? null;
|
||||
|
||||
if ($r && (!$r->hasType() || FlattenException::class === $r->getType()->getName())) {
|
||||
if ($r && (!$r->hasType() || \in_array($r->getType()->getName(), [FlattenException::class, LegacyFlattenException::class], true])) {
|
||||
$arguments = $event->getArguments();
|
||||
$arguments[$k] = FlattenException::createFromThrowable($e);
|
||||
$event->setArguments($arguments);
|
||||
|
Reference in New Issue
Block a user