diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php index 7b6ac4186a..aa46d47df5 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php @@ -286,20 +286,6 @@ class MainConfiguration implements ConfigurationInterface ->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() diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php index d8321f5245..1746a21f3a 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php @@ -119,23 +119,10 @@ class RememberMeFactory implements SecurityFactoryInterface 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() diff --git a/src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php b/src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php index 6819c37609..abb6de31a3 100644 --- a/src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php +++ b/src/Symfony/Bundle/SecurityBundle/Templating/Helper/LogoutUrlHelper.php @@ -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; /** @@ -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; } /** diff --git a/src/Symfony/Bundle/SecurityBundle/Twig/Extension/LogoutUrlExtension.php b/src/Symfony/Bundle/SecurityBundle/Twig/Extension/LogoutUrlExtension.php deleted file mode 100644 index d1eae0ef20..0000000000 --- a/src/Symfony/Bundle/SecurityBundle/Twig/Extension/LogoutUrlExtension.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Bundle\SecurityBundle\Twig\Extension; - -@trigger_error('The '.__NAMESPACE__.'\LogoutUrlExtension class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Bridge\Twig\Extension\LogoutUrlExtension instead.', E_USER_DEPRECATED); - -use Symfony\Bundle\SecurityBundle\Templating\Helper\LogoutUrlHelper; - -/** - * LogoutUrlHelper provides generator functions for the logout URL to Twig. - * - * @author Jeremy Mikola - * - * @deprecated since version 2.7, to be removed in 3.0. Use Symfony\Bridge\Twig\Extension\LogoutUrlExtension instead. - */ -class LogoutUrlExtension extends \Twig_Extension -{ - private $helper; - - public function __construct(LogoutUrlHelper $helper) - { - $this->helper = $helper; - } - - /** - * {@inheritdoc} - */ - public function getFunctions() - { - return array( - new \Twig_SimpleFunction('logout_url', array($this, 'getLogoutUrl')), - new \Twig_SimpleFunction('logout_path', array($this, 'getLogoutPath')), - ); - } - - /** - * Generates the relative logout URL for the firewall. - * - * @param string|null $key The firewall key or null to use the current firewall key - * - * @return string The relative logout URL - */ - public function getLogoutPath($key = null) - { - return $this->helper->getLogoutPath($key); - } - - /** - * Generates the absolute logout URL for the firewall. - * - * @param string|null $key The firewall key or null to use the current firewall key - * - * @return string The absolute logout URL - */ - public function getLogoutUrl($key = null) - { - return $this->helper->getLogoutUrl($key); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'logout_url'; - } -}