Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 600c817

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

File tree

8 files changed

+63
-7
lines changed

8 files changed

+63
-7
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/Component/Security/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 `ContextListener::setLogoutOnUserChange()` method is deprecated and will be removed in 5.0
8+
49
4.0.0
510
-----
611

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ class ContextListener implements ListenerInterface
4646
private $logoutOnUserChange = true;
4747

4848
/**
49-
* @param TokenStorageInterface $tokenStorage
50-
* @param iterable|UserProviderInterface[] $userProviders
49+
* @param TokenStorageInterface $tokenStorage
50+
* @param iterable|UserProviderInterface[] $userProviders
5151
*/
5252
public function __construct(TokenStorageInterface $tokenStorage, iterable $userProviders, string $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, AuthenticationTrustResolverInterface $trustResolver = null)
5353
{
@@ -67,10 +67,12 @@ public function __construct(TokenStorageInterface $tokenStorage, iterable $userP
6767
* Enables deauthentication during refreshUser when the user has changed.
6868
*
6969
* @param bool $logoutOnUserChange
70+
*
71+
* @deprecated since version 4.1, to be removed in 5.0
7072
*/
7173
public function setLogoutOnUserChange($logoutOnUserChange)
7274
{
73-
// no-op, method to be deprecated in 4.1
75+
@trigger_error(sprintf('The %s() method is deprecated since 4.1 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED);
7476
}
7577

7678
/**

src/Symfony/Component/Translation/CHANGELOG.md

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

4+
4.1.0
5+
-----
6+
7+
* the `FileDumper::setBackup()` method is deprecated and will be removed in 5.0
8+
* the `TranslationWriter::disableBackup()` method is deprecated and will be removed in 5.0
9+
410
4.0.0
511
-----
612

src/Symfony/Component/Translation/Dumper/FileDumper.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,16 @@ public function setRelativePathTemplate($relativePathTemplate)
4646
* Sets backup flag.
4747
*
4848
* @param bool
49+
*
50+
* @deprecated since version 4.1, to be removed in 5.0
4951
*/
5052
public function setBackup($backup)
5153
{
54+
@trigger_error(sprintf('The %s() method is deprecated since 4.1 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED);
55+
5256
if (false !== $backup) {
5357
throw new \LogicException('The backup feature is no longer supported.');
5458
}
55-
56-
// the method is only present to not break BC
57-
// to be deprecated in 4.1
5859
}
5960

6061
/**

src/Symfony/Component/Translation/Tests/Writer/TranslationWriterTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public function testWrite()
3030
$writer->write(new MessageCatalogue('en'), 'test');
3131
}
3232

33+
/**
34+
* @group legacy
35+
*/
3336
public function testDisableBackup()
3437
{
3538
$nonBackupDumper = new NonBackupDumper();

src/Symfony/Component/Translation/Writer/TranslationWriter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,13 @@ public function addDumper($format, DumperInterface $dumper)
3838

3939
/**
4040
* Disables dumper backup.
41+
*
42+
* @deprecated since version 4.1, to be removed in 5.0
4143
*/
4244
public function disableBackup()
4345
{
44-
// to be deprecated in 4.1
46+
@trigger_error(sprintf('The %s() method is deprecated since 4.1 and will be removed in 5.0.', __METHOD__), E_USER_DEPRECATED);
47+
4548
foreach ($this->dumpers as $dumper) {
4649
if (method_exists($dumper, 'setBackup')) {
4750
$dumper->setBackup(false);

0 commit comments

Comments
 (0)