bug #34326 [HttpKernel] Fix missing import in GetResponseForExceptionEvent (fancyweb)

This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Fix missing import in GetResponseForExceptionEvent

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

Commits
-------

bc46a3a6dd [HttpKernel] Fix missing import in GetResponseForExceptionEvent
This commit is contained in:
Nicolas Grekas 2019-11-12 10:29:05 +01:00
commit a90352263c
2 changed files with 4 additions and 8 deletions

View File

@ -11,6 +11,7 @@
namespace Symfony\Component\HttpKernel\Event;
use Symfony\Component\Debug\Exception\FatalThrowableError;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;

View File

@ -106,7 +106,7 @@ class ErrorListener implements EventSubscriberInterface
}
}
public static function getSubscribedEvents()
public static function getSubscribedEvents(): array
{
return [
KernelEvents::CONTROLLER_ARGUMENTS => 'onControllerArguments',
@ -119,11 +119,8 @@ class ErrorListener implements EventSubscriberInterface
/**
* Logs an exception.
*
* @param \Exception $exception The \Exception instance
* @param string $message The error message to log
*/
protected function logException(\Exception $exception, $message)
protected function logException(\Throwable $exception, string $message): void
{
if (null !== $this->logger) {
if (!$exception instanceof HttpExceptionInterface || $exception->getStatusCode() >= 500) {
@ -136,10 +133,8 @@ class ErrorListener implements EventSubscriberInterface
/**
* Clones the request for the exception.
*
* @return Request The cloned request
*/
protected function duplicateRequest(\Exception $exception, Request $request)
protected function duplicateRequest(\Throwable $exception, Request $request): Request
{
$attributes = [
'_controller' => $this->controller,