From e3396ea23111f422eabc5dad1a171ea67a5e3eeb Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Thu, 23 Nov 2017 11:49:18 +0100 Subject: [PATCH] trigger some deprecations for legacy methods --- UPGRADE-4.1.md | 18 ++++++++++++++++++ UPGRADE-5.0.md | 18 ++++++++++++++++++ src/Symfony/Bundle/SecurityBundle/CHANGELOG.md | 5 +++++ .../DependencyInjection/MainConfiguration.php | 12 +----------- .../DependencyInjection/SecurityExtension.php | 4 +--- .../Fixtures/php/argon2i_encoder.php | 1 - .../Fixtures/php/container1.php | 3 --- .../Fixtures/php/firewall_provider.php | 2 -- .../php/firewall_undefined_provider.php | 1 - .../Fixtures/php/listener_provider.php | 1 - .../php/listener_undefined_provider.php | 1 - .../DependencyInjection/Fixtures/php/merge.php | 1 - .../Fixtures/php/merge_import.php | 1 - .../Fixtures/php/remember_me_options.php | 1 - .../Fixtures/xml/argon2i_encoder.xml | 2 +- .../Fixtures/xml/container1.xml | 4 ++-- .../Fixtures/xml/firewall_provider.xml | 2 +- .../xml/firewall_undefined_provider.xml | 2 +- .../Fixtures/xml/listener_provider.xml | 2 +- .../xml/listener_undefined_provider.xml | 2 +- .../DependencyInjection/Fixtures/xml/merge.xml | 2 +- .../Fixtures/xml/merge_import.xml | 2 +- .../Fixtures/xml/remember_me_options.xml | 2 +- .../Fixtures/yml/argon2i_encoder.yml | 1 - .../Fixtures/yml/container1.yml | 2 -- .../Fixtures/yml/firewall_provider.yml | 2 -- .../yml/firewall_undefined_provider.yml | 1 - .../Fixtures/yml/listener_provider.yml | 1 - .../yml/listener_undefined_provider.yml | 1 - .../DependencyInjection/Fixtures/yml/merge.yml | 1 - .../Fixtures/yml/merge_import.yml | 1 - .../Fixtures/yml/remember_me_options.yml | 1 - .../MainConfigurationTest.php | 3 --- .../SecurityExtensionTest.php | 6 ------ src/Symfony/Component/Security/CHANGELOG.md | 5 +++++ .../Security/Http/Firewall/ContextListener.php | 8 +++++--- src/Symfony/Component/Translation/CHANGELOG.md | 6 ++++++ .../Translation/Dumper/FileDumper.php | 7 ++++--- .../Tests/Writer/TranslationWriterTest.php | 3 +++ .../Translation/Writer/TranslationWriter.php | 5 ++++- 40 files changed, 80 insertions(+), 63 deletions(-) create mode 100644 UPGRADE-4.1.md create mode 100644 UPGRADE-5.0.md diff --git a/UPGRADE-4.1.md b/UPGRADE-4.1.md new file mode 100644 index 0000000000..0f9131e33e --- /dev/null +++ b/UPGRADE-4.1.md @@ -0,0 +1,18 @@ +UPGRADE FROM 4.0 to 4.1 +======================= + +Security +-------- + + * The `ContextListener::setLogoutOnUserChange()` method is deprecated and will be removed in 5.0. + +SecurityBundle +-------------- + + * The `logout_on_user_change` firewall option is deprecated and will be removed in 5.0. + +Translation +----------- + + * The `FileDumper::setBackup()` method is deprecated and will be removed in 5.0. + * The `TranslationWriter::disableBackup()` method is deprecated and will be removed in 5.0. diff --git a/UPGRADE-5.0.md b/UPGRADE-5.0.md new file mode 100644 index 0000000000..337a5bac7e --- /dev/null +++ b/UPGRADE-5.0.md @@ -0,0 +1,18 @@ +UPGRADE FROM 4.x to 5.0 +======================= + +Security +-------- + + * The `ContextListener::setLogoutOnUserChange()` method has been removed. + +SecurityBundle +-------------- + + * The `logout_on_user_change` firewall option has been removed. + +Translation +----------- + + * The `FileDumper::setBackup()` method has been removed. + * The `TranslationWriter::disableBackup()` method has been removed. diff --git a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md index 1789357b85..15000095df 100644 --- a/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/SecurityBundle/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +4.1.0 +----- + + * The `logout_on_user_change` firewall option is deprecated and will be removed in 5.0. + 4.0.0 ----- diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php index 0ca7e7f4b7..9ad36201ef 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php @@ -200,6 +200,7 @@ class MainConfiguration implements ConfigurationInterface ->booleanNode('logout_on_user_change') ->defaultTrue() ->info('When true, it will trigger a logout for the user if something has changed.') + ->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1 and will be removed in 5.0.') ->end() ->arrayNode('logout') ->treatTrueLike(array()) @@ -290,17 +291,6 @@ class MainConfiguration implements ConfigurationInterface return $firewall; }) ->end() - ->validate() - ->ifTrue(function ($v) { - return (isset($v['stateless']) && true === $v['stateless']) || (isset($v['security']) && false === $v['security']); - }) - ->then(function ($v) { - // this option doesn't change behavior when true when stateless, so prevent deprecations - $v['logout_on_user_change'] = true; - - return $v; - }) - ->end() ; } diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index 8351c86112..f9c4c4ab7c 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -181,8 +181,6 @@ class SecurityExtension extends Extension $customUserChecker = true; } - $contextListenerDefinition->addMethodCall('setLogoutOnUserChange', array($firewall['logout_on_user_change'])); - $configId = 'security.firewall.map.config.'.$name; list($matcher, $listeners, $exceptionListener) = $this->createFirewall($container, $name, $firewall, $authenticationProviders, $providerIds, $configId); @@ -410,7 +408,7 @@ class SecurityExtension extends Extension throw new InvalidConfigurationException(sprintf('Invalid firewall "%s": user provider "%s" not found.', $id, $firewall[$key]['provider'])); } $userProvider = $providerIds[$normalizedName]; - } elseif($defaultProvider) { + } elseif ($defaultProvider) { $userProvider = $defaultProvider; } else { throw new InvalidConfigurationException(sprintf('Not configuring explicitly the provider for the "%s" listener on "%s" firewall is ambiguous as there is more than one registered provider.', $key, $id)); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php index 23ff1799c8..d315f88170 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php @@ -13,7 +13,6 @@ $container->loadFromExtension('security', array( 'main' => array( 'form_login' => false, 'http_basic' => null, - 'logout_on_user_change' => true, ), ), )); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php index 7290676a2b..d60bca39e4 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php @@ -72,7 +72,6 @@ $container->loadFromExtension('security', array( 'logout' => true, 'remember_me' => array('secret' => 'TheSecret'), 'user_checker' => null, - 'logout_on_user_change' => true, ), 'host' => array( 'provider' => 'default', @@ -81,14 +80,12 @@ $container->loadFromExtension('security', array( 'methods' => array('GET', 'POST'), 'anonymous' => true, 'http_basic' => true, - 'logout_on_user_change' => true, ), 'with_user_checker' => array( 'provider' => 'default', 'user_checker' => 'app.user_checker', 'anonymous' => true, 'http_basic' => true, - 'logout_on_user_change' => true, ), ), diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php index da218fc61c..ff9d9f6b89 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php @@ -15,12 +15,10 @@ $container->loadFromExtension('security', array( 'main' => array( 'provider' => 'default', 'form_login' => true, - 'logout_on_user_change' => true, ), 'other' => array( 'provider' => 'with-dash', 'form_login' => true, - 'logout_on_user_change' => true, ), ), )); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php index 46a51f91fd..78d461efe3 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php @@ -12,7 +12,6 @@ $container->loadFromExtension('security', array( 'main' => array( 'provider' => 'undefined', 'form_login' => true, - 'logout_on_user_change' => true, ), ), )); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php index 072b70b078..d7f1cd6973 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php @@ -11,7 +11,6 @@ $container->loadFromExtension('security', array( 'firewalls' => array( 'main' => array( 'form_login' => array('provider' => 'default'), - 'logout_on_user_change' => true, ), ), )); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_undefined_provider.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_undefined_provider.php index 567f8a0d4b..da54f025d1 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_undefined_provider.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_undefined_provider.php @@ -11,7 +11,6 @@ $container->loadFromExtension('security', array( 'firewalls' => array( 'main' => array( 'form_login' => array('provider' => 'undefined'), - 'logout_on_user_change' => true, ), ), )); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php index eb34a6a6f6..50ef504ea4 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge.php @@ -11,7 +11,6 @@ $container->loadFromExtension('security', array( 'main' => array( 'form_login' => false, 'http_basic' => null, - 'logout_on_user_change' => true, ), ), diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php index 6ed2d18a36..912b9127ef 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/merge_import.php @@ -6,7 +6,6 @@ $container->loadFromExtension('security', array( 'form_login' => array( 'login_path' => '/login', ), - 'logout_on_user_change' => true, ), ), 'role_hierarchy' => array( diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php index a61fde3dc7..e0ca4f6ded 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/remember_me_options.php @@ -13,7 +13,6 @@ $container->loadFromExtension('security', array( 'catch_exceptions' => false, 'token_provider' => 'token_provider_id', ), - 'logout_on_user_change' => true, ), ), )); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/argon2i_encoder.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/argon2i_encoder.xml index dda4d8ec88..d9ff22ab82 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/argon2i_encoder.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/argon2i_encoder.xml @@ -10,7 +10,7 @@ - + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml index 1f317ac2d2..ef76eef02d 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml @@ -57,12 +57,12 @@ - + - + app.user_checker diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/firewall_provider.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/firewall_provider.xml index 9d37164e8d..bd87fee4ab 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/firewall_provider.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/firewall_provider.xml @@ -11,7 +11,7 @@ - + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/firewall_undefined_provider.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/firewall_undefined_provider.xml index 6a05d48e53..f596ac5a62 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/firewall_undefined_provider.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/firewall_undefined_provider.xml @@ -11,7 +11,7 @@ - + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/listener_provider.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/listener_provider.xml index f53b91b00e..b1bcd8eae8 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/listener_provider.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/listener_provider.xml @@ -11,7 +11,7 @@ - + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/listener_undefined_provider.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/listener_undefined_provider.xml index 75271ad075..725e85a1d0 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/listener_undefined_provider.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/listener_undefined_provider.xml @@ -11,7 +11,7 @@ - + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge.xml index 42dc91c997..8a17f6db23 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge.xml @@ -12,7 +12,7 @@ - + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge_import.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge_import.xml index 051e2a40b3..81b8cffd68 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge_import.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/merge_import.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> - + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/remember_me_options.xml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/remember_me_options.xml index 583720ea1d..b6ade91a07 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/remember_me_options.xml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/remember_me_options.xml @@ -9,7 +9,7 @@ - + diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/argon2i_encoder.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/argon2i_encoder.yml index a51e766005..e88debf658 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/argon2i_encoder.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/argon2i_encoder.yml @@ -10,4 +10,3 @@ security: main: form_login: false http_basic: ~ - logout_on_user_change: true diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml index ad90e433be..9336c13343 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml @@ -64,14 +64,12 @@ security: methods: [GET,POST] anonymous: true http_basic: true - logout_on_user_change: true with_user_checker: provider: default anonymous: ~ http_basic: ~ user_checker: app.user_checker - logout_on_user_change: true role_hierarchy: ROLE_ADMIN: ROLE_USER diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/firewall_provider.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/firewall_provider.yml index b8da52b6e4..11c329aa8e 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/firewall_provider.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/firewall_provider.yml @@ -11,8 +11,6 @@ security: main: provider: default form_login: true - logout_on_user_change: true other: provider: with-dash form_login: true - logout_on_user_change: true diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/firewall_undefined_provider.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/firewall_undefined_provider.yml index 3385fc3485..ec26640540 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/firewall_undefined_provider.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/firewall_undefined_provider.yml @@ -8,4 +8,3 @@ security: main: provider: undefined form_login: true - logout_on_user_change: true diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_provider.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_provider.yml index 53e2784c4b..652f23b5f0 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_provider.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_provider.yml @@ -8,4 +8,3 @@ security: main: form_login: provider: default - logout_on_user_change: true diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_undefined_provider.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_undefined_provider.yml index ba5f69ede6..1916df4c2e 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_undefined_provider.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/listener_undefined_provider.yml @@ -8,4 +8,3 @@ security: main: form_login: provider: undefined - logout_on_user_change: true diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge.yml index d8f443c62f..60c0bbea55 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge.yml @@ -9,7 +9,6 @@ security: main: form_login: false http_basic: ~ - logout_on_user_change: true role_hierarchy: FOO: [MOO] diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge_import.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge_import.yml index a081003a49..4f8db0a09f 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge_import.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/merge_import.yml @@ -3,7 +3,6 @@ security: main: form_login: login_path: /login - logout_on_user_change: true role_hierarchy: FOO: BAR diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/remember_me_options.yml b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/remember_me_options.yml index 716cd4cf99..a521c8c6a8 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/remember_me_options.yml +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/remember_me_options.yml @@ -10,4 +10,3 @@ security: secret: TheSecret catch_exceptions: false token_provider: token_provider_id - logout_on_user_change: true diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php index c3904dc2ba..6ecfba2922 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php @@ -29,7 +29,6 @@ class MainConfigurationTest extends TestCase ), 'firewalls' => array( 'stub' => array(), - 'logout_on_user_change' => true, ), ); @@ -77,7 +76,6 @@ class MainConfigurationTest extends TestCase 'csrf_token_generator' => 'a_token_generator', 'csrf_token_id' => 'a_token_id', ), - 'logout_on_user_change' => true, ), ), ); @@ -107,7 +105,6 @@ class MainConfigurationTest extends TestCase 'firewalls' => array( 'stub' => array( 'user_checker' => 'app.henk_checker', - 'logout_on_user_change' => true, ), ), ); diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php index 6a6b512529..7f8eae4f21 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php @@ -38,7 +38,6 @@ class SecurityExtensionTest extends TestCase 'form_login' => array( 'check_path' => '/some_area/login_check', ), - 'logout_on_user_change' => true, ), ), )); @@ -62,7 +61,6 @@ class SecurityExtensionTest extends TestCase 'firewalls' => array( 'some_firewall' => array( 'pattern' => '/.*', - 'logout_on_user_change' => true, ), ), )); @@ -90,7 +88,6 @@ class SecurityExtensionTest extends TestCase 'some_firewall' => array( 'pattern' => '/.*', 'http_basic' => array(), - 'logout_on_user_change' => true, ), ), )); @@ -113,7 +110,6 @@ class SecurityExtensionTest extends TestCase 'some_firewall' => array( 'pattern' => '/.*', 'http_basic' => null, - 'logout_on_user_change' => true, ), ), )); @@ -137,7 +133,6 @@ class SecurityExtensionTest extends TestCase 'stateless' => true, 'http_basic' => null, 'switch_user' => array('stateless' => false), - 'logout_on_user_change' => true, ), ), )); @@ -159,7 +154,6 @@ class SecurityExtensionTest extends TestCase 'firewalls' => array( 'default' => array( 'http_basic' => array('provider' => 'second'), - 'logout_on_user_change' => true, ), ), )); diff --git a/src/Symfony/Component/Security/CHANGELOG.md b/src/Symfony/Component/Security/CHANGELOG.md index 945e3cb326..2fc862f6e0 100644 --- a/src/Symfony/Component/Security/CHANGELOG.md +++ b/src/Symfony/Component/Security/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +4.1.0 +----- + + * The `ContextListener::setLogoutOnUserChange()` method is deprecated and will be removed in 5.0. + 4.0.0 ----- diff --git a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php index 67ce5cefaa..b1673adeb4 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -46,8 +46,8 @@ class ContextListener implements ListenerInterface private $logoutOnUserChange = true; /** - * @param TokenStorageInterface $tokenStorage - * @param iterable|UserProviderInterface[] $userProviders + * @param TokenStorageInterface $tokenStorage + * @param iterable|UserProviderInterface[] $userProviders */ public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null) { @@ -67,10 +67,12 @@ class ContextListener implements ListenerInterface * Enables deauthentication during refreshUser when the user has changed. * * @param bool $logoutOnUserChange + * + * @deprecated since version 4.1, to be removed in 5.0 */ public function setLogoutOnUserChange($logoutOnUserChange) { - // no-op, method to be deprecated in 4.1 + @trigger_error(sprintf('The %s() method is deprecated since 4.1 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED); } /** diff --git a/src/Symfony/Component/Translation/CHANGELOG.md b/src/Symfony/Component/Translation/CHANGELOG.md index ff6ce7a378..daab7fd3fc 100644 --- a/src/Symfony/Component/Translation/CHANGELOG.md +++ b/src/Symfony/Component/Translation/CHANGELOG.md @@ -1,6 +1,12 @@ CHANGELOG ========= +4.1.0 +----- + + * The `FileDumper::setBackup()` method is deprecated and will be removed in 5.0. + * The `TranslationWriter::disableBackup()` method is deprecated and will be removed in 5.0. + 4.0.0 ----- diff --git a/src/Symfony/Component/Translation/Dumper/FileDumper.php b/src/Symfony/Component/Translation/Dumper/FileDumper.php index 2e047ed7c0..a1902d7e22 100644 --- a/src/Symfony/Component/Translation/Dumper/FileDumper.php +++ b/src/Symfony/Component/Translation/Dumper/FileDumper.php @@ -46,15 +46,16 @@ abstract class FileDumper implements DumperInterface * Sets backup flag. * * @param bool + * + * @deprecated since version 4.1, to be removed in 5.0 */ public function setBackup($backup) { + @trigger_error(sprintf('The %s() method is deprecated since 4.1 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED); + if (false !== $backup) { throw new \LogicException('The backup feature is no longer supported.'); } - - // the method is only present to not break BC - // to be deprecated in 4.1 } /** diff --git a/src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php b/src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php index c7a7668f87..ab66af13e7 100644 --- a/src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php +++ b/src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php @@ -30,6 +30,9 @@ class TranslationWriterTest extends TestCase $writer->write(new MessageCatalogue('en'), 'test'); } + /** + * @group legacy + */ public function testDisableBackup() { $nonBackupDumper = new NonBackupDumper(); diff --git a/src/Symfony/Component/Translation/Writer/TranslationWriter.php b/src/Symfony/Component/Translation/Writer/TranslationWriter.php index 56d99cc772..0a9d475136 100644 --- a/src/Symfony/Component/Translation/Writer/TranslationWriter.php +++ b/src/Symfony/Component/Translation/Writer/TranslationWriter.php @@ -38,10 +38,13 @@ class TranslationWriter implements TranslationWriterInterface /** * Disables dumper backup. + * + * @deprecated since version 4.1, to be removed in 5.0 */ public function disableBackup() { - // to be deprecated in 4.1 + @trigger_error(sprintf('The %s() method is deprecated since 4.1 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED); + foreach ($this->dumpers as $dumper) { if (method_exists($dumper, 'setBackup')) { $dumper->setBackup(false);