@@ -97,8 +97,7 @@ The Listener
9797
9898Next, you need a listener to listen on the firewall. The listener
9999is 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.
102101A security listener should handle the
103102:class: `Symfony\\ Component\\ HttpKernel\\ Event\\ RequestEvent ` event, and
104103set an authenticated token in the token storage if successful::
@@ -112,9 +111,8 @@ set an authenticated token in the token storage if successful::
112111 use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
113112 use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
114113 use Symfony\Component\Security\Core\Exception\AuthenticationException;
115- use Symfony\Component\Security\Http\Firewall\ListenerInterface;
116114
117- class WsseListener implements ListenerInterface
115+ class WsseListener
118116 {
119117 protected $tokenStorage;
120118 protected $authenticationManager;
@@ -125,7 +123,7 @@ set an authenticated token in the token storage if successful::
125123 $this->authenticationManager = $authenticationManager;
126124 }
127125
128- public function handle (RequestEvent $event)
126+ public function __invoke (RequestEvent $event)
129127 {
130128 $request = $event->getRequest();
131129
0 commit comments