diff --git a/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php b/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php index 09a4c93f25..9209a60db2 100644 --- a/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php +++ b/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php @@ -11,8 +11,6 @@ namespace Symfony\Bundle\TwigBundle\Extension; -trigger_error('The '.__NAMESPACE__.'\ActionsExtension class is deprecated since version 2.2 and will be removed in Symfony 3.0.', E_USER_DEPRECATED); - use Symfony\Bundle\TwigBundle\TokenParser\RenderTokenParser; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpKernel\Fragment\FragmentHandler; @@ -31,14 +29,14 @@ class ActionsExtension extends \Twig_Extension /** * @param FragmentHandler|ContainerInterface $handler * - * @deprecated Passing a ContainerInterface as a first argument is deprecated as of 2.7 and will be removed in 3.0. + * @deprecated Passing a ContainerInterface as a first argument is deprecated since 2.7 and will be removed in 3.0. */ public function __construct($handler) { if ($handler instanceof FragmentHandler) { $this->handler = $handler; } elseif ($handler instanceof ContainerInterface) { - trigger_error(sprintf('The ability to pass a ContainerInterface instance as a first argument to %s was deprecated in 2.7 and will be removed in 3.0. Please, pass a FragmentHandler instance instead.', __METHOD__), E_USER_DEPRECATED); + trigger_error('The ability to pass a ContainerInterface instance as a first argument to '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0. Pass a FragmentHandler instance instead.', E_USER_DEPRECATED); $this->handler = $handler->get('fragment.handler'); } else { diff --git a/src/Symfony/Bundle/TwigBundle/TwigEngine.php b/src/Symfony/Bundle/TwigBundle/TwigEngine.php index 4d41e388f3..9aeb630c47 100644 --- a/src/Symfony/Bundle/TwigBundle/TwigEngine.php +++ b/src/Symfony/Bundle/TwigBundle/TwigEngine.php @@ -42,23 +42,23 @@ class TwigEngine extends BaseEngine implements EngineInterface } /** - * @deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.7, to be removed in 3.0. * Inject the escaping strategy on \Twig_Environment instead. */ public function setDefaultEscapingStrategy($strategy) { - trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Inject the escaping strategy in the Twig_Environment object instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0. Inject the escaping strategy in the Twig_Environment object instead.', E_USER_DEPRECATED); $this->environment->getExtension('escaper')->setDefaultStrategy($strategy); } /** - * @deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.7, to be removed in 3.0. * Use TwigDefaultEscapingStrategy instead. */ public function guessDefaultEscapingStrategy($filename) { - trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Bundle\TwigBundle\TwigDefaultEscapingStrategy::guess method instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.7 and will be removed in 3.0. Use the Symfony\Bundle\TwigBundle\TwigDefaultEscapingStrategy::guess method instead.', E_USER_DEPRECATED); return TwigDefaultEscapingStrategy::guess($filename); } diff --git a/src/Symfony/Component/Form/Util/InheritDataAwareIterator.php b/src/Symfony/Component/Form/Util/InheritDataAwareIterator.php index 652c00b5a6..ba157b7d18 100644 --- a/src/Symfony/Component/Form/Util/InheritDataAwareIterator.php +++ b/src/Symfony/Component/Form/Util/InheritDataAwareIterator.php @@ -25,10 +25,4 @@ namespace Symfony\Component\Form\Util; */ class InheritDataAwareIterator extends VirtualFormAwareIterator { - public function __construct(\Traversable $iterator) - { - // Do not trigger deprecation notice in parent construct method - // when using this class instead of the deprecated parent one. - parent::__construct($iterator, false); - } } diff --git a/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php b/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php index dd893935bb..3e5965e596 100644 --- a/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php +++ b/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php @@ -25,15 +25,15 @@ namespace Symfony\Component\Form\Util; */ class VirtualFormAwareIterator extends \IteratorIterator implements \RecursiveIterator { - public function __construct(\Traversable $iterator, $triggerDeprecationNotice = true) + public function __construct(\Traversable $iterator) { - /** + /* * Prevent to trigger deprecation notice when already using the * InheritDataAwareIterator class that extends this deprecated one. * The {@link Symfony\Component\Form\Util\InheritDataAwareIterator::__construct} method * forces this argument to false. */ - if ($triggerDeprecationNotice) { + if (__CLASS__ === get_class($this)) { trigger_error('The '.__CLASS__.' class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Util\InheritDataAwareIterator class instead.', E_USER_DEPRECATED); } diff --git a/src/Symfony/Component/Validator/Context/ExecutionContext.php b/src/Symfony/Component/Validator/Context/ExecutionContext.php index 47528b0e15..0079d23272 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContext.php @@ -187,8 +187,6 @@ class ExecutionContext implements ExecutionContextInterface // API, as they are not present in the new interface anymore. // You should use buildViolation() instead. if (func_num_args() > 2) { - trigger_error('The parameters $invalidValue, $plural and $code in method '.__METHOD__.' are deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::buildViolation method instead.', E_USER_DEPRECATED); - throw new BadMethodCallException( 'The parameters $invalidValue, $plural and $code are '. 'not supported anymore as of Symfony 2.5. Please use '. @@ -288,11 +286,7 @@ class ExecutionContext implements ExecutionContextInterface */ public function getClassName() { - if ($this->metadata instanceof ClassBasedInterface) { - return $this->metadata->getClassName(); - } - - return null; + return $this->metadata instanceof ClassBasedInterface ? $this->metadata->getClassName() : null; } /** diff --git a/src/Symfony/Component/Validator/ExecutionContextInterface.php b/src/Symfony/Component/Validator/ExecutionContextInterface.php index 1d35580c4d..3fedfe15de 100644 --- a/src/Symfony/Component/Validator/ExecutionContextInterface.php +++ b/src/Symfony/Component/Validator/ExecutionContextInterface.php @@ -99,9 +99,7 @@ interface ExecutionContextInterface * * @api * - * @deprecated since version 2.5. - * The parameters $invalidValue, $plural and $code will be removed - * in 3.0. + * @deprecated the parameters $invalidValue, $plural and $code are deprecated since version 2.5 and will be removed in 3.0. */ public function addViolation($message, array $params = array(), $invalidValue = null, $plural = null, $code = null); diff --git a/src/Symfony/Component/Yaml/Yaml.php b/src/Symfony/Component/Yaml/Yaml.php index c9bb793403..c9295b094b 100644 --- a/src/Symfony/Component/Yaml/Yaml.php +++ b/src/Symfony/Component/Yaml/Yaml.php @@ -46,9 +46,7 @@ class Yaml * * @throws ParseException If the YAML is not valid * - * @deprecated since version 2.2, to be removed in 3.0. - * The ability to pass file names to the parse() method is - * deprecated. Pass the YAML contents of the file instead. + * @deprecated The ability to pass file names to the Yaml::parse method is deprecated since version 2.2 and will be removed in 3.0. Pass the YAML contents of the file instead. * * @api */