Skip to content

Commit 6719fcd

Browse files
committed
bug symfony#44460 [SecurityBundle] Fix ambiguous deprecation message on missing provider (chalasr)
This PR was merged into the 5.4 branch. Discussion ---------- [SecurityBundle] Fix ambiguous deprecation message on missing provider | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fixes symfony#44362 | License | MIT | Doc PR | - The current message is quite misleading as you cannot set the `provider` key under `custom_authenticators`, it needs to be set on the firewall. This PR fixes it. Commits ------- 05e78b3 [SecurityBundle] Fix ambiguous deprecation message on missing provider
2 parents 143ad6a + 05e78b3 commit 6719fcd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ private function getUserProvider(ContainerBuilder $container, string $id, array
704704

705705
if ('remember_me' === $factoryKey || 'anonymous' === $factoryKey || 'custom_authenticators' === $factoryKey) {
706706
if ('custom_authenticators' === $factoryKey) {
707-
trigger_deprecation('symfony/security-bundle', '5.4', 'Not configuring explicitly the provider for the "%s" listener on "%s" firewall is deprecated because it\'s ambiguous as there is more than one registered provider.', $factoryKey, $id);
707+
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);
708708
}
709709

710710
return 'security.user_providers';

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public function testFirewallWithNoUserProviderTriggerDeprecation()
397397
],
398398
]);
399399

400-
$this->expectDeprecation('Since symfony/security-bundle 5.4: Not configuring explicitly the provider for the "custom_authenticators" listener on "some_firewall" firewall is deprecated because it\'s ambiguous as there is more than one registered provider.');
400+
$this->expectDeprecation('Since symfony/security-bundle 5.4: Not configuring explicitly the provider for the "some_firewall" 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.');
401401

402402
$container->compile();
403403
}

0 commit comments

Comments
 (0)