diff --git a/UPGRADE-7.0.md b/UPGRADE-7.0.md index 7700814e6569..193094949282 100644 --- a/UPGRADE-7.0.md +++ b/UPGRADE-7.0.md @@ -5,8 +5,13 @@ Symfony 6.4 and Symfony 7.0 will be released simultaneously at the end of Novemb release process, both versions will have the same features, but Symfony 7.0 won't include any deprecated features. To upgrade, make sure to resolve all deprecation notices. +Security +-------- + + * Enabling SecurityBundle and not configuring it is not allowed + Serializer ---------- -* Remove denormalization support for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead -* Denormalizing to an abstract class in `UidNormalizer` now throws an `\Error` + * Remove denormalization support for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead + * Denormalizing to an abstract class in `UidNormalizer` now throws an `\Error` diff --git a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md index 99b9b94ea3db..02c014bbfb70 100644 --- a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +7.0 +--- + + * Enabling SecurityBundle and not configuring it is not allowed + 6.3 --- diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index 37978b285f3d..3c504b600106 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -54,6 +54,7 @@ use Symfony\Component\Security\Core\Authorization\Strategy\PriorityStrategy; use Symfony\Component\Security\Core\Authorization\Strategy\UnanimousStrategy; use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; +use Symfony\Component\Security\Core\Exception\InvalidArgumentException; use Symfony\Component\Security\Core\User\ChainUserChecker; use Symfony\Component\Security\Core\User\ChainUserProvider; use Symfony\Component\Security\Core\User\UserCheckerInterface; @@ -96,10 +97,7 @@ public function prepend(ContainerBuilder $container) public function load(array $configs, ContainerBuilder $container) { if (!array_filter($configs)) { - trigger_deprecation('symfony/security-bundle', '6.3', 'Enabling bundle "%s" and not configuring it is deprecated.', SecurityBundle::class); - // uncomment the following line in 7.0 - // throw new InvalidArgumentException(sprintf('Enabling bundle "%s" and not configuring it is not allowed.', SecurityBundle::class)); - return; + throw new InvalidArgumentException(sprintf('Enabling bundle "%s" and not configuring it is not allowed.', SecurityBundle::class)); } $mainConfig = $this->getConfiguration($configs, $container); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php index 4c8c16e6a324..170bce8169c6 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php @@ -30,6 +30,7 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Exception\AuthenticationException; +use Symfony\Component\Security\Core\Exception\InvalidArgumentException; use Symfony\Component\Security\Core\User\InMemoryUserChecker; use Symfony\Component\Security\Core\User\UserCheckerInterface; use Symfony\Component\Security\Core\User\UserInterface; @@ -871,16 +872,14 @@ public function testClearSiteDataLogoutListenerDisabled() $this->assertFalse($container->has('security.logout.listener.clear_site_data.'.$firewallId)); } - /** - * @group legacy - */ public function testNothingDoneWithEmptyConfiguration() { $container = $this->getRawContainer(); $container->loadFromExtension('security'); - $this->expectDeprecation('Since symfony/security-bundle 6.3: Enabling bundle "Symfony\Bundle\SecurityBundle\SecurityBundle" and not configuring it is deprecated.'); + $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Enabling bundle "Symfony\Bundle\SecurityBundle\SecurityBundle" and not configuring it is not allowed.'); $container->compile();