10000 feature #15430 [SecurityBundle] Remove deprecated code (dosten) · symfony/symfony@e6d7534 · GitHub
[go: up one dir, main page]

Skip to content

Commit e6d7534

Browse files
committed
feature #15430 [SecurityBundle] Remove deprecated code (dosten)
This PR was merged into the 3.0-dev branch. Discussion ---------- [SecurityBundle] Remove deprecated cod 8000 e | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | yes | Deprecations? | no | Tests pass? | yes | License | MIT Commits ------- 7c4f921 Remove deprecated code
2 parents 9fea451 + 7c4f921 commit e6d7534

File tree

4 files changed

+6
-126
lines changed

4 files changed

+6
-126
lines changed

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -286,20 +286,6 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
286286
->end()
287287
->arrayNode('anonymous')
288288
->canBeUnset()
289-
->beforeNormalization()
290-
->ifTrue(function ($v) { return isset($v['key']); })
291-
->then(function ($v) {
292-
if (isset($v['secret'])) {
293-
throw new \LogicException('Cannot set both key and secret options for security.firewall.anonymous, use only secret instead.');
294-
}
295-
296-
@trigger_error('security.firewall.anonymous.key is deprecated since version 2.8 and will be removed in 3.0. Use security.firewall.anonymous.secret instead.', E_USER_DEPRECATED);
297-
298-
$v['secret'] = $v['key'];
299-
300-
unset($v['key']);
301-
})
302-
->end()
303289
->children()
304290
->scalarNode('secret')->defaultValue(uniqid('', true))->end()
305291
->end()

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,10 @@ public function getKey()
119119

120120
public function addConfiguration(NodeDefinition $node)
121121
{
122-
$node->fixXmlConfig('user_provider');
123122
$builder = $node
124-
->beforeNormalization()
125-
->ifTrue(function ($v) { return isset($v['key']); })
126-
->then(function ($v) {
127-
if (isset($v['secret'])) {
128-
throw new \LogicException('Cannot set both key and secret options for remember_me, use only secret instead.');
129-
}
130-
131-
@trigger_error('remember_me.key is deprecated since version 2.8 and will be removed in 3.0. Use remember_me.secret instead.', E_USER_DEPRECATED);
132-
133-
$v['secret'] = $v['key'];
134-
135-
unset($v['key']);
136-
})
137-
->end()
138-
->children();
123+
->fixXmlConfig('user_provider')
124+
->children()
125+
;
139126

140127
$builder
141128
->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()

src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111

1212
namespace Symfony\Bundle\SecurityBundle\Templating\Helper;
1313

14-
use Symfony\Component\DependencyInjection\ContainerInterface;
1514
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1615
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
17-
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
1816
use Symfony\Component\Templating\Helper\Helper;
1917

2018
/**
@@ -29,26 +27,11 @@ class LogoutUrlHelper extends Helper
2927
/**
3028
* Constructor.
3129
*
32-
* @param ContainerInterface|LogoutUrlGenerator $generator A ContainerInterface or LogoutUrlGenerator instance
33-
* @param UrlGeneratorInterface|null $router The router service
34-
* @param TokenStorageInterface|null $tokenStorage The token storage service
35-
*
36-
* @deprecated Passing a ContainerInterface as a first argument is deprecated since 2.7 and will be removed in 3.0.
37-
* @deprecated Passing a second and third argument is deprecated since 2.7 and will be removed in 3.0.
30+
* @param LogoutUrlGenerator $generator A LogoutUrlGenerator instance
3831
*/
39-
public function __construct($generator, UrlGeneratorInterface $router = null, TokenStorageInterface $tokenStorage = null)
32+
public function __construct(LogoutUrlGenerator $generator)
4033
{
41-
if ($generator instanceof ContainerInterface) {
42-
@trigger_error('The '.__CLASS__.' constructor will require a LogoutUrlGenerator instead of a ContainerInterface instance in 3.0.', E_USER_DEPRECATED);
43-
44-
if ($generator->has('security.logout_url_generator')) {
45-
$this->generator = $generator->get('security.logout_url_generator');
46-
} else {
47-
$this->generator = new LogoutUrlGenerator($generator->get('request_stack'), $router, $tokenStorage);
48-
}
49-
} else {
50-
$this->generator = $generator;
51-
}
34+
$this->generator = $generator;
5235
}
5336

5437
/**

src/Symfony/Bundle/SecurityBundle/Twig/Extension/LogoutUrlExtension.php

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0