Skip to content

Commit

Permalink
Remove deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
dosten committed Aug 5, 2015
1 parent 9fea451 commit 7c4f921
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 126 deletions.
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']);
})
->end()
->children()
->scalarNode('secret')->defaultValue(uniqid('', true))->end()
->end()
Expand Down
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
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 comments on commit 7c4f921

Please sign in to comment.