@@ -97,8 +97,7 @@ The Listener
97
97
98
98
Next, you need a listener to listen on the firewall. The listener
99
99
is responsible for fielding requests to the firewall and calling the authentication
100
- provider. A listener must be an instance of
101
- :class: `Symfony\\ Component\\ Security\\ Http\\ Firewall\\ ListenerInterface `.
100
+ provider. Listener is a callable, so you have to implement __invoke() method.
102
101
A security listener should handle the
103
102
:class: `Symfony\\ Component\\ HttpKernel\\ Event\\ RequestEvent ` event, and
104
103
set an authenticated token in the token storage if successful::
@@ -112,9 +111,8 @@ set an authenticated token in the token storage if successful::
112
111
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
113
112
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
114
113
use Symfony\Component\Security\Core\Exception\AuthenticationException;
115
- use Symfony\Component\Security\Http\Firewall\ListenerInterface;
116
114
117
- class WsseListener implements ListenerInterface
115
+ class WsseListener
118
116
{
119
117
protected $tokenStorage;
120
118
protected $authenticationManager;
@@ -125,7 +123,7 @@ set an authenticated token in the token storage if successful::
125
123
$this->authenticationManager = $authenticationManager;
126
124
}
127
125
128
- public function handle (RequestEvent $event)
126
+ public function __invoke (RequestEvent $event)
129
127
{
130
128
$request = $event->getRequest();
131
129
0 commit comments