Skip to content

ListenerInterface deprecated since Symfony 4.3 #12781

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions security/custom_authentication_provider.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ The Listener

Next, you need a listener to listen on the firewall. The listener
is responsible for fielding requests to the firewall and calling the authentication
provider. A listener must be an instance of
:class:`Symfony\\Component\\Security\\Http\\Firewall\\ListenerInterface`.
provider. Listener is a callable, so you have to implement __invoke() method.
A security listener should handle the
:class:`Symfony\\Component\\HttpKernel\\Event\\RequestEvent` event, and
set an authenticated token in the token storage if successful::
Expand All @@ -112,9 +111,8 @@ set an authenticated token in the token storage if successful::
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\Firewall\ListenerInterface;

class WsseListener implements ListenerInterface
class WsseListener
{
protected $tokenStorage;
protected $authenticationManager;
Expand All @@ -125,7 +123,7 @@ set an authenticated token in the token storage if successful::
$this->authenticationManager = $authenticationManager;
}

public function handle(RequestEvent $event)
public function __invoke(RequestEvent $event)
{
$request = $event->getRequest();

Expand Down