Skip to content

Commit e3396ea

Browse files
committed
trigger some deprecations for legacy methods
1 parent 82b36e4 commit e3396ea

40 files changed

+80
-63
lines changed

UPGRADE-4.1.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
UPGRADE FROM 4.0 to 4.1
2+
=======================
3+
4+
Security
5+
--------
6+
7+
* The `ContextListener::setLogoutOnUserChange()` method is deprecated and will be removed in 5.0.
8+
9+
SecurityBundle
10+
--------------
11+
12+
* The `logout_on_user_change` firewall option is deprecated and will be removed in 5.0.
13+
14+
Translation
15+
-----------
16+
17+
* The `FileDumper::setBackup()` method is deprecated and will be removed in 5.0.
18+
* The `TranslationWriter::disableBackup()` method is deprecated and will be removed in 5.0.

UPGRADE-5.0.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
UPGRADE FROM 4.x to 5.0
2+
=======================
3+
4+
Security
5+
--------
6+
7+
* The `ContextListener::setLogoutOnUserChange()` method has been removed.
8+
9+
SecurityBundle
10+
--------------
11+
12+
* The `logout_on_user_change` firewall option has been removed.
13+
14+
Translation
15+
-----------
16+
17+
* The `FileDumper::setBackup()` method has been removed.
18+
* The `TranslationWriter::disableBackup()` method has been removed.

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
4.1.0
5+
-----
6+
7+
* The `logout_on_user_change` firewall option is deprecated and will be removed in 5.0.
8+
49
4.0.0
510
-----
611

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
200200
->booleanNode('logout_on_user_change')
201201
->defaultTrue()
202202
->info('When true, it will trigger a logout for the user if something has changed.')
203+
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1 and will be removed in 5.0.')
203204
->end()
204205
->arrayNode('logout')
205206
->treatTrueLike(array())
@@ -290,17 +291,6 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
290291
return $firewall;
291292
})
292293
->end()
293-
->validate()
294-
->ifTrue(function ($v) {
295-
return (isset($v['stateless']) && true === $v['stateless']) || (isset($v['security']) && false === $v['security']);
296-
})
297-
->then(function ($v) {
298-
// this option doesn't change behavior when true when stateless, so prevent deprecations
299-
$v['logout_on_user_change'] = true;
300-
301-
return $v;
302-
})
303-
->end()
304294
;
305295
}
306296

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,6 @@ private function createFirewalls($config, ContainerBuilder $container)
181181
$customUserChecker = true;
182182
}
183183

184-
$contextListenerDefinition->addMethodCall('setLogoutOnUserChange', array($firewall['logout_on_user_change']));
185-
186184
$configId = 'security.firewall.map.config.'.$name;
187185

188186
list($matcher, $listeners, $exceptionListener) = $this->createFirewall($container, $name, $firewall, $authenticationProviders, $providerIds, $configId);
@@ -410,7 +408,7 @@ private function createAuthenticationListeners($container, $id, $firewall, &$aut
410408
throw new InvalidConfigurationException(sprintf('Invalid firewall "%s": user provider "%s" not found.', $id, $firewall[$key]['provider']));
411409
}
412410
$userProvider = $providerIds[$normalizedName];
413-
} elseif($defaultProvider) {
411+
} elseif ($defaultProvider) {
414412
$userProvider = $defaultProvider;
415413
} else {
416414
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));

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/argon2i_encoder.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
'main' => array(
1414
'form_login' => false,
1515
'http_basic' => null,
16-
'logout_on_user_change' => true,
1716
),
1817
),
1918
));

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
'logout' => true,
7373
'remember_me' => array('secret' => 'TheSecret'),
7474
'user_checker' => null,
75-
'logout_on_user_change' => true,
7675
),
7776
'host' => array(
7877
'provider' => 'default',
@@ -81,14 +80,12 @@
8180
'methods' => array('GET', 'POST'),
8281
'anonymous' => true,
8382
'http_basic' => true,
84-
'logout_on_user_change' => true,
8583
),
8684
'with_user_checker' => array(
8785
'provider' => 'default',
8886
'user_checker' => 'app.user_checker',
8987
'anonymous' => true,
9088
'http_basic' => true,
91-
'logout_on_user_change' => true,
9289
),
9390
),
9491

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_provider.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,10 @@
1515
'main' => array(
1616
'provider' => 'default',
1717
'form_login' => true,
18-
'logout_on_user_change' => true,
1918
),
2019
'other' => array(
2120
'provider' => 'with-dash',
2221
'form_login' => true,
23-
'logout_on_user_change' => true,
2422
),
2523
),
2624
));

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/firewall_undefined_provider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
'main' => array(
1313
'provider' => 'undefined',
1414
'form_login' => true,
15-
'logout_on_user_change' => true,
1615
),
1716
),
1817
));

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/listener_provider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
'firewalls' => array(
1212
'main' => array(
1313
'form_login' => array('provider' => 'default'),
14-
'logout_on_user_change' => true,
1514
),
1615
),
1716
));

0 commit comments

Comments
 (0)