From f86e8d4a7de30059d7659d60050a736b2bc301cb Mon Sep 17 00:00:00 2001 From: matlec Date: Sun, 1 Jun 2025 15:12:01 +0200 Subject: [PATCH 1/2] [SecurityBundle] Remove `AnonymousFactory` leftovers --- DependencyInjection/SecurityExtension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/SecurityExtension.php b/DependencyInjection/SecurityExtension.php index 383f68d2..d75a1d8f 100644 --- a/DependencyInjection/SecurityExtension.php +++ b/DependencyInjection/SecurityExtension.php @@ -334,7 +334,7 @@ private function createFirewalls(array $config, ContainerBuilder $container): vo $authenticators[$name] = ServiceLocatorTagPass::register($container, $firewallAuthenticatorRefs); } $contextId = 'security.firewall.map.context.'.$name; - $isLazy = !$firewall['stateless'] && (!empty($firewall['anonymous']['lazy']) || $firewall['lazy']); + $isLazy = !$firewall['stateless'] && $firewall['lazy']; $context = new ChildDefinition($isLazy ? 'security.firewall.lazy_context' : 'security.firewall.context'); $context = $container->setDefinition($contextId, $context); $context @@ -685,7 +685,7 @@ private function getUserProvider(ContainerBuilder $container, string $id, array return $this->createMissingUserProvider($container, $id, $factoryKey); } - if ('remember_me' === $factoryKey || 'anonymous' === $factoryKey || 'custom_authenticators' === $factoryKey) { + if ('remember_me' === $factoryKey || 'custom_authenticators' === $factoryKey) { if ('custom_authenticators' === $factoryKey) { trigger_deprecation('symfony/security-bundle', '5.4', 'Not configuring explicitly the provider for the "%s" firewall is deprecated because it\'s ambiguous as there is more than one registered provider. Set the "provider" key to one of the configured providers, even if your custom authenticators don\'t use it.', $id); } From 3db1460f539b23e74a119981ea6b3002302250bc Mon Sep 17 00:00:00 2001 From: MatTheCat Date: Mon, 23 Jun 2025 22:18:57 +0200 Subject: [PATCH 2/2] [Security] Document `FirewallListenerInterface` as a firewall listener type --- Security/FirewallContext.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Security/FirewallContext.php b/Security/FirewallContext.php index a9bd4ccd..ee56b6df 100644 --- a/Security/FirewallContext.php +++ b/Security/FirewallContext.php @@ -12,6 +12,7 @@ namespace Symfony\Bundle\SecurityBundle\Security; use Symfony\Component\Security\Http\Firewall\ExceptionListener; +use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface; use Symfony\Component\Security\Http\Firewall\LogoutListener; /** @@ -28,7 +29,7 @@ class FirewallContext private ?FirewallConfig $config; /** - * @param iterable $listeners + * @param iterable $listeners */ public function __construct(iterable $listeners, ?ExceptionListener $exceptionListener = null, ?LogoutListener $logoutListener = null, ?FirewallConfig $config = null) { @@ -47,7 +48,7 @@ public function getConfig() } /** - * @return iterable + * @return iterable */ public function getListeners(): iterable {