Skip to content

Commit

Permalink
minor #34430 [HttpKernel] Make ErrorListener::onKernelException()'s d…
Browse files Browse the repository at this point in the history
…ispatcher argument explicit (chalasr)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Make ErrorListener::onKernelException()'s dispatcher argument explicit

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

One less BC break for 5.0

Commits
-------

aab9b43 [HttpKernel] Make ErrorListener::onKernelException()'s dispatcher argument explicit
  • Loading branch information
nicolas-grekas committed Nov 18, 2019
2 parents 76d3112 + aab9b43 commit 4498e7e
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -46,15 +46,14 @@ public function logKernelException(ExceptionEvent $event)
$this->logException($event->getThrowable(), sprintf('Uncaught PHP Exception %s: "%s" at %s line %s', $e->getClass(), $e->getMessage(), $e->getFile(), $e->getLine()));
}

public function onKernelException(ExceptionEvent $event)
public function onKernelException(ExceptionEvent $event, string $eventName = null, EventDispatcherInterface $eventDispatcher = null)
{
if (null === $this->controller) {
return;
}

$exception = $event->getThrowable();
$request = $this->duplicateRequest($exception, $event->getRequest());
$eventDispatcher = \func_num_args() > 2 ? func_get_arg(2) : null;

try {
$response = $event->getKernel()->handle($request, HttpKernelInterface::SUB_REQUEST, false);
Expand Down

0 comments on commit 4498e7e

Please sign in to comment.