diff --git a/src/Symfony/Bridge/Monolog/Logger.php b/src/Symfony/Bridge/Monolog/Logger.php index 260b266fe3..264835d88a 100644 --- a/src/Symfony/Bridge/Monolog/Logger.php +++ b/src/Symfony/Bridge/Monolog/Logger.php @@ -27,7 +27,7 @@ class Logger extends BaseLogger implements LoggerInterface, DebugLoggerInterface */ public function emerg($message, array $context = array()) { - trigger_error('The '.__METHOD__.' method of the Monolog Logger was removed. Use the emergency() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the emergency() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); return parent::addRecord(BaseLogger::EMERGENCY, $message, $context); } @@ -37,7 +37,7 @@ class Logger extends BaseLogger implements LoggerInterface, DebugLoggerInterface */ public function crit($message, array $context = array()) { - trigger_error('The '.__METHOD__.' method of the Monolog Logger was removed. Use the method critical() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the method critical() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); return parent::addRecord(BaseLogger::CRITICAL, $message, $context); } @@ -47,7 +47,7 @@ class Logger extends BaseLogger implements LoggerInterface, DebugLoggerInterface */ public function err($message, array $context = array()) { - trigger_error('The '.__METHOD__.' method of the Monolog Logger was removed. Use the error() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the error() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); return parent::addRecord(BaseLogger::ERROR, $message, $context); } @@ -57,7 +57,7 @@ class Logger extends BaseLogger implements LoggerInterface, DebugLoggerInterface */ public function warn($message, array $context = array()) { - trigger_error('The '.__METHOD__.' method of the Monolog Logger was removed. Use the warning() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method inherited from the Symfony\Component\HttpKernel\Log\LoggerInterface interface is deprecated since version 2.2 and will be removed in 3.0. Use the warning() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); return parent::addRecord(BaseLogger::WARNING, $message, $context); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php index 4e4ccf68c7..0b9cc1541f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterApacheDumperCommand.php @@ -74,7 +74,9 @@ EOF */ protected function execute(InputInterface $input, OutputInterface $output) { - trigger_error('The router:dump-apache command is deprecated since version 2.5 and will be removed in 3.0', E_USER_DEPRECATED); + $formatter = $this->getHelper('formatter'); + + $output->writeln($formatter->formatSection('warning', 'The router:dump-apache command is deprecated since version 2.5 and will be removed in 3.0', 'comment')); $router = $this->getContainer()->get('router'); diff --git a/src/Symfony/Bundle/TwigBundle/TwigEngine.php b/src/Symfony/Bundle/TwigBundle/TwigEngine.php index 493d70dae2..4d41e388f3 100644 --- a/src/Symfony/Bundle/TwigBundle/TwigEngine.php +++ b/src/Symfony/Bundle/TwigBundle/TwigEngine.php @@ -47,6 +47,8 @@ class TwigEngine extends BaseEngine implements EngineInterface */ 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); + $this->environment->getExtension('escaper')->setDefaultStrategy($strategy); } @@ -56,6 +58,8 @@ class TwigEngine extends BaseEngine implements EngineInterface */ 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); + return TwigDefaultEscapingStrategy::guess($filename); } diff --git a/src/Symfony/Component/Debug/DebugClassLoader.php b/src/Symfony/Component/Debug/DebugClassLoader.php index 143fab91ae..eb751bf9cd 100644 --- a/src/Symfony/Component/Debug/DebugClassLoader.php +++ b/src/Symfony/Component/Debug/DebugClassLoader.php @@ -44,7 +44,7 @@ class DebugClassLoader $this->wasFinder = is_object($classLoader) && method_exists($classLoader, 'findFile'); if ($this->wasFinder) { - trigger_error('Since version 2.5, passing an object in the $classLoader argument of the '.__METHOD__.' is deprecated and support for it will be removed in 3.0.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method will no longer support receiving an object into its $classLoader argument in 3.0.', E_USER_DEPRECATED); $this->classLoader = array($classLoader, 'loadClass'); $this->isFinder = true; } else { diff --git a/src/Symfony/Component/Validator/Context/ExecutionContext.php b/src/Symfony/Component/Validator/Context/ExecutionContext.php index 9c5e6d639f..47528b0e15 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContext.php @@ -289,8 +289,6 @@ class ExecutionContext implements ExecutionContextInterface public function getClassName() { if ($this->metadata instanceof ClassBasedInterface) { - trigger_error('The Symfony\Component\Validator\ClassBasedInterface interface is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); - return $this->metadata->getClassName(); } @@ -318,8 +316,6 @@ class ExecutionContext implements ExecutionContextInterface */ public function addViolationAt($subPath, $message, array $parameters = array(), $invalidValue = null, $plural = null, $code = null) { - trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::buildViolation method instead.', E_USER_DEPRECATED); - throw new BadMethodCallException( 'addViolationAt() is not supported anymore as of Symfony 2.5. '. 'Please use buildViolation() instead or enable the legacy mode.' @@ -331,8 +327,6 @@ class ExecutionContext implements ExecutionContextInterface */ public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false) { - trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator method together with Symfony\Component\Validator\Validator\ValidatorInterface::inContext method instead.', E_USER_DEPRECATED); - throw new BadMethodCallException( 'validate() is not supported anymore as of Symfony 2.5. '. 'Please use getValidator() instead or enable the legacy mode.' @@ -344,8 +338,6 @@ class ExecutionContext implements ExecutionContextInterface */ public function validateValue($value, $constraints, $subPath = '', $groups = null) { - trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator method together with Symfony\Component\Validator\Validator\ValidatorInterface::inContext method instead.', E_USER_DEPRECATED); - throw new BadMethodCallException( 'validateValue() is not supported anymore as of Symfony 2.5. '. 'Please use getValidator() instead or enable the legacy mode.' @@ -357,8 +349,6 @@ class ExecutionContext implements ExecutionContextInterface */ public function getMetadataFactory() { - trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::getValidator method together with Symfony\Component\Validator\Validator\ValidatorInterface::getMetadataFor or Symfony\Component\Validator\Validator\ValidatorInterface::hasMetadataFor method instead.', E_USER_DEPRECATED); - throw new BadMethodCallException( 'getMetadataFactory() is not supported anymore as of Symfony 2.5. '. 'Please use getValidator() in combination with getMetadataFor() '. diff --git a/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php b/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php index 274be01db1..8ce6bdb304 100644 --- a/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php @@ -41,8 +41,6 @@ class LegacyExecutionContext extends ExecutionContext */ public function __construct(ValidatorInterface $validator, $root, MetadataFactoryInterface $metadataFactory, TranslatorInterface $translator, $translationDomain = null) { - trigger_error('The '.__CLASS__.' class is deprecated since version 2.5 and will be removed in 3.0. Use the new Symfony\Component\Validator\Context\ExecutionContext class instead.', E_USER_DEPRECATED); - parent::__construct( $validator, $root, diff --git a/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php b/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php index 9ca93bc8fd..c24c1fad3d 100644 --- a/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php +++ b/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Validator\Context; -trigger_error('The '.__NAMESPACE__.'\LegacyExecutionContextFactory is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); - use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\MetadataFactoryInterface; use Symfony\Component\Validator\Validator\ValidatorInterface; diff --git a/src/Symfony/Component/Validator/Mapping/GenericMetadata.php b/src/Symfony/Component/Validator/Mapping/GenericMetadata.php index 44fed35981..cc0e54d361 100644 --- a/src/Symfony/Component/Validator/Mapping/GenericMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/GenericMetadata.php @@ -239,8 +239,6 @@ class GenericMetadata implements MetadataInterface */ public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath) { - trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); - throw new BadMethodCallException('Not supported.'); } }