Skip to content

Commit 3dd1fc7

Browse files
committed
Use RequestEvent instead of deprecated GetResponseEvent
1 parent b2baa2c commit 3dd1fc7

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

components/http_kernel.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ each event has their own event object:
605605
=========================== ====================================== ===================================================================================
606606
Name ``KernelEvents`` Constant Argument passed to the listener
607607
=========================== ====================================== ===================================================================================
608-
kernel.request ``KernelEvents::REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent`
608+
kernel.request ``KernelEvents::REQUEST`` :class:`Symfony\\Component\\HttpKernel\\Event\\RequestEvent`
609609
kernel.controller ``KernelEvents::CONTROLLER`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterControllerEvent`
610610
kernel.controller_arguments ``KernelEvents::CONTROLLER_ARGUMENTS`` :class:`Symfony\\Component\\HttpKernel\\Event\\FilterControllerArgumentsEvent`
611611
kernel.view ``KernelEvents::VIEW`` :class:`Symfony\\Component\\HttpKernel\\Event\\ViewEvent`
@@ -709,10 +709,10 @@ can be used to check if the current request is a "master" or "sub" request.
709709
For example, a listener that only needs to act on the master request may
710710
look like this::
711711

712-
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
712+
use Symfony\Component\HttpKernel\Event\RequestEvent;
713713
// ...
714714

715-
public function onKernelRequest(GetResponseEvent $event)
715+
public function onKernelRequest(RequestEvent $event)
716716
{
717717
if (!$event->isMasterRequest()) {
718718
return;

components/security/authentication.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ an *authenticated* token if the supplied credentials were found to be valid.
1313
The listener should then store the authenticated token using
1414
:class:`the token storage <Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface>`::
1515

16-
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
16+
use Symfony\Component\HttpKernel\Event\RequestEvent;
1717
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
1818
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1919
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
@@ -38,7 +38,7 @@ The listener should then store the authenticated token using
3838

3939
// ...
4040

41-
public function handle(GetResponseEvent $event)
41+
public function handle(RequestEvent $event)
4242
{
4343
$request = $event->getRequest();
4444

reference/events.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ following information:
2828
``kernel.request``
2929
~~~~~~~~~~~~~~~~~~
3030

31-
**Event Class**: :class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent`
31+
**Event Class**: :class:`Symfony\\Component\\HttpKernel\\Event\\RequestEvent`
3232

3333
This event is dispatched very early in Symfony, before the controller is
3434
determined. It's useful to add information to the Request or return a Response

security/custom_authentication_provider.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ is responsible for fielding requests to the firewall and calling the authenticat
100100
provider. A listener must be an instance of
101101
:class:`Symfony\\Component\\Security\\Http\\Firewall\\ListenerInterface`.
102102
A security listener should handle the
103-
:class:`Symfony\\Component\\HttpKernel\\Event\\GetResponseEvent` event, and
103+
:class:`Symfony\\Component\\HttpKernel\\Event\\RequestEvent` event, and
104104
set an authenticated token in the token storage if successful::
105105

106106
// src/Security/Firewall/WsseListener.php
107107
namespace App\Security\Firewall;
108108

109109
use App\Security\Authentication\Token\WsseUserToken;
110110
use Symfony\Component\HttpFoundation\Response;
111-
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
111+
use Symfony\Component\HttpKernel\Event\RequestEvent;
112112
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
113113
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
114114
use Symfony\Component\Security\Core\Exception\AuthenticationException;
@@ -125,7 +125,7 @@ set an authenticated token in the token storage if successful::
125125
$this->authenticationManager = $authenticationManager;
126126
}
127127

128-
public function handle(GetResponseEvent $event)
128+
public function handle(RequestEvent $event)
129129
{
130130
$request = $event->getRequest();
131131

translation/locale.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To set the user's locale, you may want to create a custom event listener so
1818
that it's set before any other parts of the system (i.e. the translator) need
1919
it::
2020

21-
public function onKernelRequest(GetResponseEvent $event)
21+
public function onKernelRequest(RequestEvent $event)
2222
{
2323
$request = $event->getRequest();
2424

0 commit comments

Comments
 (0)