8000 [SecurityBundle] Remove deprecated code by dosten · Pull Request #15430 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[SecurityBundle] Remove deprecated code #15430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,6 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
->end()
->arrayNode('anonymous')
->canBeUnset()
->beforeNormalization()
->ifTrue(function ($v) { return isset($v['key']); })
->then(function ($v) {
if (isset($v['secret'])) {
throw new \LogicException('Cannot set both key and secret options for security.firewall.anonymous, use only secret instead.');
}

@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);

$v['secret'] = $v['key'];

unset($v['key&# 8000 39;]);
})
->end()
->children()
->scalarNode('secret')->defaultValue(uniqid('', true))->end()
->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,10 @@ public function getKey()

public function addConfiguration(NodeDefinition $node)
{
$node->fixXmlConfig('user_provider');
$builder = $node
->beforeNormalization()
->ifTrue(function ($v) { return isset($v['key']); })
->then(function ($v) {
if (isset($v['secret'])) {
throw new \LogicException('Cannot set both key and secret options for remember_me, use only secret instead.');
}

@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);

$v['secret'] = $v['key'];

unset($v['key']);
})
->end()
->children();
->fixXmlConfig('user_provider')
->children()
;

$builder
->scalarNode('secret')->isRequired()->cannotBeEmpty()->end()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@

namespace Symfony\Bundle\SecurityBundle\Templating\Helper;

use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Templating\Helper\Helper;

/**
Expand All @@ -29,26 +27,11 @@ class LogoutUrlHelper extends Helper
/**
* Constructor.
*
* @param ContainerInterface|LogoutUrlGenerator $generator A ContainerInterface or LogoutUrlGenerator instance
* @param UrlGeneratorInterface|null $router The router service
* @param TokenStorageInterface|null $tokenStorage The token storage service
*
* @deprecated Passing a ContainerInterface as a first argument is deprecated since 2.7 and will be removed in 3.0.
* @deprecated Passing a second and third argument is deprecated since 2.7 and will be removed in 3.0.
* @param LogoutUrlGenerator $generator A LogoutUrlGenerator instance
*/
public function __construct($generator, UrlGeneratorInterface $router = null, TokenStorageInterface $tokenStorage = null)
public function __construct(LogoutUrlGenerator $generator)
{
if ($generator instanceof ContainerInterface) {
@trigger_error('The '.__CLASS__.' constructor will require a LogoutUrlGenerator instead of a ContainerInterface instance in 3.0.', E_USER_DEPRECATED);

if ($generator->has('security.logout_url_generator')) {
$this->generator = $generator->get('security.logout_url_generator');
} else {
$this->generator = new LogoutUrlGenerator($generator->get('request_stack'), $router, $tokenStorage);
}
} else {
$this->generator = $generator;
}
$this->generator = $generator;
}

/**
Expand Down

This file was deleted.

0