Skip to content

Commit 89499a7

Browse files
committed
[Security] Move AbstractListener abstract methods to the new FirewallListenerInterface
1 parent 0df5616 commit 89499a7

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

Authentication/AuthenticatorManagerInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use Symfony\Component\HttpFoundation\Request;
1515
use Symfony\Component\HttpFoundation\Response;
16-
use Symfony\Component\Security\Http\Firewall\AbstractListener;
16+
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
1717

1818
/**
1919
* @author Wouter de Jong <[email protected]>
@@ -26,7 +26,7 @@ interface AuthenticatorManagerInterface
2626
/**
2727
* Called to see if authentication should be attempted on this request.
2828
*
29-
* @see AbstractListener::supports()
29+
* @see FirewallListenerInterface::supports()
3030
*/
3131
public function supports(Request $request): ?bool;
3232

Firewall/AbstractListener.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Security\Http\Firewall;
1313

14-
use Symfony\Component\HttpFoundation\Request;
1514
use Symfony\Component\HttpKernel\Event\RequestEvent;
1615

1716
/**
@@ -28,18 +27,6 @@ final public function __invoke(RequestEvent $event)
2827
}
2928
}
3029

31-
/**
32-
* Tells whether the authenticate() method should be called or not depending on the incoming request.
33-
*
34-
* Returning null means authenticate() can be called lazily when accessing the token storage.
35-
*/
36-
abstract public function supports(Request $request): ?bool;
37-
38-
/**
39-
* Does whatever is required to authenticate the request, typically calling $event->setResponse() internally.
40-
*/
41-
abstract public function authenticate(RequestEvent $event);
42-
4330
public static function getPriority(): int
4431
{
4532
return 0; // Default

Firewall/FirewallListenerInterface.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,30 @@
1111

1212
namespace Symfony\Component\Security\Http\Firewall;
1313

14+
use Symfony\Component\HttpFoundation\Request;
15+
use Symfony\Component\HttpKernel\Event\RequestEvent;
16+
1417
/**
15-
* Can be implemented by firewall listeners to define their priority in execution.
18+
* Can be implemented by firewall listeners.
1619
*
1720
* @author Christian Scheb <[email protected]>
21+
* @author Nicolas Grekas <[email protected]>
22+
* @author Robin Chalas <[email protected]>
1823
*/
1924
interface FirewallListenerInterface
2025
{
26+
/**
27+
* Tells whether the authenticate() method should be called or not depending on the incoming request.
28+
*
29+
* Returning null means authenticate() can be called lazily when accessing the token storage.
30+
*/
31+
public function supports(Request $request): ?bool;
32+
33+
/**
34+
* Does whatever is required to authenticate the request, typically calling $event->setResponse() internally.
35+
*/
36+
public function authenticate(RequestEvent $event);
37+
2138
/**
2239
* Defines the priority of the listener.
2340
* The higher the number, the earlier a listener is executed.

0 commit comments

Comments
 (0)