diff --git a/.travis.yml b/.travis.yml index 1e12bd699a..380914d3e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,11 @@ language: php matrix: include: - php: 5.5.9 + - php: 5.5 + - php: 5.6 env: components=low - php: 5.6 env: components=high - - php: 5.5 - - php: 5.6 - php: hhvm-nightly allow_failures: - php: hhvm-nightly @@ -29,13 +29,14 @@ before_install: - if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi; - if [ "$TRAVIS_PHP_VERSION" != "hhvm-nightly" ]; then php -i; fi; - sudo locale-gen fr_FR.UTF-8 && sudo update-locale -# - if [ "$TRAVIS_PHP_VERSION" != "5.3.3" ]; then phpunit --self-update; fi; + # Set the COMPOSER_ROOT_VERSION to the right version according to the branch being built + - if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi; install: - - if [ "$components" = "no" ]; then COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev install; fi; + - if [ "$components" = "no" ]; then composer --prefer-source --dev install; fi; script: - if [ "$components" = "no" ]; then ls -d src/Symfony/*/* | parallel --gnu --keep-order 'echo -e "\\nRunning {} tests"; phpunit --exclude-group tty,benchmark,intl-data {} || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi; - if [ "$components" = "no" ]; then echo -e "\\nRunning tests requiring tty"; phpunit --group tty || (echo -e "\\e[41mKO\\e[0m tty group" && $(exit 1)); fi; - - if [ "$components" = "high" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi; - - if [ "$components" = "low" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi; + - if [ "$components" = "high" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --dev update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi; + - if [ "$components" = "low" ]; then find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist | sed 's#\(.*\)/.*#\1#' | parallel --gnu --keep-order -j25% 'echo -e "\\nRunning {} tests"; cd {}; composer --prefer-source --dev --prefer-lowest --prefer-stable update; phpunit --exclude-group tty,benchmark,intl-data || (echo -e "\\e[41mKO\\e[0m {}" && $(exit 1));'; fi; diff --git a/UPGRADE-2.5.md b/UPGRADE-2.5.md index be656cd36a..fc5ad61fad 100644 --- a/UPGRADE-2.5.md +++ b/UPGRADE-2.5.md @@ -1,6 +1,13 @@ UPGRADE FROM 2.4 to 2.5 ======================= +FrameworkBundle +--------------- + +* The `Symfony\Bundle\FrameworkBundle\Console\Descriptor\Descriptor::renderTable()` + method expects the table to be an instance of `Symfony\Component\Console\Helper\Table` + instead of `Symfony\Component\Console\Helper\TableHelper`. + Routing ------- diff --git a/src/Symfony/Bridge/Doctrine/CHANGELOG.md b/src/Symfony/Bridge/Doctrine/CHANGELOG.md index 9c747b8abc..c00ac113d7 100644 --- a/src/Symfony/Bridge/Doctrine/CHANGELOG.md +++ b/src/Symfony/Bridge/Doctrine/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +2.4.0 +----- + + * deprecated DoctrineOrmTestCase class + 2.2.0 ----- diff --git a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php index 1b1731554e..57e57e6e25 100644 --- a/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php +++ b/src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php @@ -296,10 +296,12 @@ class EntityChoiceList extends ObjectChoiceList * * @see ChoiceListInterface * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $entities) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + // Performance optimization if (empty($entities)) { return array(); @@ -338,10 +340,12 @@ class EntityChoiceList extends ObjectChoiceList * * @see ChoiceListInterface * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + // Performance optimization if (empty($values)) { return array(); diff --git a/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php b/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php index e506352d16..dae25951e4 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php +++ b/src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php @@ -11,18 +11,21 @@ namespace Symfony\Bridge\Doctrine\Tests; +trigger_error('The '.__NAMESPACE__.'\DoctrineOrmTestCase class is deprecated since version 2.4 and will be removed in 3.0. Use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper class instead.', E_USER_DEPRECATED); + +use Doctrine\ORM\EntityManager; use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper; /** * Class DoctrineOrmTestCase. * - * @deprecated Deprecated as of Symfony 2.3, to be removed in Symfony 3.0. + * @deprecated since version 2.4, to be removed in 3.0. * Use {@link DoctrineTestHelper} instead. */ abstract class DoctrineOrmTestCase extends \PHPUnit_Framework_TestCase { /** - * @return \Doctrine\ORM\EntityManager + * @return EntityManager */ public static function createTestEntityManager() { diff --git a/src/Symfony/Bridge/Monolog/Logger.php b/src/Symfony/Bridge/Monolog/Logger.php index 8b8782f95e..c2ced9ef63 100644 --- a/src/Symfony/Bridge/Monolog/Logger.php +++ b/src/Symfony/Bridge/Monolog/Logger.php @@ -24,41 +24,41 @@ class Logger extends BaseLogger implements LoggerInterface, DebugLoggerInterface { /** * @see Symfony\Component\HttpKernel\Log\DebugLoggerInterface - * @deprecated since 2.2, to be removed in 3.0. Use emergency() which is PSR-3 compatible. + * @deprecated since version 2.2, to be removed in 3.0. Use emergency() which is PSR-3 compatible. */ public function emerg($message, array $context = array()) { - trigger_error('The emerg() method of the Monolog Logger was removed. You should use the new method emergency() 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); } /** - * @deprecated since 2.2, to be removed in 3.0. Use critical() which is PSR-3 compatible. + * @deprecated since version 2.2, to be removed in 3.0. Use critical() which is PSR-3 compatible. */ public function crit($message, array $context = array()) { - trigger_error('The crit() method of the Monolog Logger was removed. You should use the new method critical() 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); } /** - * @deprecated since 2.2, to be removed in 3.0. Use error() which is PSR-3 compatible. + * @deprecated since version 2.2, to be removed in 3.0. Use error() which is PSR-3 compatible. */ public function err($message, array $context = array()) { - trigger_error('The err() method of the Monolog Logger was removed. You should use the new method error() 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); } /** - * @deprecated since 2.2, to be removed in 3.0. Use warning() which is PSR-3 compatible. + * @deprecated since version 2.2, to be removed in 3.0. Use warning() which is PSR-3 compatible. */ public function warn($message, array $context = array()) { - trigger_error('The warn() method of the Monolog Logger was removed. You should use the new method warning() 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/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php b/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php index e0eff7c4ea..b52826d9d6 100644 --- a/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php +++ b/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php @@ -300,10 +300,12 @@ class ModelChoiceList extends ObjectChoiceList /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $models) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + if (empty($models)) { return array(); } @@ -319,7 +321,7 @@ class ModelChoiceList extends ObjectChoiceList * but if they originated from different queries, there are not the same object within the code. * * This happens when using m:n relations with either sides model as data_class of the form. - * The choicelist will retrieve the list of available related models with a different query, resulting in different objects. + * The choice list will retrieve the list of available related models with a different query, resulting in different objects. */ $choices = $this->fixChoices($models); foreach ($choices as $i => $givenChoice) { @@ -346,10 +348,12 @@ class ModelChoiceList extends ObjectChoiceList /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + if (empty($values)) { return array(); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php index df8f1162de..c3196347e5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php @@ -12,6 +12,7 @@ namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor; use Symfony\Component\Console\Descriptor\DescriptorInterface; +use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -77,6 +78,16 @@ abstract class Descriptor implements DescriptorInterface } } + /** + * Returns the output. + * + * @return OutputInterface The output + */ + protected function getOutput() + { + return $this->output; + } + /** * Writes content to output. * diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index fea7962550..10d67738df 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -30,10 +30,10 @@ class TextDescriptor extends Descriptor */ protected function describeRouteCollection(RouteCollection $routes, array $options = array()) { - $table = new Table($this->output); - $showControllers = isset($options['show_controllers']) && $options['show_controllers']; $headers = array('Name', 'Method', 'Scheme', 'Host', 'Path'); + + $table = new Table($this->output); $table->setHeaders($showControllers ? array_merge($headers, array('Controller')) : $headers); foreach ($routes->all() as $name => $route) { @@ -322,6 +322,7 @@ class TextDescriptor extends Descriptor foreach ($eventListeners as $order => $eventListener) { $table->addRow(array(sprintf('#%d', $order + 1), $this->formatCallable($eventListener))); } + $table->render(); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index d635aae822..3d4490ca98 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -116,7 +116,7 @@ class Configuration implements ConfigurationInterface ->children() ->scalarNode('field_name') ->defaultValue('_token') - ->info('Deprecated since 2.4, to be removed in 3.0. Use form.csrf_protection.field_name instead') + ->info('Deprecated since version 2.4, to be removed in 3.0. Use form.csrf_protection.field_name instead') ->end() ->end() ->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php index ff2d5edc4b..39c44e085f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php @@ -11,6 +11,8 @@ namespace Symfony\Bundle\FrameworkBundle\Templating; +trigger_error('The '.__NAMESPACE__.'\Debugger class is deprecated since version 2.4 and will be removed in 3.0. Use the Psr\Log\LoggerInterface interface instead.', E_USER_DEPRECATED); + use Symfony\Component\Templating\DebuggerInterface; use Psr\Log\LoggerInterface; @@ -19,7 +21,8 @@ use Psr\Log\LoggerInterface; * * @author Fabien Potencier * - * @deprecated Deprecated in 2.4, to be removed in 3.0. Use Psr\Log\LoggerInterface instead. + * @deprecated since version 2.4, to be removed in 3.0. + * Use Psr\Log\LoggerInterface instead. */ class Debugger implements DebuggerInterface { diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php b/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php index 3d2ae2be91..51fe53f2e0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php @@ -37,11 +37,14 @@ class GlobalVariables /** * Returns the security context service. * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. + * * @return SecurityContext|null The security context */ public function getSecurity() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED); + if ($this->container->has('security.context')) { return $this->container->get('security.context'); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php index 0d7fec1dd1..4aba0c202f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php @@ -30,11 +30,12 @@ class RequestHelper extends Helper * * @param Request|RequestStack $requestStack A RequestStack instance or a Request instance * - * @deprecated since 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0 + * @deprecated since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0. */ public function __construct($requestStack) { if ($requestStack instanceof Request) { + trigger_error('Since version 2.5, passing a Request instance into the '.__METHOD__.' is deprecated and support for it will be removed in 3.0. Inject a Symfony\Component\HttpFoundation\RequestStack instance instead.', E_USER_DEPRECATED); $this->request = $requestStack; } elseif ($requestStack instanceof RequestStack) { $this->requestStack = $requestStack; diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php index 46bbf9d321..3558b9ce04 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php @@ -30,11 +30,12 @@ class SessionHelper extends Helper * * @param Request|RequestStack $requestStack A RequestStack instance or a Request instance * - * @deprecated since 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0 + * @deprecated since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0. */ public function __construct($requestStack) { if ($requestStack instanceof Request) { + trigger_error('Since version 2.5, passing a Request instance into the '.__METHOD__.' is deprecated and support for it will be removed in 3.0. Inject a Symfony\Component\HttpFoundation\RequestStack instance instead.', E_USER_DEPRECATED); $this->session = $requestStack->getSession(); } elseif ($requestStack instanceof RequestStack) { $this->requestStack = $requestStack; diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 81a09296fe..4dd76f374c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -32,19 +32,19 @@ "doctrine/annotations": "~1.0" }, "require-dev": { - "symfony/browser-kit": "~2.7|~3.0", - "symfony/console": "~2.7|~3.0", - "symfony/css-selector": "~2.7|~3.0", - "symfony/dom-crawler": "~2.7|~3.0", - "symfony/finder": "~2.7|~3.0", - "symfony/intl": "~2.7|~3.0", - "symfony/security": "~2.7|~3.0", - "symfony/form": "~2.7|~3.0", - "symfony/class-loader": "~2.7|~3.0", - "symfony/expression-language": "~2.7|~3.0", - "symfony/process": "~2.7|~3.0", - "symfony/validator": "~2.7|~3.0", - "symfony/yaml": "~2.7|~3.0" + "symfony/browser-kit": "~2.4|~3.0.0", + "symfony/console": "~2.6|~3.0.0", + "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0", + "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0", + "symfony/finder": "~2.0,>=2.0.5|~3.0.0", + "symfony/intl": "~2.3|~3.0.0", + "symfony/security": "~2.6|~3.0.0", + "symfony/form": "~2.6|~3.0.0", + "symfony/class-loader": "~2.1|~3.0.0", + "symfony/expression-language": "~2.6|~3.0.0", + "symfony/process": "~2.0,>=2.0.5|~3.0.0", + "symfony/validator": "~2.5|~3.0.0", + "symfony/yaml": "~2.0,>=2.0.5|~3.0.0" }, "suggest": { "symfony/console": "For using the console commands", diff --git a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php index bda4ddf3a3..e49fd8654b 100644 --- a/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php @@ -61,7 +61,7 @@ class Configuration implements ConfigurationInterface ->end() ->children() ->arrayNode('form') - ->info('Deprecated since 2.6, to be removed in 3.0. Use twig.form_themes instead') + ->info('Deprecated since version 2.6, to be removed in 3.0. Use twig.form_themes instead') ->addDefaultsIfNotSet() ->fixXmlConfig('resource') ->children() diff --git a/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php b/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php index 845012c876..9209a60db2 100644 --- a/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php +++ b/src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php @@ -20,7 +20,7 @@ use Symfony\Component\HttpKernel\Fragment\FragmentHandler; * * @author Fabien Potencier * - * @deprecated Deprecated in 2.2, to be removed in 3.0. + * @deprecated since version 2.2, to be removed in 3.0. */ class ActionsExtension extends \Twig_Extension { @@ -29,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/Resources/config/schema/twig-1.0.xsd b/src/Symfony/Bundle/TwigBundle/Resources/config/schema/twig-1.0.xsd index 4a3bba7392..474b6c9721 100644 --- a/src/Symfony/Bundle/TwigBundle/Resources/config/schema/twig-1.0.xsd +++ b/src/Symfony/Bundle/TwigBundle/Resources/config/schema/twig-1.0.xsd @@ -9,7 +9,7 @@ - + diff --git a/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php b/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php index 05d8dd20d4..3e382fe0c8 100644 --- a/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php +++ b/src/Symfony/Bundle/TwigBundle/Tests/DependencyInjection/TwigExtensionTest.php @@ -57,7 +57,7 @@ class TwigExtensionTest extends TestCase $resources = $container->getParameter('twig.form.resources'); $this->assertContains('form_div_layout.html.twig', $resources, '->load() includes default template for form resources'); $this->assertContains('MyBundle::form.html.twig', $resources, '->load() merges new templates into form resources'); - // @deprecated since 2.6, to be removed in 3.0 + // @deprecated since version 2.6, to be removed in 3.0 $this->assertContains('MyBundle::formDeprecated.html.twig', $resources, '->load() merges new templates into form resources'); // Globals diff --git a/src/Symfony/Bundle/TwigBundle/TwigEngine.php b/src/Symfony/Bundle/TwigBundle/TwigEngine.php index 324cd34fc9..9aeb630c47 100644 --- a/src/Symfony/Bundle/TwigBundle/TwigEngine.php +++ b/src/Symfony/Bundle/TwigBundle/TwigEngine.php @@ -42,19 +42,24 @@ class TwigEngine extends BaseEngine implements EngineInterface } /** - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Inject the escaping - * strategy on Twig_Environment instead + * @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.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 Deprecated since version 2.3, to be removed in 3.0. Use TwigDefaultEscapingStrategy instead. + * @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.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/ClassLoader/ApcUniversalClassLoader.php b/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php index 65b7b10b23..dd95413caf 100644 --- a/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php +++ b/src/Symfony/Component/ClassLoader/ApcUniversalClassLoader.php @@ -11,6 +11,8 @@ namespace Symfony\Component\ClassLoader; +trigger_error('The '.__NAMESPACE__.'\ApcUniversalClassLoader class is deprecated since version 2.7 and will be removed in 3.0. Use the Symfony\Component\ClassLoader\ApcClassLoader class instead.', E_USER_DEPRECATED); + /** * ApcUniversalClassLoader implements a "universal" autoloader cached in APC for PHP 5.3. * @@ -60,7 +62,8 @@ namespace Symfony\Component\ClassLoader; * * @api * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the ApcClassLoader class instead. + * @deprecated since version 2.4, to be removed in 3.0. + * Use the {@link ClassLoader} class instead. */ class ApcUniversalClassLoader extends UniversalClassLoader { diff --git a/src/Symfony/Component/ClassLoader/CHANGELOG.md b/src/Symfony/Component/ClassLoader/CHANGELOG.md index 211af2eff4..64660a8768 100644 --- a/src/Symfony/Component/ClassLoader/CHANGELOG.md +++ b/src/Symfony/Component/ClassLoader/CHANGELOG.md @@ -1,11 +1,6 @@ CHANGELOG ========= -2.7.0 ------ - - * The UniversalClassLoader class has been deprecated in favor of ClassLoader class - 2.4.0 ----- diff --git a/src/Symfony/Component/ClassLoader/DebugClassLoader.php b/src/Symfony/Component/ClassLoader/DebugClassLoader.php index 47bba2d45f..473a7bdf4a 100644 --- a/src/Symfony/Component/ClassLoader/DebugClassLoader.php +++ b/src/Symfony/Component/ClassLoader/DebugClassLoader.php @@ -11,6 +11,8 @@ namespace Symfony\Component\ClassLoader; +trigger_error('The '.__NAMESPACE__.'\DebugClassLoader class is deprecated since version 2.4 and will be removed in 3.0. Use the Symfony\Component\Debug\DebugClassLoader class instead.', E_USER_DEPRECATED); + /** * Autoloader checking if the class is really defined in the file found. * @@ -23,7 +25,8 @@ namespace Symfony\Component\ClassLoader; * * @api * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the DebugClassLoader provided by the Debug component instead. + * @deprecated since version 2.4, to be removed in 3.0. + * Use {@link \Symfony\Component\Debug\DebugClassLoader} instead. */ class DebugClassLoader { diff --git a/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php b/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php index 0a25b52223..69005baa27 100644 --- a/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php +++ b/src/Symfony/Component/ClassLoader/DebugUniversalClassLoader.php @@ -11,12 +11,15 @@ namespace Symfony\Component\ClassLoader; +trigger_error('The '.__NAMESPACE__.'\DebugUniversalClassLoader class is deprecated since version 2.4 and will be removed in 3.0. Use the Symfony\Component\Debug\DebugClassLoader class instead.', E_USER_DEPRECATED); + /** * Checks that the class is actually declared in the included file. * * @author Fabien Potencier * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the DebugClassLoader provided by the Debug component instead. + * @deprecated since version 2.4, to be removed in 3.0. + * Use the {@link \Symfony\Component\Debug\DebugClassLoader} class instead. */ class DebugUniversalClassLoader extends UniversalClassLoader { diff --git a/src/Symfony/Component/ClassLoader/UniversalClassLoader.php b/src/Symfony/Component/ClassLoader/UniversalClassLoader.php index 63cc58af73..781d3a29a9 100644 --- a/src/Symfony/Component/ClassLoader/UniversalClassLoader.php +++ b/src/Symfony/Component/ClassLoader/UniversalClassLoader.php @@ -11,7 +11,7 @@ namespace Symfony\Component\ClassLoader; -trigger_error('The "Symfony\Component\ClassLoader\UniversalClassLoader" class was deprecated in version 2.7 and will be removed in 3.0. Use "Symfony\Component\ClassLoader\ClassLoader" instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\UniversalClassLoader class is deprecated since version 2.7 and will be removed in 3.0. Use the Symfony\Component\ClassLoader\ClassLoader class instead.', E_USER_DEPRECATED); /** * UniversalClassLoader implements a "universal" autoloader for PHP 5.3. @@ -60,7 +60,8 @@ trigger_error('The "Symfony\Component\ClassLoader\UniversalClassLoader" class wa * * @api * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. Use the ClassLoader class instead. + * @deprecated since version 2.4, to be removed in 3.0. + * Use the {@link ClassLoader} class instead. */ class UniversalClassLoader { diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index a57eddb10a..6667a1ab6e 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -621,10 +621,12 @@ class Application * * @return string A string representing the Application * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.3, to be removed in 3.0. */ public function asText($namespace = null, $raw = false) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); + $descriptor = new TextDescriptor(); $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, !$raw); $descriptor->describe($output, $this, array('namespace' => $namespace, 'raw_output' => true)); @@ -640,10 +642,12 @@ class Application * * @return string|\DOMDocument An XML string representing the Application * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.3, to be removed in 3.0. */ public function asXml($namespace = null, $asDom = false) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); + $descriptor = new XmlDescriptor(); if ($asDom) { diff --git a/src/Symfony/Component/Console/Command/Command.php b/src/Symfony/Component/Console/Command/Command.php index 0302cb1753..b70692fc6a 100644 --- a/src/Symfony/Component/Console/Command/Command.php +++ b/src/Symfony/Component/Console/Command/Command.php @@ -605,10 +605,12 @@ class Command * * @return string A string representing the command * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.3, to be removed in 3.0. */ public function asText() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); + $descriptor = new TextDescriptor(); $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); $descriptor->describe($output, $this, array('raw_output' => true)); @@ -623,10 +625,12 @@ class Command * * @return string|\DOMDocument An XML string representing the command * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.3, to be removed in 3.0. */ public function asXml($asDom = false) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); + $descriptor = new XmlDescriptor(); if ($asDom) { diff --git a/src/Symfony/Component/Console/Helper/ProgressBar.php b/src/Symfony/Component/Console/Helper/ProgressBar.php index 417ac08195..12b720682f 100644 --- a/src/Symfony/Component/Console/Helper/ProgressBar.php +++ b/src/Symfony/Component/Console/Helper/ProgressBar.php @@ -171,12 +171,14 @@ class ProgressBar /** * Gets the progress bar step. * - * @deprecated since 2.6, to be removed in 3.0. Use {@link getProgress()} instead. + * @deprecated since version 2.6, to be removed in 3.0. Use {@link getProgress()} instead. * * @return int The progress bar step */ public function getStep() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the getProgress() method instead.', E_USER_DEPRECATED); + return $this->getProgress(); } @@ -356,7 +358,7 @@ class ProgressBar /** * Sets the current progress. * - * @deprecated since 2.6, to be removed in 3.0. Use {@link setProgress()} instead. + * @deprecated since version 2.6, to be removed in 3.0. Use {@link setProgress()} instead. * * @param int $step The current progress * @@ -364,6 +366,8 @@ class ProgressBar */ public function setCurrent($step) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setProgress() method instead.', E_USER_DEPRECATED); + $this->setProgress($step); } diff --git a/src/Symfony/Component/Console/Input/InputDefinition.php b/src/Symfony/Component/Console/Input/InputDefinition.php index 48edb166c3..51d1bdd8aa 100644 --- a/src/Symfony/Component/Console/Input/InputDefinition.php +++ b/src/Symfony/Component/Console/Input/InputDefinition.php @@ -417,10 +417,12 @@ class InputDefinition * * @return string A string representing the InputDefinition * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.3, to be removed in 3.0. */ public function asText() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); + $descriptor = new TextDescriptor(); $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); $descriptor->describe($output, $this, array('raw_output' => true)); @@ -435,10 +437,12 @@ class InputDefinition * * @return string|\DOMDocument An XML string representing the InputDefinition * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.3, to be removed in 3.0. */ public function asXml($asDom = false) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); + $descriptor = new XmlDescriptor(); if ($asDom) { diff --git a/src/Symfony/Component/Console/Input/StringInput.php b/src/Symfony/Component/Console/Input/StringInput.php index 6537e27a6b..40656b3c14 100644 --- a/src/Symfony/Component/Console/Input/StringInput.php +++ b/src/Symfony/Component/Console/Input/StringInput.php @@ -39,6 +39,10 @@ class StringInput extends ArgvInput */ public function __construct($input, InputDefinition $definition = null) { + if ($definition) { + trigger_error('The $definition argument of the '.__METHOD__.' method is deprecated and will be removed in 3.0. Set this parameter with the bind() method instead.', E_USER_DEPRECATED); + } + parent::__construct(array(), null); $this->setTokens($this->tokenize($input)); diff --git a/src/Symfony/Component/Debug/DebugClassLoader.php b/src/Symfony/Component/Debug/DebugClassLoader.php index 6ee5d09412..267ed57472 100644 --- a/src/Symfony/Component/Debug/DebugClassLoader.php +++ b/src/Symfony/Component/Debug/DebugClassLoader.php @@ -35,16 +35,16 @@ class DebugClassLoader /** * Constructor. * - * @param callable|object $classLoader + * @param callable|object $classLoader Passing an object is @deprecated since version 2.5 and support for it will be removed in 3.0 * * @api - * @deprecated since 2.5, passing an object is deprecated and support for it will be removed in 3.0 */ public function __construct($classLoader) { $this->wasFinder = is_object($classLoader) && method_exists($classLoader, 'findFile'); if ($this->wasFinder) { + 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 { @@ -60,9 +60,7 @@ class DebugClassLoader /** * Gets the wrapped class loader. * - * @return callable|object a class loader - * - * @deprecated since 2.5, returning an object is deprecated and support for it will be removed in 3.0 + * @return callable|object A class loader. Since version 2.5, returning an object is @deprecated and support for it will be removed in 3.0 */ public function getClassLoader() { @@ -124,10 +122,12 @@ class DebugClassLoader * * @return string|null * - * @deprecated Deprecated since 2.5, to be removed in 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function findFile($class) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + if ($this->wasFinder) { return $this->classLoader[0]->findFile($class); } diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php index 65b88a2b3e..688c87aa19 100644 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ b/src/Symfony/Component/Debug/ErrorHandler.php @@ -46,7 +46,7 @@ use Symfony\Component\Debug\FatalErrorHandler\FatalErrorHandlerInterface; class ErrorHandler { /** - * @deprecated since 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ const TYPE_DEPRECATION = -100; @@ -103,14 +103,14 @@ class ErrorHandler /** * Same init value as thrownErrors * - * @deprecated since 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ private $displayErrors = 0x1FFF; /** * Registers the error handler. * - * @param self|null|int $handler The handler to register, or @deprecated (since 2.6, to be removed in 3.0) bit field of thrown levels + * @param self|null|int $handler The handler to register, or @deprecated (since version 2.6, to be removed in 3.0) bit field of thrown levels * @param bool $replace Whether to replace or not any existing handler * * @return self The registered error handler @@ -256,7 +256,7 @@ class ErrorHandler } $this->reRegister($prev | $this->loggedErrors); - // $this->displayErrors is @deprecated since 2.6 + // $this->displayErrors is @deprecated since version 2.6 $this->displayErrors = $this->thrownErrors; return $prev; @@ -572,10 +572,12 @@ class ErrorHandler * * @param int|null $level The level (null to use the error_reporting() value and 0 to disable) * - * @deprecated since 2.6, to be removed in 3.0. Use throwAt() instead. + * @deprecated since version 2.6, to be removed in 3.0. Use throwAt() instead. */ public function setLevel($level) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the throwAt() method instead.', E_USER_DEPRECATED); + $level = null === $level ? error_reporting() : $level; $this->throwAt($level, true); } @@ -585,10 +587,12 @@ class ErrorHandler * * @param int $displayErrors The display_errors flag value * - * @deprecated since 2.6, to be removed in 3.0. Use throwAt() instead. + * @deprecated since version 2.6, to be removed in 3.0. Use throwAt() instead. */ public function setDisplayErrors($displayErrors) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the throwAt() method instead.', E_USER_DEPRECATED); + if ($displayErrors) { $this->throwAt($this->displayErrors, true); } else { @@ -604,10 +608,12 @@ class ErrorHandler * @param LoggerInterface $logger A logger interface * @param string $channel The channel associated with the logger (deprecation, emergency or scream) * - * @deprecated since 2.6, to be removed in 3.0. Use setLoggers() or setDefaultLogger() instead. + * @deprecated since version 2.6, to be removed in 3.0. Use setLoggers() or setDefaultLogger() instead. */ public static function setLogger(LoggerInterface $logger, $channel = 'deprecation') { + trigger_error('The '.__METHOD__.' static method is deprecated since version 2.6 and will be removed in 3.0. Use the setLoggers() or setDefaultLogger() methods instead.', E_USER_DEPRECATED); + $handler = set_error_handler('var_dump', 0); $handler = is_array($handler) ? $handler[0] : null; restore_error_handler(); @@ -627,20 +633,24 @@ class ErrorHandler } /** - * @deprecated since 2.6, to be removed in 3.0. Use handleError() instead. + * @deprecated since version 2.6, to be removed in 3.0. Use handleError() instead. */ public function handle($level, $message, $file = 'unknown', $line = 0, $context = array()) { + $this->handleError(E_USER_DEPRECATED, 'The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the handleError() method instead.', __FILE__, __LINE__, array()); + return $this->handleError($level, $message, $file, $line, (array) $context); } /** * Handles PHP fatal errors. * - * @deprecated since 2.6, to be removed in 3.0. Use handleFatalError() instead. + * @deprecated since version 2.6, to be removed in 3.0. Use handleFatalError() instead. */ public function handleFatal() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the handleFatalError() method instead.', E_USER_DEPRECATED); + static::handleFatalError(); } } diff --git a/src/Symfony/Component/Debug/Exception/DummyException.php b/src/Symfony/Component/Debug/Exception/DummyException.php index 967e033777..378cbcc10f 100644 --- a/src/Symfony/Component/Debug/Exception/DummyException.php +++ b/src/Symfony/Component/Debug/Exception/DummyException.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Debug\Exception; +trigger_error('The '.__NAMESPACE__.'\DummyException class is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + /** * @author Fabien Potencier * diff --git a/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php b/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php index b8076279c8..571a980c2f 100644 --- a/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php +++ b/src/Symfony/Component/Debug/FatalErrorHandler/ClassNotFoundFatalErrorHandler.php @@ -101,7 +101,7 @@ class ClassNotFoundFatalErrorHandler implements FatalErrorHandlerInterface if ($function[0] instanceof DebugClassLoader) { $function = $function[0]->getClassLoader(); - // Since 2.5, returning an object from DebugClassLoader::getClassLoader() is @deprecated + // @deprecated since version 2.5. Returning an object from DebugClassLoader::getClassLoader() is deprecated. if (is_object($function)) { $function = array($function); } diff --git a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php index 8b1af3f16f..781158fbdc 100644 --- a/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php +++ b/src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php @@ -380,7 +380,7 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase ; $handler = ErrorHandler::register(E_NOTICE); - $handler->setLogger($logger, 'scream'); + @$handler->setLogger($logger, 'scream'); unset($undefVar); @$undefVar++; diff --git a/src/Symfony/Component/DependencyInjection/Definition.php b/src/Symfony/Component/DependencyInjection/Definition.php index 2273ee56d8..97cd849dda 100644 --- a/src/Symfony/Component/DependencyInjection/Definition.php +++ b/src/Symfony/Component/DependencyInjection/Definition.php @@ -94,11 +94,11 @@ class Definition * @return Definition The current instance * * @api - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function setFactoryClass($factoryClass) { - trigger_error('Definition::setFactoryClass() is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED); $this->factoryClass = $factoryClass; @@ -111,10 +111,12 @@ class Definition * @return string|null The factory class name * * @api - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function getFactoryClass() { + trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED); + return $this->factoryClass; } @@ -126,11 +128,11 @@ class Definition * @return Definition The current instance * * @api - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function setFactoryMethod($factoryMethod) { - trigger_error('Definition::setFactoryMethod() is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED); $this->factoryMethod = $factoryMethod; @@ -178,10 +180,12 @@ class Definition * @return string|null The factory method name * * @api - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function getFactoryMethod() { + trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED); + return $this->factoryMethod; } @@ -193,11 +197,11 @@ class Definition * @return Definition The current instance * * @api - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function setFactoryService($factoryService) { - trigger_error('Definition::setFactoryService() is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED); $this->factoryService = $factoryService; @@ -210,10 +214,12 @@ class Definition * @return string|null The factory service id * * @api - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function getFactoryService() { + trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED); + return $this->factoryService; } diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index e846b4245a..685f9ccece 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1401,12 +1401,15 @@ EOF; } /** - * @deprecated Deprecated since 2.6.2, to be removed in 3.0. Use Symfony\Component\DependencyInjection\ContainerBuilder::addExpressionLanguageProvider instead. + * @deprecated since version 2.6.2, to be removed in 3.0. + * Use \Symfony\Component\DependencyInjection\ContainerBuilder::addExpressionLanguageProvider instead. * * @param ExpressionFunctionProviderInterface $provider */ public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6.2 and will be removed in 3.0. Use the Symfony\Component\DependencyInjection\ContainerBuilder::addExpressionLanguageProvider method instead.', E_USER_DEPRECATED); + $this->expressionLanguageProviders[] = $provider; } diff --git a/src/Symfony/Component/DependencyInjection/SimpleXMLElement.php b/src/Symfony/Component/DependencyInjection/SimpleXMLElement.php index 2e20b6cf31..1b318fd9e4 100644 --- a/src/Symfony/Component/DependencyInjection/SimpleXMLElement.php +++ b/src/Symfony/Component/DependencyInjection/SimpleXMLElement.php @@ -11,6 +11,8 @@ namespace Symfony\Component\DependencyInjection; +trigger_error('The '.__NAMESPACE__.'\SimpleXMLElement method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + use Symfony\Component\Config\Util\XmlUtils; use Symfony\Component\ExpressionLanguage\Expression; @@ -19,7 +21,7 @@ use Symfony\Component\ExpressionLanguage\Expression; * * @author Fabien Potencier * - * @deprecated Deprecated since version 2.5, to be removed in 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ class SimpleXMLElement extends \SimpleXMLElement { diff --git a/src/Symfony/Component/EventDispatcher/Event.php b/src/Symfony/Component/EventDispatcher/Event.php index dc39b05d52..e411ca8136 100644 --- a/src/Symfony/Component/EventDispatcher/Event.php +++ b/src/Symfony/Component/EventDispatcher/Event.php @@ -77,7 +77,7 @@ class Event * * @param EventDispatcherInterface $dispatcher * - * @deprecated Deprecated in 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call. + * @deprecated since version 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call. * * @api */ @@ -91,12 +91,14 @@ class Event * * @return EventDispatcherInterface * - * @deprecated Deprecated in 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call. + * @deprecated since version 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call. * * @api */ public function getDispatcher() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0. The event dispatcher instance can be received in the listener call instead.', E_USER_DEPRECATED); + return $this->dispatcher; } @@ -105,12 +107,14 @@ class Event * * @return string * - * @deprecated Deprecated in 2.4, to be removed in 3.0. The event name is passed to the listener call. + * @deprecated since version 2.4, to be removed in 3.0. The event name is passed to the listener call. * * @api */ public function getName() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0. The event name can be received in the listener call instead.', E_USER_DEPRECATED); + return $this->name; } @@ -119,7 +123,7 @@ class Event * * @param string $name The event name. * - * @deprecated Deprecated in 2.4, to be removed in 3.0. The event name is passed to the listener call. + * @deprecated since version 2.4, to be removed in 3.0. The event name is passed to the listener call. * * @api */ diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index 8cb8088f4a..d51945a2b8 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -592,12 +592,12 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface * * @return bool Always returns false. * - * @deprecated since version 2.3, to be removed in 3.0. Use - * {@link getInheritData()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link getInheritData()} instead. */ public function getVirtual() { - trigger_error('ButtonBuilder::getVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use FormConfigBuilder::getInheritData() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\FormConfigBuilder::getInheritData method instead.', E_USER_DEPRECATED); return false; } diff --git a/src/Symfony/Component/Form/Deprecated/NumberToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Deprecated/NumberToLocalizedStringTransformer.php index 9b94c4e6cf..4dabe10b56 100644 --- a/src/Symfony/Component/Form/Deprecated/NumberToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Deprecated/NumberToLocalizedStringTransformer.php @@ -11,10 +11,10 @@ namespace Symfony\Component\Form\Deprecated; -trigger_error('Constants ROUND_HALFEVEN, ROUND_HALFUP and ROUND_HALFDOWN on class NumberToLocalizedStringTransformer were deprecated in Symfony 2.4 and will be removed in 3.0. Use ROUND_HALF_EVEN, ROUND_HALF_UP and ROUND_HALF_DOWN instead.', E_USER_DEPRECATED); +trigger_error('Constants ROUND_HALFEVEN, ROUND_HALFUP and ROUND_HALFDOWN in class NumberToLocalizedStringTransformer are deprecated since version 2.4 and will be removed in 3.0. Use ROUND_HALF_EVEN, ROUND_HALF_UP and ROUND_HALF_DOWN instead.', E_USER_DEPRECATED); /** - * @deprecated since 2.7, to be removed in 3.0. + * @deprecated since version 2.7, to be removed in 3.0. * @internal */ final class NumberToLocalizedStringTransformer diff --git a/src/Symfony/Component/Form/Exception/AlreadyBoundException.php b/src/Symfony/Component/Form/Exception/AlreadyBoundException.php index 7ef0ca02e8..03e258ff07 100644 --- a/src/Symfony/Component/Form/Exception/AlreadyBoundException.php +++ b/src/Symfony/Component/Form/Exception/AlreadyBoundException.php @@ -11,11 +11,13 @@ namespace Symfony\Component\Form\Exception; +trigger_error('The '.__NAMESPACE__.'\AlreadyBoundException class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Exception\AlreadySubmittedException class instead.', E_USER_DEPRECATED); + /** * Alias of {@link AlreadySubmittedException}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link AlreadySubmittedException} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link AlreadySubmittedException} instead. */ class AlreadyBoundException extends LogicException { diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php index fd52c2647d..99daf7095e 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceList.php @@ -199,10 +199,12 @@ class ChoiceList implements ChoiceListInterface /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $choices) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + $choices = $this->fixChoices($choices); $indices = array(); @@ -225,10 +227,12 @@ class ChoiceList implements ChoiceListInterface /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + $values = $this->fixValues($values); $indices = array(); diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php index f0d8ec44d4..8f09179a2a 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ChoiceListInterface.php @@ -139,7 +139,7 @@ interface ChoiceListInterface * * @return array An array of indices with ascending, 0-based numeric keys * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $choices); @@ -159,7 +159,7 @@ interface ChoiceListInterface * * @return array An array of indices with ascending, 0-based numeric keys * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values); } diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php index cc364d998c..ee136f7978 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/LazyChoiceList.php @@ -106,10 +106,12 @@ abstract class LazyChoiceList implements ChoiceListInterface /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $choices) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + if (!$this->choiceList) { $this->load(); } @@ -120,10 +122,12 @@ abstract class LazyChoiceList implements ChoiceListInterface /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForValues(array $values) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + if (!$this->choiceList) { $this->load(); } diff --git a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php index 398ae3ddd1..c7fb9ad1a8 100644 --- a/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php +++ b/src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php @@ -187,10 +187,12 @@ class ObjectChoiceList extends ChoiceList /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function getIndicesForChoices(array $choices) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + if (!$this->valuePath) { return parent::getIndicesForChoices($choices); } diff --git a/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php b/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php index 7587086ea1..45159b9313 100644 --- a/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php +++ b/src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php @@ -76,21 +76,21 @@ class NumberToLocalizedStringTransformer implements DataTransformerInterface /** * Alias for {@link self::ROUND_HALF_EVEN}. * - * @deprecated Deprecated as of Symfony 2.4, to be removed in Symfony 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ const ROUND_HALFEVEN = Deprecated::ROUND_HALFEVEN; /** * Alias for {@link self::ROUND_HALF_UP}. * - * @deprecated Deprecated as of Symfony 2.4, to be removed in Symfony 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ const ROUND_HALFUP = Deprecated::ROUND_HALFUP; /** * Alias for {@link self::ROUND_HALF_DOWN}. * - * @deprecated Deprecated as of Symfony 2.4, to be removed in Symfony 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ const ROUND_HALFDOWN = Deprecated::ROUND_HALFDOWN; diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/FixCheckboxInputListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/FixCheckboxInputListener.php index 8e72b04137..b201802fbc 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/FixCheckboxInputListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/FixCheckboxInputListener.php @@ -81,11 +81,13 @@ class FixCheckboxInputListener implements EventSubscriberInterface /** * Alias of {@link preSubmit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link preSubmit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link preSubmit()} instead. */ public function preBind(FormEvent $event) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the preSubmit() method instead.', E_USER_DEPRECATED); + $this->preSubmit($event); } diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/FixRadioInputListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/FixRadioInputListener.php index a3e27d57e3..c5f871756b 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/FixRadioInputListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/FixRadioInputListener.php @@ -63,11 +63,13 @@ class FixRadioInputListener implements EventSubscriberInterface /** * Alias of {@link preSubmit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link preSubmit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link preSubmit()} instead. */ public function preBind(FormEvent $event) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the preSubmit() method instead.', E_USER_DEPRECATED); + $this->preSubmit($event); } diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php index 4a5a1df6af..50e60d8287 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/FixUrlProtocolListener.php @@ -46,11 +46,13 @@ class FixUrlProtocolListener implements EventSubscriberInterface /** * Alias of {@link onSubmit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link onSubmit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link onSubmit()} instead. */ public function onBind(FormEvent $event) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the onSubmit() method instead.', E_USER_DEPRECATED); + $this->onSubmit($event); } diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php index a14f99a985..ef8dffed7b 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php @@ -129,11 +129,13 @@ class MergeCollectionListener implements EventSubscriberInterface /** * Alias of {@link onSubmit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link onSubmit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link onSubmit()} instead. */ public function onBind(FormEvent $event) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the onSubmit() method instead.', E_USER_DEPRECATED); + $this->onSubmit($event); } } diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php index 043cc27597..97aba300b9 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -184,22 +184,26 @@ class ResizeFormListener implements EventSubscriberInterface /** * Alias of {@link preSubmit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link preSubmit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link preSubmit()} instead. */ public function preBind(FormEvent $event) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the preSubmit() method instead.', E_USER_DEPRECATED); + $this->preSubmit($event); } /** * Alias of {@link onSubmit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link onSubmit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link onSubmit()} instead. */ public function onBind(FormEvent $event) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the onSubmit() method instead.', E_USER_DEPRECATED); + $this->onSubmit($event); } } diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php index eaec5c163b..dd64a53ece 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/TrimListener.php @@ -40,11 +40,13 @@ class TrimListener implements EventSubscriberInterface /** * Alias of {@link preSubmit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link preSubmit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link preSubmit()} instead. */ public function preBind(FormEvent $event) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the preSubmit() method instead.', E_USER_DEPRECATED); + $this->preSubmit($event); } diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderAdapter.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderAdapter.php index 642d60af44..b70a8e823d 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderAdapter.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderAdapter.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider; -trigger_error('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter was deprecated in version 2.4 and will be removed in version 3.0. Please use Symfony\Component\Security\Csrf\CsrfTokenManager instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\CsrfProviderAdapter class is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead.', E_USER_DEPRECATED); use Symfony\Component\Form\Exception\BadMethodCallException; use Symfony\Component\Security\Csrf\CsrfToken; @@ -24,7 +24,7 @@ use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; * @since 2.4 * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.4, to be removed in Symfony 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ class CsrfProviderAdapter implements CsrfTokenManagerInterface { diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php index 260134d5c0..dd5b1fce1f 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfProviderInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider; -trigger_error('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderInterface was deprecated in version 2.4 and will be removed in version 3.0. Please use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface instead.', E_USER_DEPRECATED); - /** * Marks classes able to provide CSRF protection. * @@ -29,9 +27,8 @@ trigger_error('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderIn * * @author Bernhard Schussek * - * @deprecated since version 2.4, to be removed in Symfony 3.0. Use - * {@link \Symfony\Component\Security\Csrf\CsrfTokenManagerInterface} - * instead. + * @deprecated since version 2.4, to be removed in 3.0. + * Use {@link \Symfony\Component\Security\Csrf\CsrfTokenManagerInterface} instead. */ interface CsrfProviderInterface { diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.php index b7db6fa4f6..c16cc29152 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/CsrfTokenManagerAdapter.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider; -trigger_error('Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfTokenManagerAdapter was deprecated in version 2.4 and will be removed in version 3.0. Please use Symfony\Component\Security\Csrf\CsrfTokenManager instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\CsrfTokenManagerAdapter is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead.', E_USER_DEPRECATED); use Symfony\Component\Security\Csrf\CsrfToken; use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; @@ -22,7 +22,7 @@ use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface; * @since 2.4 * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.4, to be removed in Symfony 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ class CsrfTokenManagerAdapter implements CsrfProviderInterface { diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php index aefc406d7b..520edbd47e 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/DefaultCsrfProvider.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider; -trigger_error('Symfony\Component\Security\Csrf\CsrfTokenManager was deprecated in version 2.4 and will be removed in version 3.0. Please use \Symfony\Component\Security\Csrf\TokenStorage\NativeSessionTokenStorage instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\DefaultCsrfProvider is deprecated since version 2.4 and will be removed in version 3.0. Use the \Symfony\Component\Security\Csrf\TokenStorage\NativeSessionTokenStorage class instead.', E_USER_DEPRECATED); /** * Default implementation of CsrfProviderInterface. @@ -21,8 +21,8 @@ trigger_error('Symfony\Component\Security\Csrf\CsrfTokenManager was deprecated i * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.4, to be removed in Symfony 3.0. Use - * {@link \Symfony\Component\Security\Csrf\CsrfTokenManager} in + * @deprecated since version 2.4, to be removed in 3.0. + * Use {@link \Symfony\Component\Security\Csrf\CsrfTokenManager} in * combination with {@link \Symfony\Component\Security\Csrf\TokenStorage\NativeSessionTokenStorage} * instead. */ diff --git a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php index 91e4897b5a..6159071352 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php +++ b/src/Symfony/Component/Form/Extension/Csrf/CsrfProvider/SessionCsrfProvider.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Form\Extension\Csrf\CsrfProvider; -trigger_error('Symfony\Component\Security\Csrf\CsrfTokenManager was deprecated in version 2.4 and will be removed in version 3.0. Please use Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\SessionCsrfProvider is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage class instead.', E_USER_DEPRECATED); use Symfony\Component\HttpFoundation\Session\Session; @@ -23,8 +23,8 @@ use Symfony\Component\HttpFoundation\Session\Session; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.4, to be removed in Symfony 3.0. Use - * {@link \Symfony\Component\Security\Csrf\CsrfTokenManager} in + * @deprecated since version 2.4, to be removed in 3.0. + * Use {@link \Symfony\Component\Security\Csrf\CsrfTokenManager} in * combination with {@link \Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage} * instead. */ diff --git a/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php b/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php index c6a467eb05..bdc02b5ad2 100644 --- a/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php +++ b/src/Symfony/Component/Form/Extension/Csrf/EventListener/CsrfValidationListener.php @@ -118,11 +118,13 @@ class CsrfValidationListener implements EventSubscriberInterface /** * Alias of {@link preSubmit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link preSubmit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link preSubmit()} instead. */ public function preBind(FormEvent $event) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the preSubmit() method instead.', E_USER_DEPRECATED); + $this->preSubmit($event); } } diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/Deprecated/Form.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/Deprecated/Form.php new file mode 100644 index 0000000000..d513269ef3 --- /dev/null +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/Deprecated/Form.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Form\Extension\Validator\Constraints\Deprecated; + +trigger_error('Constant ERR_INVALID in class Symfony\Component\Form\Extension\Validator\Constraints\Form is deprecated since version 2.6 and will be removed in 3.0. Use NOT_SYNCHRONIZED_ERROR constant instead.', E_USER_DEPRECATED); + +/** + * @deprecated since version 2.7, to be removed in 3.0. + * @internal + */ +final class Form +{ + const ERR_INVALID = 1; + + private function __construct() + { + } +} diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php index da1a92b5e4..1f48d702e0 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/Form.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Form\Extension\Validator\Constraints; +use Symfony\Component\Form\Extension\Validator\Constraints\Deprecated\Form as Deprecated; use Symfony\Component\Validator\Constraint; /** @@ -22,10 +23,10 @@ class Form extends Constraint const NO_SUCH_FIELD_ERROR = 2; /** - * @deprecated Deprecated since Symfony 2.6, to be removed in 3.0. Use - * {@self NOT_SYNCHRONIZED_ERROR} instead. + * @deprecated since version 2.6, to be removed in 3.0. + * Use {@self NOT_SYNCHRONIZED_ERROR} instead. */ - const ERR_INVALID = 1; + const ERR_INVALID = Deprecated::ERR_INVALID; protected static $errorNames = array( self::NOT_SYNCHRONIZED_ERROR => 'NOT_SYNCHRONIZED_ERROR', diff --git a/src/Symfony/Component/Form/Form.php b/src/Symfony/Component/Form/Form.php index 8e05f1a9f8..99d25c2ef0 100644 --- a/src/Symfony/Component/Form/Form.php +++ b/src/Symfony/Component/Form/Form.php @@ -507,7 +507,7 @@ class Form implements \IteratorAggregate, FormInterface public function submit($submittedData, $clearMissing = true) { if ($submittedData instanceof Request) { - trigger_error('Passing a Symfony\Component\HttpFoundation\Request object to '.__CLASS__.'::bind() and '.__METHOD__.'() is deprecated since 2.3 and will be removed in 3.0, please use '.__CLASS__.'::handleRequest(). If you want to test whether the form was submitted separately, you can use the method '.__CLASS__.'::isSubmitted()', E_USER_DEPRECATED); + trigger_error('Passing a Symfony\Component\HttpFoundation\Request object to the '.__CLASS__.'::bind and '.__METHOD__.' methods is deprecated since 2.3 and will be removed in 3.0. Use the '.__CLASS__.'::handleRequest method instead. If you want to test whether the form was submitted separately, you can use the '.__CLASS__.'::isSubmitted method.', E_USER_DEPRECATED); } if ($this->submitted) { @@ -676,15 +676,15 @@ class Form implements \IteratorAggregate, FormInterface /** * Alias of {@link submit()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link submit()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link submit()} instead. */ public function bind($submittedData) { // This method is deprecated for Request too, but the error is // triggered in Form::submit() method. if (!$submittedData instanceof Request) { - trigger_error(__METHOD__.'() is deprecated since 2.3 and will be removed in 3.0. Please use '.__CLASS__.'::submit() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the '.__CLASS__.'::submit method instead.', E_USER_DEPRECATED); } return $this->submit($submittedData); @@ -719,12 +719,12 @@ class Form implements \IteratorAggregate, FormInterface /** * Alias of {@link isSubmitted()}. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link isSubmitted()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link isSubmitted()} instead. */ public function isBound() { - trigger_error(__METHOD__.'() is deprecated since 2.3 and will be removed in 3.0. Please use '.__CLASS__.'::isSubmitted() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the '.__CLASS__.'::isSubmitted method instead.', E_USER_DEPRECATED); return $this->submitted; } @@ -843,12 +843,12 @@ class Form implements \IteratorAggregate, FormInterface * * @return string A string representation of all errors * - * @deprecated Deprecated since version 2.5, to be removed in 3.0. Use - * {@link getErrors()} instead and cast the result to a string. + * @deprecated since version 2.5, to be removed in 3.0. + * Use {@link getErrors()} instead and cast the result to a string. */ public function getErrorsAsString($level = 0) { - trigger_error('Form::getErrorsAsString() is deprecated since 2.5 and will be removed in 3.0. Please use Form::getErrors(true, false) instead and cast the result to a string.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the Form::getErrors(true, false) method instead and cast the result to a string.', E_USER_DEPRECATED); return self::indent((string) $this->getErrors(true, false), $level); } diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index 8ebfd543b9..381a9acabf 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -351,12 +351,12 @@ class FormConfigBuilder implements FormConfigBuilderInterface * * @return FormConfigBuilder The configuration object. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link getInheritData()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link getInheritData()} instead. */ public function getVirtual() { - trigger_error('FormConfigBuilder::getVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use FormConfigBuilder::getInheritData() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the FormConfigBuilder::getInheritData() method instead.', E_USER_DEPRECATED); return $this->getInheritData(); } @@ -717,12 +717,12 @@ class FormConfigBuilder implements FormConfigBuilderInterface * * @return FormConfigBuilder The configuration object. * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link setInheritData()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link setInheritData()} instead. */ public function setVirtual($inheritData) { - trigger_error('FormConfigBuilder::setVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use FormConfigBuilder::setInheritData() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the FormConfigBuilder::setInheritData() method instead.', E_USER_DEPRECATED); $this->setInheritData($inheritData); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php index 35f615415e..23f873466f 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/TypeTestCase.php @@ -14,13 +14,14 @@ namespace Symfony\Component\Form\Tests\Extension\Core\Type; use Symfony\Component\Form\Test\TypeTestCase as BaseTypeTestCase; /** - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use Symfony\Component\Form\Test\TypeTestCase instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Form\Test\TypeTestCase} instead. */ abstract class TypeTestCase extends BaseTypeTestCase { protected function setUp() { - trigger_error('Abstract class "Symfony\Component\Form\Tests\Extension\Core\Type\TypeTestCase" is deprecated since version 2.3 and will be removed in 3.0. Use "Symfony\Component\Form\Test\TypeTestCase" instead.', E_USER_DEPRECATED); + trigger_error('Abstract class '.__CLASS__.' is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Test\TypeTestCase class instead.', E_USER_DEPRECATED); parent::setUp(); } } diff --git a/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php b/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php index e9e16640d8..0ebb90ea0c 100644 --- a/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php +++ b/src/Symfony/Component/Form/Tests/FormIntegrationTestCase.php @@ -14,7 +14,8 @@ namespace Symfony\Component\Form\Tests; use Symfony\Component\Form\Test\FormIntegrationTestCase as BaseFormIntegrationTestCase; /** - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use Symfony\Component\Form\Test\FormIntegrationTestCase instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Form\Test\FormIntegrationTestCase} instead. */ abstract class FormIntegrationTestCase extends BaseFormIntegrationTestCase { @@ -23,7 +24,7 @@ abstract class FormIntegrationTestCase extends BaseFormIntegrationTestCase */ protected function setUp() { - trigger_error('This class is deprecated. Use Symfony\Component\Form\Test\FormIntegrationTestCase instead.', E_USER_DEPRECATED); + trigger_error('The '.__CLASS__.' class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Test\FormIntegrationTestCase class instead.', E_USER_DEPRECATED); parent::setUp(); } } diff --git a/src/Symfony/Component/Form/Tests/FormPerformanceTestCase.php b/src/Symfony/Component/Form/Tests/FormPerformanceTestCase.php index 72054b9a27..15ba930371 100644 --- a/src/Symfony/Component/Form/Tests/FormPerformanceTestCase.php +++ b/src/Symfony/Component/Form/Tests/FormPerformanceTestCase.php @@ -14,7 +14,8 @@ namespace Symfony\Component\Form\Tests; use Symfony\Component\Form\Test\FormPerformanceTestCase as BaseFormPerformanceTestCase; /** - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use Symfony\Component\Form\Test\FormPerformanceTestCase instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Form\Test\FormPerformanceTestCase} instead. */ abstract class FormPerformanceTestCase extends BaseFormPerformanceTestCase { @@ -23,7 +24,7 @@ abstract class FormPerformanceTestCase extends BaseFormPerformanceTestCase */ protected function setUp() { - trigger_error('This class is deprecated. Use Symfony\Component\Form\Test\FormPerformanceTestCase instead.', E_USER_DEPRECATED); + trigger_error('The '.__CLASS__.' class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Test\FormPerformanceTestCase class instead.', E_USER_DEPRECATED); parent::setUp(); } } diff --git a/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php b/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php index d49ba78fc0..3e5965e596 100644 --- a/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php +++ b/src/Symfony/Component/Form/Util/VirtualFormAwareIterator.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Form\Util; -trigger_error('Symfony\Component\Form\Util\VirtualFormAwareIterator is deprecated since Symfony 2.3 and will be removed in 3.0. Use Symfony\Component\Form\Util\InheritDataAwareIterator instead.', E_USER_DEPRECATED); - /** * Iterator that traverses an array of forms. * @@ -22,11 +20,26 @@ trigger_error('Symfony\Component\Form\Util\VirtualFormAwareIterator is deprecate * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link InheritDataAwareIterator} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link InheritDataAwareIterator} instead. */ class VirtualFormAwareIterator extends \IteratorIterator implements \RecursiveIterator { + 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 (__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); + } + + parent::__construct($iterator); + } + /** * {@inheritdoc} */ diff --git a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php index ac412d7dc8..bbe7561be7 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php +++ b/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php @@ -169,12 +169,14 @@ class FlashBag implements FlashBagInterface, \IteratorAggregate /** * Returns an iterator for flashes. * - * @deprecated Will be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. * * @return \ArrayIterator An \ArrayIterator instance */ public function getIterator() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + return new \ArrayIterator($this->all()); } } diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php index df31832701..fd0c58275d 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/LegacyPdoSessionHandler.php @@ -11,6 +11,8 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; +trigger_error('The '.__NAMESPACE__.'\LegacyPdoSessionHandler class is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler class instead.', E_USER_DEPRECATED); + /** * Session handler using a PDO connection to read and write data. * @@ -24,7 +26,7 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; * @author Michael Williams * @author Tobias Schultze * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use + * @deprecated since version 2.6, to be removed in 3.0. Use * {@link PdoSessionHandler} instead. */ class LegacyPdoSessionHandler implements \SessionHandlerInterface @@ -77,8 +79,6 @@ class LegacyPdoSessionHandler implements \SessionHandlerInterface throw new \InvalidArgumentException(sprintf('"%s" requires PDO error mode attribute be set to throw Exceptions (i.e. $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION))', __CLASS__)); } - trigger_error('"Symfony\Component\HttpFoundation\Session\Storage\Handler\LegacyPdoSessionHandler" is deprecated since version 2.6 and will be removed in 3.0. Use "Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler" instead.', E_USER_DEPRECATED); - $this->pdo = $pdo; $dbOptions = array_merge(array( 'db_id_col' => 'sess_id', diff --git a/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php b/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php index 02df5242bf..0a82d76525 100644 --- a/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php +++ b/src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php @@ -34,10 +34,11 @@ class TraceableEventDispatcher extends BaseTraceableEventDispatcher * * @param Profiler|null $profiler A Profiler instance * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function setProfiler(Profiler $profiler = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); } /** diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php b/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php index 15dffb035d..386476b3c9 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterListenersPass.php @@ -11,14 +11,14 @@ namespace Symfony\Component\HttpKernel\DependencyInjection; -trigger_error('Class "Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass" is deprecated since 2.5 and will be removed in 3.0. Use "Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass" instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\RegisterListenersPass is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass class instead.', E_USER_DEPRECATED); use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass as BaseRegisterListenersPass; /** * Compiler pass to register tagged services for an event dispatcher. * - * @deprecated Deprecated in 2.5, to be removed in 3.0. Use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass instead. + * @deprecated since version 2.5, to be removed in 3.0. Use the Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass class instead. */ class RegisterListenersPass extends BaseRegisterListenersPass { diff --git a/src/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php b/src/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php index d5400b7d6e..230a949436 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ErrorsLoggerListener.php @@ -11,6 +11,8 @@ namespace Symfony\Component\HttpKernel\EventListener; +trigger_error('The '.__NAMESPACE__.'\ErrorsLoggerListener class is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\HttpKernel\EventListener\DebugHandlersListener class instead.', E_USER_DEPRECATED); + use Psr\Log\LoggerInterface; use Symfony\Component\Debug\ErrorHandler; use Symfony\Component\EventDispatcher\EventSubscriberInterface; @@ -22,12 +24,11 @@ use Symfony\Component\HttpKernel\KernelEvents; * @author Colin Frei * @author Konstantin Myakshin * - * @deprecated since 2.6, to be removed in 3.0. Use DebugHandlersListener instead. + * @deprecated since version 2.6, to be removed in 3.0. Use the DebugHandlersListener class instead. */ class ErrorsLoggerListener implements EventSubscriberInterface { private $channel; - private $logger; public function __construct($channel, LoggerInterface $logger = null) diff --git a/src/Symfony/Component/HttpKernel/EventListener/EsiListener.php b/src/Symfony/Component/HttpKernel/EventListener/EsiListener.php index 6380169017..9bede00564 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/EsiListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/EsiListener.php @@ -11,12 +11,14 @@ namespace Symfony\Component\HttpKernel\EventListener; +trigger_error('The '.__NAMESPACE__.'\EsiListener class is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\HttpKernel\EventListener\SurrogateListener class instead.', E_USER_DEPRECATED); + /** * EsiListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for ESI. * * @author Fabien Potencier * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use SurrogateListener instead + * @deprecated since version 2.6, to be removed in 3.0. Use SurrogateListener instead */ class EsiListener extends SurrogateListener { diff --git a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php index 5b0ec0ec50..46c298e1b8 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php @@ -116,7 +116,7 @@ class ExceptionListener implements EventSubscriberInterface 'logger' => $this->logger instanceof DebugLoggerInterface ? $this->logger : null, // keep for BC -- as $format can be an argument of the controller callable // see src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php - // @deprecated in 2.4, to be removed in 3.0 + // @deprecated since version 2.4, to be removed in 3.0 'format' => $request->getRequestFormat(), ); $request = $request->duplicate(null, null, $attributes); diff --git a/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php b/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php index d0a2298d1f..3309c2bef9 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/FragmentListener.php @@ -88,12 +88,14 @@ class FragmentListener implements EventSubscriberInterface } /** - * @deprecated Deprecated since 2.3.19, to be removed in 3.0. + * @deprecated since version 2.3.19, to be removed in 3.0. * * @return string[] */ protected function getLocalIpAddresses() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3.19 and will be removed in 3.0.', E_USER_DEPRECATED); + return array('127.0.0.1', 'fe80::1', '::1'); } diff --git a/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php b/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php index bdcf4c7644..ef3911694a 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/LocaleListener.php @@ -54,10 +54,12 @@ class LocaleListener implements EventSubscriberInterface * * @param Request|null $request A Request instance * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function setRequest(Request $request = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + if (null === $request) { return; } diff --git a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php index 43d8d03a7f..781475a992 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php @@ -22,7 +22,7 @@ use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** - * ProfilerListener collects data for the current request by listening to the onKernelResponse event. + * ProfilerListener collects data for the current request by listening to the kernel events. * * @author Fabien Potencier */ @@ -49,6 +49,13 @@ class ProfilerListener implements EventSubscriberInterface */ public function __construct(Profiler $profiler, RequestMatcherInterface $matcher = null, $onlyException = false, $onlyMasterRequests = false, RequestStack $requestStack = null) { + if (null === $requestStack) { + // Prevent the deprecation notice to be triggered all the time. + // The onKernelRequest() method fires some logic only when the + // RequestStack instance is not provided as a dependency. + trigger_error('Since version 2.4, the '.__METHOD__.' method must accept a RequestStack instance to get the request instead of using the '.__CLASS__.'::onKernelRequest method that will be removed in 3.0.', E_USER_DEPRECATED); + } + $this->profiler = $profiler; $this->matcher = $matcher; $this->onlyException = (bool) $onlyException; @@ -73,7 +80,7 @@ class ProfilerListener implements EventSubscriberInterface } /** - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function onKernelRequest(GetResponseEvent $event) { diff --git a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php index e82cde3c02..a116e55e88 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php @@ -67,6 +67,10 @@ class RouterListener implements EventSubscriberInterface throw new \InvalidArgumentException('You must either pass a RequestContext or the matcher must implement RequestContextAwareInterface.'); } + if (!$requestStack instanceof RequestStack) { + trigger_error('The '.__METHOD__.' method now requires a RequestStack instance as '.__CLASS__.'::setRequest method will not be supported anymore in 3.0.'); + } + $this->matcher = $matcher; $this->context = $context ?: $matcher->getContext(); $this->requestStack = $requestStack; @@ -82,13 +86,21 @@ class RouterListener implements EventSubscriberInterface * * @param Request|null $request A Request instance * - * @deprecated Deprecated since version 2.4, to be moved to a private function in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function setRequest(Request $request = null) + { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be made private in 3.0.', E_USER_DEPRECATED); + + $this->setCurrentRequest($request); + } + + private function setCurrentRequest(Request $request = null) { if (null !== $request && $this->request !== $request) { $this->context->fromRequest($request); } + $this->request = $request; } @@ -98,7 +110,7 @@ class RouterListener implements EventSubscriberInterface return; // removed when requestStack is required } - $this->setRequest($this->requestStack->getParentRequest()); + $this->setCurrentRequest($this->requestStack->getParentRequest()); } public function onKernelRequest(GetResponseEvent $event) @@ -106,11 +118,11 @@ class RouterListener implements EventSubscriberInterface $request = $event->getRequest(); // initialize the context that is also used by the generator (assuming matcher and generator share the same context instance) - // we call setRequest even if most of the time, it has already been done to keep compatibility + // we call setCurrentRequest even if most of the time, it has already been done to keep compatibility // with frameworks which do not use the Symfony service container // when we have a RequestStack, no need to do it if (null !== $this->requestStack) { - $this->setRequest($request); + $this->setCurrentRequest($request); } if ($request->attributes->has('_controller')) { diff --git a/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php b/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php index 332916518f..04f927313b 100644 --- a/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php +++ b/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php @@ -11,13 +11,13 @@ namespace Symfony\Component\HttpKernel\Exception; -trigger_error('Symfony\Component\HttpKernel\Exception\FatalErrorException is deprecated since version 2.3 and will be removed in 3.0. Use the same class from the Debug component instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\FatalErrorException class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Debug\Exception\FatalErrorException class instead.', E_USER_DEPRECATED); /** * Fatal Error Exception. * * @author Konstanton Myakshin * - * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. + * @deprecated since version 2.3, to be removed in 3.0. Use the same class from the Debug component instead. */ class_exists('Symfony\Component\Debug\Exception\FatalErrorException'); diff --git a/src/Symfony/Component/HttpKernel/Exception/FlattenException.php b/src/Symfony/Component/HttpKernel/Exception/FlattenException.php index 0089012b96..70be1ec8a1 100644 --- a/src/Symfony/Component/HttpKernel/Exception/FlattenException.php +++ b/src/Symfony/Component/HttpKernel/Exception/FlattenException.php @@ -11,7 +11,7 @@ namespace Symfony\Component\HttpKernel\Exception; -trigger_error('Symfony\Component\HttpKernel\Exception\FlattenException is deprecated since version 2.3 and will be removed in 3.0. Use the same class from the Debug component instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\FlattenException class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Debug\Exception\FlattenException class instead.', E_USER_DEPRECATED); /** * FlattenException wraps a PHP Exception to be able to serialize it. @@ -20,6 +20,6 @@ trigger_error('Symfony\Component\HttpKernel\Exception\FlattenException is deprec * * @author Fabien Potencier * - * @deprecated Deprecated in 2.3, to be removed in 3.0. Use the same class from the Debug component instead. + * @deprecated since version 2.3, to be removed in 3.0. Use the same class from the Debug component instead. */ class_exists('Symfony\Component\Debug\Exception\FlattenException'); diff --git a/src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php b/src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php index 27fa7eabec..eae715e8ac 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php +++ b/src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php @@ -76,10 +76,12 @@ class FragmentHandler * * @param Request|null $request A Request instance * - * @deprecated Deprecated since version 2.4, to be removed in 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public function setRequest(Request $request = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED); + $this->request = $request; } diff --git a/src/Symfony/Component/HttpKernel/HttpCache/Esi.php b/src/Symfony/Component/HttpKernel/HttpCache/Esi.php index ad8382e552..952021dcf5 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/Esi.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/Esi.php @@ -75,10 +75,12 @@ class Esi implements SurrogateInterface * * @return bool true if one surrogate has ESI/1.0 capability, false otherwise * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use hasSurrogateCapability() instead + * @deprecated since version 2.6, to be removed in 3.0. Use hasSurrogateCapability() instead */ public function hasSurrogateEsiCapability(Request $request) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the hasSurrogateCapability() method instead.', E_USER_DEPRECATED); + if (null === $value = $request->headers->get('Surrogate-Capability')) { return false; } @@ -101,10 +103,12 @@ class Esi implements SurrogateInterface * * @param Request $request A Request instance * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use addSurrogateCapability() instead + * @deprecated since version 2.6, to be removed in 3.0. Use addSurrogateCapability() instead */ public function addSurrogateEsiCapability(Request $request) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the addSurrogateCapability() method instead.', E_USER_DEPRECATED); + $current = $request->headers->get('Surrogate-Capability'); $new = 'symfony2="ESI/1.0"'; @@ -144,10 +148,12 @@ class Esi implements SurrogateInterface * * @return bool true if the Response needs to be parsed, false otherwise * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use needsParsing() instead + * @deprecated since version 2.6, to be removed in 3.0. Use needsParsing() instead */ public function needsEsiParsing(Response $response) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the needsParsing() method instead.', E_USER_DEPRECATED); + if (!$control = $response->headers->get('Surrogate-Control')) { return false; } diff --git a/src/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php b/src/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php index 1bef147595..0d855464a3 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php @@ -15,6 +15,8 @@ namespace Symfony\Component\HttpKernel\HttpCache; +trigger_error('The '.__NAMESPACE__.'\EsiResponseCacheStrategy class is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\HttpKernel\HttpCache\ResponseCacheStrategy class instead.', E_USER_DEPRECATED); + /** * EsiResponseCacheStrategy knows how to compute the Response cache HTTP header * based on the different ESI response cache headers. @@ -24,7 +26,7 @@ namespace Symfony\Component\HttpKernel\HttpCache; * * @author Fabien Potencier * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use ResponseCacheStrategy instead + * @deprecated since version 2.6, to be removed in 3.0. Use ResponseCacheStrategy instead */ class EsiResponseCacheStrategy extends ResponseCacheStrategy implements EsiResponseCacheStrategyInterface { diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 83a7e4e3e9..b6ccafc188 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -170,10 +170,12 @@ class HttpCache implements HttpKernelInterface, TerminableInterface * * @return Esi An Esi instance * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use getSurrogate() instead + * @deprecated since version 2.6, to be removed in 3.0. Use getSurrogate() instead */ public function getEsi() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the getSurrogate() method instead.', E_USER_DEPRECATED); + if (!$this->surrogate instanceof Esi) { throw new \LogicException('This instance of HttpCache was not set up to use ESI as surrogate handler. You must overwrite and use createSurrogate'); } diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 99c4a5a060..123301342a 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -215,35 +215,9 @@ abstract class Kernel implements KernelInterface, TerminableInterface } /** - * Returns the file path for a given resource. + * {@inheritDoc} * - * A Resource can be a file or a directory. - * - * The resource name must follow the following pattern: - * - * @/path/to/a/file.something - * - * where BundleName is the name of the bundle - * and the remaining part is the relative path in the bundle. - * - * If $dir is passed, and the first segment of the path is "Resources", - * this method will look for a file named: - * - * $dir//path/without/Resources - * - * before looking in the bundle resource folder. - * - * @param string $name A resource name to locate - * @param string $dir A directory where to look for the resource first - * @param bool $first Whether to return the first path or paths for all matching bundles - * - * @return string|array The absolute path of the resource or an array if $first is false - * - * @throws \InvalidArgumentException if the file cannot be found or the name is not valid - * @throws \RuntimeException if the name contains invalid/unsafe - * @throws \RuntimeException if a custom resource is hidden by a resource in a derived bundle - * - * @api + * @throws \RuntimeException if a custom resource is hidden by a resource in a derived bundle */ public function locateResource($name, $dir = null, $first = true) { diff --git a/src/Symfony/Component/HttpKernel/KernelInterface.php b/src/Symfony/Component/HttpKernel/KernelInterface.php index f691ddde8d..fb7b5ee6c0 100644 --- a/src/Symfony/Component/HttpKernel/KernelInterface.php +++ b/src/Symfony/Component/HttpKernel/KernelInterface.php @@ -90,15 +90,17 @@ interface KernelInterface extends HttpKernelInterface, \Serializable * * The resource name must follow the following pattern: * - * @BundleName/path/to/a/file.something + * "@BundleName/path/to/a/file.something" * * where BundleName is the name of the bundle * and the remaining part is the relative path in the bundle. * - * If $dir is passed, and the first segment of the path is Resources, + * If $dir is passed, and the first segment of the path is "Resources", * this method will look for a file named: * - * $dir/BundleName/path/without/Resources + * $dir//path/without/Resources + * + * before looking in the bundle resource folder. * * @param string $name A resource name to locate * @param string $dir A directory where to look for the resource first diff --git a/src/Symfony/Component/HttpKernel/Log/LoggerInterface.php b/src/Symfony/Component/HttpKernel/Log/LoggerInterface.php index 4681dabb1f..737ba4e0f6 100644 --- a/src/Symfony/Component/HttpKernel/Log/LoggerInterface.php +++ b/src/Symfony/Component/HttpKernel/Log/LoggerInterface.php @@ -27,28 +27,28 @@ interface LoggerInterface extends PsrLogger /** * @api * - * @deprecated since 2.2, to be removed in 3.0. Use emergency() which is PSR-3 compatible. + * @deprecated since version 2.2, to be removed in 3.0. Use emergency() which is PSR-3 compatible. */ public function emerg($message, array $context = array()); /** * @api * - * @deprecated since 2.2, to be removed in 3.0. Use critical() which is PSR-3 compatible. + * @deprecated since version 2.2, to be removed in 3.0. Use critical() which is PSR-3 compatible. */ public function crit($message, array $context = array()); /** * @api * - * @deprecated since 2.2, to be removed in 3.0. Use error() which is PSR-3 compatible. + * @deprecated since version 2.2, to be removed in 3.0. Use error() which is PSR-3 compatible. */ public function err($message, array $context = array()); /** * @api * - * @deprecated since 2.2, to be removed in 3.0. Use warning() which is PSR-3 compatible. + * @deprecated since version 2.2, to be removed in 3.0. Use warning() which is PSR-3 compatible. */ public function warn($message, array $context = array()); } diff --git a/src/Symfony/Component/HttpKernel/Log/NullLogger.php b/src/Symfony/Component/HttpKernel/Log/NullLogger.php index ec253e0213..0b2bb4253c 100644 --- a/src/Symfony/Component/HttpKernel/Log/NullLogger.php +++ b/src/Symfony/Component/HttpKernel/Log/NullLogger.php @@ -11,6 +11,8 @@ namespace Symfony\Component\HttpKernel\Log; +trigger_error('The '.__NAMESPACE__.'\NullLogger class is deprecated since version 2.2 and will be removed in 3.0. Use the Psr\Log\NullLogger class instead from the psr/log Composer package.'); + use Psr\Log\NullLogger as PsrNullLogger; /** @@ -24,41 +26,33 @@ class NullLogger extends PsrNullLogger implements LoggerInterface { /** * @api - * - * @deprecated since 2.2, to be removed in 3.0. Use emergency() which is PSR-3 compatible. */ public function emerg($message, array $context = array()) { - trigger_error('The emerg() method of the NullLogger was removed. You should use the new method emergency() instead, which is PSR-3 compatible.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. You should use the new emergency() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); } /** * @api - * - * @deprecated since 2.2, to be removed in 3.0. Use critical() which is PSR-3 compatible. */ public function crit($message, array $context = array()) { - trigger_error('The crit() method of the NullLogger was removed. You should use the new method critical() instead, which is PSR-3 compatible.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. You should use the new critical() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); } /** * @api - * - * @deprecated since 2.2, to be removed in 3.0. Use error() which is PSR-3 compatible. */ public function err($message, array $context = array()) { - trigger_error('The err() method of the NullLogger was removed. You should use the new method error() instead, which is PSR-3 compatible.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. You should use the new error() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); } /** * @api - * - * @deprecated since 2.2, to be removed in 3.0. Use warning() which is PSR-3 compatible. */ public function warn($message, array $context = array()) { - trigger_error('The warn() method of the NullLogger was removed. You should use the new method warning() instead, which is PSR-3 compatible.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. You should use the new warning() method instead, which is PSR-3 compatible.', E_USER_DEPRECATED); } } diff --git a/src/Symfony/Component/Locale/Exception/MethodArgumentNotImplementedException.php b/src/Symfony/Component/Locale/Exception/MethodArgumentNotImplementedException.php index e818c9845f..d94d61c4e6 100644 --- a/src/Symfony/Component/Locale/Exception/MethodArgumentNotImplementedException.php +++ b/src/Symfony/Component/Locale/Exception/MethodArgumentNotImplementedException.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Exception; +trigger_error('The '.__NAMESPACE__.'\MethodArgumentNotImplementedException class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException as BaseMethodArgumentNotImplementedException; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException as Ba * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\Exception\MethodArgumentNotImplementedException} * instead. */ class MethodArgumentNotImplementedException extends BaseMethodArgumentNotImplementedException diff --git a/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php b/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php index 2b3e0a8c25..171487a10a 100644 --- a/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php +++ b/src/Symfony/Component/Locale/Exception/MethodArgumentValueNotImplementedException.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Exception; +trigger_error('The '.__NAMESPACE__.'\MethodArgumentValueNotImplementedException class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException as BaseMethodArgumentValueNotImplementedException; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\Exception\MethodArgumentValueNotImplementedException} * instead. */ class MethodArgumentValueNotImplementedException extends BaseMethodArgumentValueNotImplementedException diff --git a/src/Symfony/Component/Locale/Exception/MethodNotImplementedException.php b/src/Symfony/Component/Locale/Exception/MethodNotImplementedException.php index 205c4517f0..1ebcc4809d 100644 --- a/src/Symfony/Component/Locale/Exception/MethodNotImplementedException.php +++ b/src/Symfony/Component/Locale/Exception/MethodNotImplementedException.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Exception; +trigger_error('The '.__NAMESPACE__.'\MethodNotImplementedException class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\Exception\MethodNotImplementedException class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\Exception\MethodNotImplementedException as BaseMethodNotImplementedException; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\Exception\MethodNotImplementedException as BaseMethod * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\Exception\MethodNotImplementedException} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\Exception\MethodNotImplementedException} * instead. */ class MethodNotImplementedException extends BaseMethodNotImplementedException diff --git a/src/Symfony/Component/Locale/Exception/NotImplementedException.php b/src/Symfony/Component/Locale/Exception/NotImplementedException.php index 555f991b24..885c9e56f1 100644 --- a/src/Symfony/Component/Locale/Exception/NotImplementedException.php +++ b/src/Symfony/Component/Locale/Exception/NotImplementedException.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Exception; +trigger_error('The '.__NAMESPACE__.'\NotImplementedException class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\Exception\NotImplementedException class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\Exception\NotImplementedException as BaseNotImplementedException; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\Exception\NotImplementedException as BaseNotImplement * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\Exception\NotImplementedException} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\Exception\NotImplementedException} * instead. */ class NotImplementedException extends BaseNotImplementedException diff --git a/src/Symfony/Component/Locale/Locale.php b/src/Symfony/Component/Locale/Locale.php index bd82cf83e6..c0c8543564 100644 --- a/src/Symfony/Component/Locale/Locale.php +++ b/src/Symfony/Component/Locale/Locale.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Locale; -trigger_error('\Symfony\Component\Locale\Locale is deprecated since version 2.7, to be removed in Symfony 3.0. Use the methods provided by \Symfony\Component\Intl\Intl instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\Locale class is deprecated since version 2.7, to be removed in Symfony 3.0. Use the methods provided by the \Symfony\Component\Intl\Intl class instead.', E_USER_DEPRECATED); use Symfony\Component\Intl\Intl; @@ -20,7 +20,7 @@ use Symfony\Component\Intl\Intl; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. + * @deprecated since version 2.3, to be removed in 3.0. * Use {@link \Locale} and {@link \Symfony\Component\Intl\Intl} instead. */ class Locale extends \Locale diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/AmPmTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/AmPmTransformer.php index 8bc8e087ea..7c3b9fdc08 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/AmPmTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/AmPmTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\AmPmTransformer class is deprecated since version 2.3 and will be removed in Symfony 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\AmPmTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\AmPmTransformer as BaseAmPmTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\AmPmTransformer as BaseAmPmT * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\AmPmTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\AmPmTransformer} * instead. */ class AmPmTransformer extends BaseAmPmTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/DayOfWeekTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/DayOfWeekTransformer.php index e730881c56..5368c66098 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/DayOfWeekTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/DayOfWeekTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\DayOfWeekTransformer class is deprecated since version 2.3 and will be removed in Symfony 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\DayOfWeekTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\DayOfWeekTransformer as BaseDayOfWeekTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\DayOfWeekTransformer as Base * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\DayOfWeekTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\DayOfWeekTransformer} * instead. */ class DayOfWeekTransformer extends BaseDayOfWeekTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/DayOfYearTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/DayOfYearTransformer.php index 157c51d38b..442085287b 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/DayOfYearTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/DayOfYearTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\DayOfYearTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\DayOfYearTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\DayOfYearTransformer as BaseDayOfYearTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\DayOfYearTransformer as Base * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\DayOfYearTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\DayOfYearTransformer} * instead. */ class DayOfYearTransformer extends BaseDayOfYearTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/DayTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/DayTransformer.php index ba5fc75145..a85ea820ba 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/DayTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/DayTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\DayTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\DayTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\DayTransformer as BaseDayTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\DayTransformer as BaseDayTra * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\DayTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\DayTransformer} * instead. */ class DayTransformer extends BaseDayTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php index 4e487d661b..2c2c0d2266 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/FullTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\FullTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\FullTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\FullTransformer as BaseFullTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\FullTransformer as BaseFullT * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\FullTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\FullTransformer} * instead. */ class FullTransformer extends BaseFullTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/Hour1200Transformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/Hour1200Transformer.php index 7a43e9e92a..253f7274b1 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/Hour1200Transformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/Hour1200Transformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\Hour1200Transformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\Hour1200Transformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\Hour1200Transformer as BaseHour1200Transformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\Hour1200Transformer as BaseH * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Hour1200Transformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Hour1200Transformer} * instead. */ class Hour1200Transformer extends BaseHour1200Transformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/Hour1201Transformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/Hour1201Transformer.php index 8bde89d28f..f689c45a6e 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/Hour1201Transformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/Hour1201Transformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\Hour1201Transformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\Hour1201Transformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\Hour1201Transformer as BaseHour1201Transformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\Hour1201Transformer as BaseH * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Hour1201Transformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Hour1201Transformer} * instead. */ class Hour1201Transformer extends BaseHour1201Transformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/Hour2400Transformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/Hour2400Transformer.php index b8081e3b32..2e34f168ad 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/Hour2400Transformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/Hour2400Transformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\Hour2400Transformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\Hour2400Transformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\Hour2400Transformer as BaseHour2400Transformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\Hour2400Transformer as BaseH * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Hour2400Transformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Hour2400Transformer} * instead. */ class Hour2400Transformer extends BaseHour2400Transformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/Hour2401Transformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/Hour2401Transformer.php index 20dd4aece5..f9cb610df6 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/Hour2401Transformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/Hour2401Transformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\Hour2401Transformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\Hour2401Transformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\Hour2401Transformer as BaseHour2401Transformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\Hour2401Transformer as BaseH * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Hour2401Transformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Hour2401Transformer} * instead. */ class Hour2401Transformer extends BaseHour2401Transformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/HourTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/HourTransformer.php index a3e0c0f644..7e5df5a729 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/HourTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/HourTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\HourTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer as BaseHourTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer as BaseHourT * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\HourTransformer} * instead. */ abstract class HourTransformer extends BaseHourTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/MinuteTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/MinuteTransformer.php index 9b4b943fe6..6768404fd9 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/MinuteTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/MinuteTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\MinuteTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\MinuteTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\MinuteTransformer as BaseMinuteTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\MinuteTransformer as BaseMin * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\MinuteTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\MinuteTransformer} * instead. */ class MinuteTransformer extends BaseMinuteTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/MonthTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/MonthTransformer.php index 7247d747b0..351ff0e6f6 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/MonthTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/MonthTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\MonthTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\MonthTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\MonthTransformer as BaseMonthTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\MonthTransformer as BaseMont * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\MonthTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\MonthTransformer} * instead. */ class MonthTransformer extends BaseMonthTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/QuarterTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/QuarterTransformer.php index 56fb4d14ae..ef09fa4bce 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/QuarterTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/QuarterTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\QuarterTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\QuarterTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\QuarterTransformer as BaseQuarterTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\QuarterTransformer as BaseQu * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\QuarterTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\QuarterTransformer} * instead. */ class QuarterTransformer extends BaseQuarterTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/SecondTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/SecondTransformer.php index 160ac2a282..6afc55004d 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/SecondTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/SecondTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\SecondTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\SecondTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\SecondTransformer as BaseSecondTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\SecondTransformer as BaseSec * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\SecondTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\SecondTransformer} * instead. */ class SecondTransformer extends BaseSecondTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php index b28f024a71..7af84f2971 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/TimeZoneTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\TimeZoneTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\TimeZoneTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\TimeZoneTransformer as BaseTimeZoneTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\TimeZoneTransformer as BaseT * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\TimeZoneTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\TimeZoneTransformer} * instead. */ class TimeZoneTransformer extends BaseTimeZoneTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/Transformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/Transformer.php index 447f8714d3..7b9cf155c8 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/Transformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/Transformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\Transformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\Transformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\Transformer as BaseTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\Transformer as BaseTransform * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Transformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\Transformer} * instead. */ abstract class Transformer extends BaseTransformer diff --git a/src/Symfony/Component/Locale/Stub/DateFormat/YearTransformer.php b/src/Symfony/Component/Locale/Stub/DateFormat/YearTransformer.php index a9adae5131..f733c8abf9 100644 --- a/src/Symfony/Component/Locale/Stub/DateFormat/YearTransformer.php +++ b/src/Symfony/Component/Locale/Stub/DateFormat/YearTransformer.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub\DateFormat; +trigger_error('The '.__NAMESPACE__.'\YearTransformer class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\DateFormat\YearTransformer class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\DateFormat\YearTransformer as BaseYearTransformer; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\DateFormat\YearTransformer as BaseYearT * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\DateFormat\YearTransformer} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\DateFormat\YearTransformer} * instead. */ class YearTransformer extends BaseYearTransformer diff --git a/src/Symfony/Component/Locale/Stub/StubCollator.php b/src/Symfony/Component/Locale/Stub/StubCollator.php index 078078ce90..eeffde1ec2 100644 --- a/src/Symfony/Component/Locale/Stub/StubCollator.php +++ b/src/Symfony/Component/Locale/Stub/StubCollator.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub; +trigger_error('The '.__NAMESPACE__.'\StubCollator class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\Collator\Collator class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\Collator\Collator; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\Collator\Collator; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\Collator\Collator} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\Collator\Collator} instead. */ class StubCollator extends Collator { diff --git a/src/Symfony/Component/Locale/Stub/StubIntl.php b/src/Symfony/Component/Locale/Stub/StubIntl.php index b7fd087c1b..4562791291 100644 --- a/src/Symfony/Component/Locale/Stub/StubIntl.php +++ b/src/Symfony/Component/Locale/Stub/StubIntl.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub; +trigger_error('The '.__NAMESPACE__.'\StubIntl class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\Globals\IntlGlobals class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\Globals\IntlGlobals; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\Globals\IntlGlobals; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\Globals\IntlGlobals} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\Globals\IntlGlobals} instead. */ abstract class StubIntl extends IntlGlobals { diff --git a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php index ccb94d211a..4826f27ade 100644 --- a/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php +++ b/src/Symfony/Component/Locale/Stub/StubIntlDateFormatter.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub; +trigger_error('The '.__NAMESPACE__.'\StubIntlDateFormatter class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\DateFormatter\IntlDateFormatter class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\DateFormatter\IntlDateFormatter; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\DateFormatter\IntlDateFormatter; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\DateFormatter\IntlDateFormatter} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\DateFormatter\IntlDateFormatter} * instead. */ class StubIntlDateFormatter extends IntlDateFormatter diff --git a/src/Symfony/Component/Locale/Stub/StubLocale.php b/src/Symfony/Component/Locale/Stub/StubLocale.php index 3ef259c06b..001bf53c00 100644 --- a/src/Symfony/Component/Locale/Stub/StubLocale.php +++ b/src/Symfony/Component/Locale/Stub/StubLocale.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub; +trigger_error('The '.__NAMESPACE__.'\StubLocale class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\Locale\Locale and Symfony\Component\Intl\Intl classes instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\Intl; use Symfony\Component\Intl\Locale\Locale; @@ -19,8 +21,8 @@ use Symfony\Component\Intl\Locale\Locale; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\Locale\Locale} and + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\Locale\Locale} and * {@link \Symfony\Component\Intl\Intl} instead. */ class StubLocale extends Locale diff --git a/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php b/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php index d1900692e6..aa4aae014d 100644 --- a/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php +++ b/src/Symfony/Component/Locale/Stub/StubNumberFormatter.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Locale\Stub; +trigger_error('The '.__NAMESPACE__.'\StubNumberFormatter class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Intl\NumberFormatter\NumberFormatter class instead.', E_USER_DEPRECATED); + use Symfony\Component\Intl\NumberFormatter\NumberFormatter; /** @@ -18,8 +20,8 @@ use Symfony\Component\Intl\NumberFormatter\NumberFormatter; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Intl\NumberFormatter\NumberFormatter} + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Intl\NumberFormatter\NumberFormatter} * instead. */ class StubNumberFormatter extends NumberFormatter diff --git a/src/Symfony/Component/OptionsResolver/OptionsResolver.php b/src/Symfony/Component/OptionsResolver/OptionsResolver.php index 42c3d249da..96f28cc348 100644 --- a/src/Symfony/Component/OptionsResolver/OptionsResolver.php +++ b/src/Symfony/Component/OptionsResolver/OptionsResolver.php @@ -1011,20 +1011,24 @@ class OptionsResolver implements Options, OptionsResolverInterface /** * Alias of {@link setDefault()}. * - * @deprecated Deprecated as of Symfony 2.6, to be removed in Symfony 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function set($option, $value) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setDefaults() method instead.', E_USER_DEPRECATED); + return $this->setDefault($option, $value); } /** * Shortcut for {@link clear()} and {@link setDefaults()}. * - * @deprecated Deprecated as of Symfony 2.6, to be removed in Symfony 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function replace(array $defaults) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the clear() and setDefaults() methods instead.', E_USER_DEPRECATED); + $this->clear(); return $this->setDefaults($defaults); @@ -1033,40 +1037,48 @@ class OptionsResolver implements Options, OptionsResolverInterface /** * Alias of {@link setDefault()}. * - * @deprecated Deprecated as of Symfony 2.6, to be removed in Symfony 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function overload($option, $value) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setDefault() method instead.', E_USER_DEPRECATED); + return $this->setDefault($option, $value); } /** * Alias of {@link offsetGet()}. * - * @deprecated Deprecated as of Symfony 2.6, to be removed in Symfony 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function get($option) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the ArrayAccess syntax instead to get an option value.', E_USER_DEPRECATED); + return $this->offsetGet($option); } /** * Alias of {@link offsetExists()}. * - * @deprecated Deprecated as of Symfony 2.6, to be removed in Symfony 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function has($option) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the ArrayAccess syntax instead to get an option value.', E_USER_DEPRECATED); + return $this->offsetExists($option); } /** * Shortcut for {@link clear()} and {@link setDefaults()}. * - * @deprecated Deprecated as of Symfony 2.6, to be removed in Symfony 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function replaceDefaults(array $defaultValues) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the clear() and setDefaults() methods instead.', E_USER_DEPRECATED); + $this->clear(); return $this->setDefaults($defaultValues); @@ -1075,20 +1087,24 @@ class OptionsResolver implements Options, OptionsResolverInterface /** * Alias of {@link setDefined()}. * - * @deprecated Deprecated as of Symfony 2.6, to be removed in Symfony 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function setOptional(array $optionNames) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the setDefined() method instead.', E_USER_DEPRECATED); + return $this->setDefined($optionNames); } /** * Alias of {@link isDefined()}. * - * @deprecated Deprecated as of Symfony 2.6, to be removed in Symfony 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ public function isKnown($option) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the isDefined() method instead.', E_USER_DEPRECATED); + return $this->isDefined($option); } diff --git a/src/Symfony/Component/OptionsResolver/OptionsResolverInterface.php b/src/Symfony/Component/OptionsResolver/OptionsResolverInterface.php index cc177487d0..7e983f22f9 100644 --- a/src/Symfony/Component/OptionsResolver/OptionsResolverInterface.php +++ b/src/Symfony/Component/OptionsResolver/OptionsResolverInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\OptionsResolver; -trigger_error('The "Symfony\Component\OptionsResolver\OptionsResolverInterface" interface was deprecated in version 2.6 and will be removed in 3.0. Use "Symfony\Component\OptionsResolver\OptionsResolver" instead.', E_USER_DEPRECATED); - use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; use Symfony\Component\OptionsResolver\Exception\MissingOptionsException; use Symfony\Component\OptionsResolver\Exception\OptionDefinitionException; @@ -22,6 +20,7 @@ use Symfony\Component\OptionsResolver\Exception\OptionDefinitionException; * * @deprecated since version 2.6, to be removed in Symfony 3.0. * Use {@link OptionsResolver} instead. + * @deprecated since version 2.6, to be removed in 3.0. Use {@link OptionsResolver} instead. */ interface OptionsResolverInterface { diff --git a/src/Symfony/Component/Process/ProcessBuilder.php b/src/Symfony/Component/Process/ProcessBuilder.php index 14da021859..189ab8a3d1 100644 --- a/src/Symfony/Component/Process/ProcessBuilder.php +++ b/src/Symfony/Component/Process/ProcessBuilder.php @@ -187,7 +187,7 @@ class ProcessBuilder * * To disable the timeout, set this value to null. * - * @param float|null + * @param float|null $timeout * * @return ProcessBuilder * diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccess.php b/src/Symfony/Component/PropertyAccess/PropertyAccess.php index b0effd1298..91f2ec371e 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccess.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccess.php @@ -43,12 +43,12 @@ final class PropertyAccess * * @return PropertyAccessor The new property accessor * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use - * {@link createPropertyAccessor()} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link createPropertyAccessor()} instead. */ public static function getPropertyAccessor() { - trigger_error('PropertyAccess::getPropertyAccessor() is deprecated since version 2.3 and will be removed in 3.0. Use PropertyAccess::createPropertyAccessor() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the createPropertyAccessor() method instead.', E_USER_DEPRECATED); return self::createPropertyAccessor(); } diff --git a/src/Symfony/Component/Routing/Annotation/Route.php b/src/Symfony/Component/Routing/Annotation/Route.php index 90521c0be8..af2158250c 100644 --- a/src/Symfony/Component/Routing/Annotation/Route.php +++ b/src/Symfony/Component/Routing/Annotation/Route.php @@ -55,18 +55,22 @@ class Route } /** - * @deprecated Deprecated in 2.2, to be removed in 3.0. Use setPath instead. + * @deprecated since version 2.2, to be removed in 3.0. Use setPath instead. */ public function setPattern($pattern) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the setPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED); + $this->path = $pattern; } /** - * @deprecated Deprecated in 2.2, to be removed in 3.0. Use getPath instead. + * @deprecated since version 2.2, to be removed in 3.0. Use getPath instead. */ public function getPattern() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the getPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED); + return $this->path; } diff --git a/src/Symfony/Component/Routing/Route.php b/src/Symfony/Component/Routing/Route.php index d2ddbd3932..02b81b3483 100644 --- a/src/Symfony/Component/Routing/Route.php +++ b/src/Symfony/Component/Routing/Route.php @@ -147,10 +147,12 @@ class Route implements \Serializable * * @return string The pattern * - * @deprecated Deprecated in 2.2, to be removed in 3.0. Use getPath instead. + * @deprecated since version 2.2, to be removed in 3.0. Use getPath instead. */ public function getPattern() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the getPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED); + return $this->path; } @@ -163,10 +165,12 @@ class Route implements \Serializable * * @return Route The current Route instance * - * @deprecated Deprecated in 2.2, to be removed in 3.0. Use setPath instead. + * @deprecated since version 2.2, to be removed in 3.0. Use setPath instead. */ public function setPattern($pattern) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.2 and will be removed in 3.0. Use the setPath() method instead and use the "path" option instead of the "pattern" option in the route definition.', E_USER_DEPRECATED); + return $this->setPath($pattern); } diff --git a/src/Symfony/Component/Security/Core/SecurityContext.php b/src/Symfony/Component/Security/Core/SecurityContext.php index 165c22ada6..7695959037 100644 --- a/src/Symfony/Component/Security/Core/SecurityContext.php +++ b/src/Symfony/Component/Security/Core/SecurityContext.php @@ -26,7 +26,7 @@ use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; * * @author Fabien Potencier * @author Johannes M. Schmitt - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ class SecurityContext implements SecurityContextInterface { @@ -70,26 +70,38 @@ class SecurityContext implements SecurityContextInterface } /** + * @deprecated since version 2.6, to be removed in 3.0. Use TokenStorageInterface::getToken() instead. + * * {@inheritdoc} */ public function getToken() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage::getToken() method instead.', E_USER_DEPRECATED); + return $this->tokenStorage->getToken(); } /** + * @deprecated since version 2.6, to be removed in 3.0. Use TokenStorageInterface::setToken() instead. + * * {@inheritdoc} */ public function setToken(TokenInterface $token = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage::setToken() method instead.', E_USER_DEPRECATED); + return $this->tokenStorage->setToken($token); } /** + * @deprecated since version 2.6, to be removed in 3.0. Use AuthorizationCheckerInterface::isGranted() instead. + * * {@inheritdoc} */ public function isGranted($attributes, $object = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::isGranted() method instead.', E_USER_DEPRECATED); + return $this->authorizationChecker->isGranted($attributes, $object); } } diff --git a/src/Symfony/Component/Security/Core/Util/ClassUtils.php b/src/Symfony/Component/Security/Core/Util/ClassUtils.php index 6107c40fa6..6c8709668f 100644 --- a/src/Symfony/Component/Security/Core/Util/ClassUtils.php +++ b/src/Symfony/Component/Security/Core/Util/ClassUtils.php @@ -48,7 +48,7 @@ class ClassUtils /** * Gets the real class name of a class name that could be a proxy. * - * @param string|object + * @param string|object $object * * @return string */ diff --git a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php index a35849a5c6..2ab7fbb547 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonDecode.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonDecode.php @@ -55,12 +55,15 @@ class JsonDecode implements DecoderInterface * * @return int * - * @deprecated since 2.5, decode() throws an exception if error found, will be removed in 3.0 + * @deprecated since version 2.5, to be removed in 3.0. + * The {@self decode()} method throws an exception if error found. * * @see http://php.net/manual/en/function.json-last-error.php json_last_error */ public function getLastError() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED); + return $this->lastError; } diff --git a/src/Symfony/Component/Serializer/Encoder/JsonEncode.php b/src/Symfony/Component/Serializer/Encoder/JsonEncode.php index ff377db993..76345bed69 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonEncode.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonEncode.php @@ -33,12 +33,15 @@ class JsonEncode implements EncoderInterface * * @return int * - * @deprecated since 2.5, encode() throws an exception if error found, will be removed in 3.0 + * @deprecated since version 2.5, to be removed in 3.0. + * The {@self encode()} throws an exception if error found. * * @see http://php.net/manual/en/function.json-last-error.php json_last_error */ public function getLastError() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the encode() method instead to get the last JSON encoding error.', E_USER_DEPRECATED); + return $this->lastError; } diff --git a/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php b/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php index 28d619f1f2..d44cd23d7a 100644 --- a/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/JsonEncoder.php @@ -41,10 +41,12 @@ class JsonEncoder implements EncoderInterface, DecoderInterface * * @return int * - * @deprecated since 2.5, JsonEncode throws exception if an error is found, will be removed in 3.0 + * @deprecated since version 2.5, to be removed in 3.0. JsonEncode throws exception if an error is found. */ public function getLastEncodingError() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the Symfony\Component\Serializer\Encoder\JsonEncode::encode() method instead to get the last JSON encoding error.', E_USER_DEPRECATED); + return $this->encodingImpl->getLastError(); } @@ -53,10 +55,12 @@ class JsonEncoder implements EncoderInterface, DecoderInterface * * @return int * - * @deprecated since 2.5, JsonDecode throws exception if an error is found, will be removed in 3.0 + * @deprecated since version 2.5, to be removed in 3.0. JsonDecode throws exception if an error is found. */ public function getLastDecodingError() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Catch the exception raised by the Symfony\Component\Serializer\Encoder\JsonDecode::decode() method instead to get the last JSON decoding error.', E_USER_DEPRECATED); + return $this->decodingImpl->getLastError(); } diff --git a/src/Symfony/Component/Templating/Loader/Loader.php b/src/Symfony/Component/Templating/Loader/Loader.php index 7239ac73d2..2572892f28 100644 --- a/src/Symfony/Component/Templating/Loader/Loader.php +++ b/src/Symfony/Component/Templating/Loader/Loader.php @@ -27,7 +27,7 @@ abstract class Loader implements LoaderInterface protected $logger; /** - * @deprecated Deprecated in 2.4, to be removed in 3.0. Use $this->logger instead. + * @deprecated since version 2.4, to be removed in 3.0. Use $this->logger instead. */ protected $debugger; @@ -46,10 +46,12 @@ abstract class Loader implements LoaderInterface * * @param DebuggerInterface $debugger A debugger instance * - * @deprecated Deprecated in 2.4, to be removed in 3.0. Use $this->setLogger() instead. + * @deprecated since version 2.4, to be removed in 3.0. Use $this->setLogger() instead. */ public function setDebugger(DebuggerInterface $debugger) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0. Use the setLogger() method instead.', E_USER_DEPRECATED); + $this->debugger = $debugger; } } diff --git a/src/Symfony/Component/Translation/Translator.php b/src/Symfony/Component/Translation/Translator.php index 7ad2043f97..69d765b78e 100644 --- a/src/Symfony/Component/Translation/Translator.php +++ b/src/Symfony/Component/Translation/Translator.php @@ -154,13 +154,13 @@ class Translator implements TranslatorInterface, TranslatorBagInterface * * @throws \InvalidArgumentException If a locale contains invalid characters * - * @deprecated Deprecated since version 2.3, to be removed in 3.0. Use setFallbackLocales() instead. + * @deprecated since version 2.3, to be removed in 3.0. Use setFallbackLocales() instead. * * @api */ public function setFallbackLocale($locales) { - trigger_error('The setFallbackLocale() method is deprecated since version 2.3 and will be removed in 3.0. Use setFallbackLocales() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the setFallbackLocales() method instead.', E_USER_DEPRECATED); $this->setFallbackLocales(is_array($locales) ? $locales : array($locales)); } diff --git a/src/Symfony/Component/Validator/ClassBasedInterface.php b/src/Symfony/Component/Validator/ClassBasedInterface.php index cc8679e099..7c2eb8f0f7 100644 --- a/src/Symfony/Component/Validator/ClassBasedInterface.php +++ b/src/Symfony/Component/Validator/ClassBasedInterface.php @@ -11,14 +11,12 @@ namespace Symfony\Component\Validator; -trigger_error('The Symfony\Component\Validator\ClassBasedInterface interface was deprecated in version 2.7 and will be removed in 3.0. Use Symfony\Component\Validator\Mapping\ClassMetadataInterface instead', E_USER_DEPRECATED); - /** * An object backed by a PHP class. * * @author Bernhard Schussek * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Mapping\ClassMetadataInterface} instead. */ interface ClassBasedInterface diff --git a/src/Symfony/Component/Validator/ConstraintValidator.php b/src/Symfony/Component/Validator/ConstraintValidator.php index 61c994a629..7a412737bd 100644 --- a/src/Symfony/Component/Validator/ConstraintValidator.php +++ b/src/Symfony/Component/Validator/ConstraintValidator.php @@ -61,10 +61,12 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface * * @return ConstraintViolationBuilderInterface The violation builder * - * @deprecated This method will be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ protected function buildViolation($message, array $parameters = array()) { + trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + if ($this->context instanceof ExecutionContextInterface2Dot5) { return $this->context->buildViolation($message, $parameters); } @@ -82,10 +84,12 @@ abstract class ConstraintValidator implements ConstraintValidatorInterface * * @return ConstraintViolationBuilderInterface The violation builder * - * @deprecated This method will be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ protected function buildViolationInContext(ExecutionContextInterface $context, $message, array $parameters = array()) { + trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + if ($context instanceof ExecutionContextInterface2Dot5) { return $context->buildViolation($message, $parameters); } diff --git a/src/Symfony/Component/Validator/ConstraintViolation.php b/src/Symfony/Component/Validator/ConstraintViolation.php index 9ed829a76b..7df3f3fade 100644 --- a/src/Symfony/Component/Validator/ConstraintViolation.php +++ b/src/Symfony/Component/Validator/ConstraintViolation.php @@ -142,12 +142,12 @@ class ConstraintViolation implements ConstraintViolationInterface /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.7, to be removed in 3.0. + * @deprecated since version 2.7, to be removed in 3.0. * Use getParameters() instead */ public function getMessageParameters() { - trigger_error('ConstraintViolation::getMessageParameters() was deprecated since version 2.7, to be removed in 3.0. Use ConstraintViolation::getParameters() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.7, to be removed in 3.0. Use the ConstraintViolation::getParameters() method instead.', E_USER_DEPRECATED); return $this->parameters; } @@ -163,12 +163,12 @@ class ConstraintViolation implements ConstraintViolationInterface /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.7, to be removed in 3.0. + * @deprecated since version 2.7, to be removed in 3.0. * Use getPlural() instead */ public function getMessagePluralization() { - trigger_error('ConstraintViolation::getMessagePluralization() was deprecated since version 2.7, to be removed in 3.0. Use ConstraintViolation::getPlural() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.7, to be removed in 3.0. Use the ConstraintViolation::getPlural() method instead.', E_USER_DEPRECATED); return $this->plural; } diff --git a/src/Symfony/Component/Validator/Constraints/Callback.php b/src/Symfony/Component/Validator/Constraints/Callback.php index 312952a7fa..95dc45979a 100644 --- a/src/Symfony/Component/Validator/Constraints/Callback.php +++ b/src/Symfony/Component/Validator/Constraints/Callback.php @@ -33,7 +33,7 @@ class Callback extends Constraint /** * @var array * - * @deprecated Deprecated since version 2.4, to be removed in Symfony 3.0. + * @deprecated since version 2.4, to be removed in 3.0. */ public $methods; @@ -52,6 +52,7 @@ class Callback extends Constraint $options = array('callback' => $options); } else { // BC with Symfony < 2.4 + trigger_error('The "methods" option of the '.__CLASS__.' class is deprecated since version 2.4 and will be removed in 3.0. Use the "callback" option instead.', E_USER_DEPRECATED); $options = array('methods' => $options); } } diff --git a/src/Symfony/Component/Validator/Constraints/Collection/Optional.php b/src/Symfony/Component/Validator/Constraints/Collection/Optional.php index 66463e55e4..cd9af50b9a 100644 --- a/src/Symfony/Component/Validator/Constraints/Collection/Optional.php +++ b/src/Symfony/Component/Validator/Constraints/Collection/Optional.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Validator\Constraints\Collection; -trigger_error('Symfony\Component\Validator\Constraints\Collection\Optional was deprecated in version 2.3 and will be removed in 3.0. You should use Symfony\Component\Validator\Constraints\Optional instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\Optional class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Validator\Constraints\Optional class instead.', E_USER_DEPRECATED); use Symfony\Component\Validator\Constraints\Optional as BaseOptional; @@ -21,8 +21,8 @@ use Symfony\Component\Validator\Constraints\Optional as BaseOptional; * * @author Bernhard Schussek * - * @deprecated Deprecated in 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Validator\Constraints\Optional} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Validator\Constraints\Optional} instead. */ class Optional extends BaseOptional { diff --git a/src/Symfony/Component/Validator/Constraints/Collection/Required.php b/src/Symfony/Component/Validator/Constraints/Collection/Required.php index 3a2e96d82a..55041020b7 100644 --- a/src/Symfony/Component/Validator/Constraints/Collection/Required.php +++ b/src/Symfony/Component/Validator/Constraints/Collection/Required.php @@ -11,7 +11,7 @@ namespace Symfony\Component\Validator\Constraints\Collection; -trigger_error('Symfony\Component\Validator\Constraints\Collection\Required was deprecated in version 2.3 and will be removed in 3.0. You should use Symfony\Component\Validator\Constraints\Required instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\Required class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Validator\Constraints\Required class instead.', E_USER_DEPRECATED); use Symfony\Component\Validator\Constraints\Required as BaseRequired; @@ -21,8 +21,8 @@ use Symfony\Component\Validator\Constraints\Required as BaseRequired; * * @author Bernhard Schussek * - * @deprecated Deprecated in 2.3, to be removed in 3.0. Use - * {@link \Symfony\Component\Validator\Constraints\Required} instead. + * @deprecated since version 2.3, to be removed in 3.0. + * Use {@link \Symfony\Component\Validator\Constraints\Required} instead. */ class Required extends BaseRequired { diff --git a/src/Symfony/Component/Validator/Constraints/Deprecated/UuidValidator.php b/src/Symfony/Component/Validator/Constraints/Deprecated/UuidValidator.php new file mode 100644 index 0000000000..46ca7ba67c --- /dev/null +++ b/src/Symfony/Component/Validator/Constraints/Deprecated/UuidValidator.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Constraints\Deprecated; + +trigger_error('Constants STRICT_PATTERN, LOOSE_PATTERN and STRICT_UUID_LENGTH in class Symfony\Component\Validator\Constraints\UuidValidator are deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED); + +/** + * @deprecated since version 2.7, to be removed in 3.0. + * @internal + */ +final class UuidValidator +{ + const STRICT_PATTERN = '/^[a-f0-9]{8}-[a-f0-9]{4}-[%s][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/i'; + const LOOSE_PATTERN = '/^[a-f0-9]{4}(?:-?[a-f0-9]{4}){7}$/i'; + const STRICT_UUID_LENGTH = 36; + + private function __construct() + { + + } +} diff --git a/src/Symfony/Component/Validator/Constraints/GroupSequence.php b/src/Symfony/Component/Validator/Constraints/GroupSequence.php index 72bfb16d2c..52d7539431 100644 --- a/src/Symfony/Component/Validator/Constraints/GroupSequence.php +++ b/src/Symfony/Component/Validator/Constraints/GroupSequence.php @@ -97,47 +97,56 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable /** * Returns an iterator for this group. * + * Implemented for backwards compatibility with Symfony < 2.5. + * * @return \Traversable The iterator * * @see \IteratorAggregate::getIterator() * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function getIterator() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + return new \ArrayIterator($this->groups); } /** * Returns whether the given offset exists in the sequence. * + * Implemented for backwards compatibility with Symfony < 2.5. + * * @param int $offset The offset * * @return bool Whether the offset exists * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function offsetExists($offset) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + return isset($this->groups[$offset]); } /** * Returns the group at the given offset. * + * Implemented for backwards compatibility with Symfony < 2.5. + * * @param int $offset The offset * * @return string The group a the given offset * * @throws OutOfBoundsException If the object does not exist * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function offsetGet($offset) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + if (!isset($this->groups[$offset])) { throw new OutOfBoundsException(sprintf( 'The offset "%s" does not exist.', @@ -151,14 +160,17 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable /** * Sets the group at the given offset. * + * Implemented for backwards compatibility with Symfony < 2.5. + * * @param int $offset The offset * @param string $value The group name * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function offsetSet($offset, $value) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + if (null !== $offset) { $this->groups[$offset] = $value; @@ -171,26 +183,32 @@ class GroupSequence implements \ArrayAccess, \IteratorAggregate, \Countable /** * Removes the group at the given offset. * + * Implemented for backwards compatibility with Symfony < 2.5. + * * @param int $offset The offset * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function offsetUnset($offset) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + unset($this->groups[$offset]); } /** * Returns the number of groups in the sequence. * + * Implemented for backwards compatibility with Symfony < 2.5. + * * @return int The number of groups * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function count() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + return count($this->groups); } } diff --git a/src/Symfony/Component/Validator/Constraints/Isbn.php b/src/Symfony/Component/Validator/Constraints/Isbn.php index 67d177f4e0..35cb82204e 100644 --- a/src/Symfony/Component/Validator/Constraints/Isbn.php +++ b/src/Symfony/Component/Validator/Constraints/Isbn.php @@ -44,13 +44,13 @@ class Isbn extends Constraint public $message; /** - * @deprecated Deprecated since version 2.5, to be removed in 3.0. Use option "type" instead. + * @deprecated since version 2.5, to be removed in 3.0. Use option "type" instead. * @var bool */ public $isbn10 = false; /** - * @deprecated Deprecated since version 2.5, to be removed in 3.0. Use option "type" instead. + * @deprecated since version 2.5, to be removed in 3.0. Use option "type" instead. * @var bool */ public $isbn13 = false; diff --git a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php index 8a53fe7941..403ee93b3f 100644 --- a/src/Symfony/Component/Validator/Constraints/IsbnValidator.php +++ b/src/Symfony/Component/Validator/Constraints/IsbnValidator.php @@ -48,8 +48,10 @@ class IsbnValidator extends ConstraintValidator if (null == $constraint->type) { if ($constraint->isbn10 && !$constraint->isbn13) { + trigger_error('The "isbn10" option of the Isbn constraint is deprecated since version 2.5 and will be removed in 3.0. Use the "type" option instead.', E_USER_DEPRECATED); $constraint->type = 'isbn10'; } elseif ($constraint->isbn13 && !$constraint->isbn10) { + trigger_error('The "isbn13" option of the Isbn constraint is deprecated since version 2.5 and will be removed in 3.0. Use the "type" option instead.', E_USER_DEPRECATED); $constraint->type = 'isbn13'; } } diff --git a/src/Symfony/Component/Validator/Constraints/UuidValidator.php b/src/Symfony/Component/Validator/Constraints/UuidValidator.php index 0ae04e2694..e026705c04 100644 --- a/src/Symfony/Component/Validator/Constraints/UuidValidator.php +++ b/src/Symfony/Component/Validator/Constraints/UuidValidator.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use Symfony\Component\Validator\Constraints\Deprecated\UuidValidator as Deprecated; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -56,19 +57,19 @@ class UuidValidator extends ConstraintValidator const LOOSE_FIRST_HYPHEN_POSITION = 4; /** - * @deprecated Deprecated since Symfony 2.6, to be removed in 3.0 + * @deprecated since version 2.6, to be removed in 3.0 */ - const STRICT_PATTERN = '/^[a-f0-9]{8}-[a-f0-9]{4}-[%s][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$/i'; + const STRICT_PATTERN = Deprecated::STRICT_PATTERN; /** - * @deprecated Deprecated since Symfony 2.6, to be removed in 3.0 + * @deprecated since version 2.6, to be removed in 3.0 */ - const LOOSE_PATTERN = '/^[a-f0-9]{4}(?:-?[a-f0-9]{4}){7}$/i'; + const LOOSE_PATTERN = Deprecated::LOOSE_PATTERN; /** - * @deprecated Deprecated since Symfony 2.6, to be removed in 3.0 + * @deprecated since version 2.6, to be removed in 3.0 */ - const STRICT_UUID_LENGTH = self::STRICT_LENGTH; + const STRICT_UUID_LENGTH = Deprecated::STRICT_UUID_LENGTH; /** * {@inheritdoc} diff --git a/src/Symfony/Component/Validator/Constraints/Valid.php b/src/Symfony/Component/Validator/Constraints/Valid.php index 1cff5e27da..cb520c93d4 100644 --- a/src/Symfony/Component/Validator/Constraints/Valid.php +++ b/src/Symfony/Component/Validator/Constraints/Valid.php @@ -27,7 +27,7 @@ class Valid extends Constraint public $traverse = true; /** - * @deprecated Deprecated as of version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in Symfony 3.0. */ public $deep = true; @@ -41,7 +41,7 @@ class Valid extends Constraint } if (is_array($options) && array_key_exists('deep', $options)) { - trigger_error('The "deep" option for the Valid constraint is deprecated since 2.5 and will be removed in 3.0. When traversing arrays, nested arrays are always traversed. When traversing nested objects, their traversal strategy is used.', E_USER_DEPRECATED); + trigger_error('The "deep" option for the Valid constraint is deprecated since version 2.5 and will be removed in 3.0. When traversing arrays, nested arrays are always traversed. When traversing nested objects, their traversal strategy is used.', E_USER_DEPRECATED); } parent::__construct($options); diff --git a/src/Symfony/Component/Validator/Context/ExecutionContext.php b/src/Symfony/Component/Validator/Context/ExecutionContext.php index d7f157da1c..0079d23272 100644 --- a/src/Symfony/Component/Validator/Context/ExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/ExecutionContext.php @@ -188,7 +188,7 @@ class ExecutionContext implements ExecutionContextInterface // You should use buildViolation() instead. if (func_num_args() > 2) { throw new BadMethodCallException( - 'The parameters $invalidValue, $pluralization and $code are '. + 'The parameters $invalidValue, $plural and $code are '. 'not supported anymore as of Symfony 2.5. Please use '. 'buildViolation() instead or enable the legacy mode.' ); @@ -321,8 +321,6 @@ class ExecutionContext implements ExecutionContextInterface */ public function validate($value, $subPath = '', $groups = null, $traverse = false, $deep = false) { - trigger_error('ExecutionContext::validate() is deprecated since version 2.5 and will be removed in 3.0. Use ExecutionContext::getValidator() together with inContext() 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.' @@ -334,8 +332,6 @@ class ExecutionContext implements ExecutionContextInterface */ public function validateValue($value, $constraints, $subPath = '', $groups = null) { - trigger_error('ExecutionContext::validateValue() is deprecated since version 2.5 and will be removed in 3.0. Use ExecutionContext::getValidator() together with inContext() 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.' diff --git a/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php b/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php index de34b1fc2c..8ce6bdb304 100644 --- a/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php +++ b/src/Symfony/Component/Validator/Context/LegacyExecutionContext.php @@ -22,8 +22,7 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; * @since 2.5 * @author Bernhard Schussek * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ class LegacyExecutionContext extends ExecutionContext { @@ -58,6 +57,8 @@ class LegacyExecutionContext extends ExecutionContext public function addViolation($message, array $parameters = array(), $invalidValue = null, $plural = null, $code = null) { 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); + $this ->buildViolation($message, $parameters) ->setInvalidValue($invalidValue) @@ -77,6 +78,8 @@ class LegacyExecutionContext extends ExecutionContext */ public function addViolationAt($subPath, $message, array $parameters = array(), $invalidValue = null, $plural = null, $code = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::buildViolation method instead.', E_USER_DEPRECATED); + if (func_num_args() > 2) { $this ->buildViolation($message, $parameters) @@ -138,6 +141,8 @@ class LegacyExecutionContext extends ExecutionContext */ public function validateValue($value, $constraints, $subPath = '', $groups = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the '.__CLASS__.'::validate method instead.', E_USER_DEPRECATED); + return $this ->getValidator() ->inContext($this) @@ -151,6 +156,8 @@ class LegacyExecutionContext extends ExecutionContext */ public function getMetadataFactory() { + trigger_error('The '.__METHOD__.' is deprecated since version 2.5 and will be removed in 3.0. Use the new Symfony\Component\Validator\Context\ExecutionContext::getValidator method in combination with Symfony\Component\Validator\Validator\ValidatorInterface::getMetadataFor or Symfony\Component\Validator\Validator\ValidatorInterface::hasMetadataFor method instead.', E_USER_DEPRECATED); + return $this->metadataFactory; } } diff --git a/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php b/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php index cf5cd07e9e..c24c1fad3d 100644 --- a/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php +++ b/src/Symfony/Component/Validator/Context/LegacyExecutionContextFactory.php @@ -18,11 +18,12 @@ use Symfony\Component\Validator\Validator\ValidatorInterface; /** * Creates new {@link LegacyExecutionContext} instances. * + * Implemented for backward compatibility with Symfony < 2.5. + * * @since 2.5 * @author Bernhard Schussek * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ class LegacyExecutionContextFactory implements ExecutionContextFactoryInterface { diff --git a/src/Symfony/Component/Validator/ExecutionContext.php b/src/Symfony/Component/Validator/ExecutionContext.php index 31911b8d71..d21dd780f1 100644 --- a/src/Symfony/Component/Validator/ExecutionContext.php +++ b/src/Symfony/Component/Validator/ExecutionContext.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator; +trigger_error('The '.__NAMESPACE__.'\ExecutionContext class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Context\ExecutionContext class instead.', E_USER_DEPRECATED); + use Symfony\Component\Translation\TranslatorInterface; /** @@ -21,7 +23,7 @@ use Symfony\Component\Translation\TranslatorInterface; * @author Fabien Potencier * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Context\ExecutionContext} instead. */ class ExecutionContext implements ExecutionContextInterface diff --git a/src/Symfony/Component/Validator/ExecutionContextInterface.php b/src/Symfony/Component/Validator/ExecutionContextInterface.php index 2da670f00f..3fedfe15de 100644 --- a/src/Symfony/Component/Validator/ExecutionContextInterface.php +++ b/src/Symfony/Component/Validator/ExecutionContextInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Validator; -trigger_error('The "Symfony\Component\Validator\ExecutionContextInterface" interface was deprecated in version 2.5 and will be removed in 3.0. Use "Symfony\Component\Validator\Context\ExecutionContextInterface" instead.', E_USER_DEPRECATED); - /** * Stores the validator's state during validation. * @@ -85,7 +83,7 @@ trigger_error('The "Symfony\Component\Validator\ExecutionContextInterface" inter * * @api * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Context\ExecutionContextInterface} instead. */ interface ExecutionContextInterface @@ -101,9 +99,7 @@ interface ExecutionContextInterface * * @api * - * @deprecated The parameters $invalidValue, $pluralization and $code are - * deprecated since version 2.5 and will be removed in - * Symfony 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); @@ -120,7 +116,7 @@ interface ExecutionContextInterface * * @api * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Context\ExecutionContextInterface::buildViolation()} * instead. */ @@ -165,7 +161,7 @@ interface ExecutionContextInterface * @param bool $deep Whether to traverse the value recursively if * it is a collection of collections. * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Context\ExecutionContextInterface::getValidator()} * instead. */ @@ -198,7 +194,7 @@ interface ExecutionContextInterface * groups here, the current group of the context * will be used. * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Context\ExecutionContextInterface::getValidator()} * instead. */ @@ -259,7 +255,7 @@ interface ExecutionContextInterface * * @return MetadataFactoryInterface The metadata factory. * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Context\ExecutionContextInterface::getValidator()} * instead and call * {@link Validator\ValidatorInterface::getMetadataFor()} or diff --git a/src/Symfony/Component/Validator/GlobalExecutionContextInterface.php b/src/Symfony/Component/Validator/GlobalExecutionContextInterface.php index f07afc8345..5c646f294b 100644 --- a/src/Symfony/Component/Validator/GlobalExecutionContextInterface.php +++ b/src/Symfony/Component/Validator/GlobalExecutionContextInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Validator; -trigger_error('Symfony\Component\Validator\GlobalExecutionContextInterface was deprecated in version 2.5 and will be removed in version 3.0. Please use Symfony\Component\Validator\Context\ExecutionContextInterface instead', E_USER_DEPRECATED); - /** * Stores the node-independent state of a validation run. * @@ -29,7 +27,7 @@ trigger_error('Symfony\Component\Validator\GlobalExecutionContextInterface was d * * @author Bernhard Schussek * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Context\ExecutionContextInterface} instead. */ interface GlobalExecutionContextInterface diff --git a/src/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php b/src/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php index 7913e15625..ad5a980e4c 100644 --- a/src/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php +++ b/src/Symfony/Component/Validator/Mapping/BlackholeMetadataFactory.php @@ -11,14 +11,18 @@ namespace Symfony\Component\Validator\Mapping; +trigger_error('The '.__NAMESPACE__.'\BlackholeMetadataFactory class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Mapping\Factory\BlackHoleMetadataFactory class instead.', E_USER_DEPRECATED); + +use Symfony\Component\Validator\Mapping\Factory\BlackHoleMetadataFactory as MappingBlackHoleMetadataFactory; + /** * Alias of {@link Factory\BlackHoleMetadataFactory}. * * @author Fabien Potencier * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Factory\BlackHoleMetadataFactory} instead. */ -class BlackholeMetadataFactory extends \Symfony\Component\Validator\Mapping\Factory\BlackHoleMetadataFactory +class BlackholeMetadataFactory extends MappingBlackHoleMetadataFactory { } diff --git a/src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php b/src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php index 893bd67a36..5dbe9f406a 100644 --- a/src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php +++ b/src/Symfony/Component/Validator/Mapping/Cache/ApcCache.php @@ -11,11 +11,13 @@ namespace Symfony\Component\Validator\Mapping\Cache; +trigger_error('The '.__NAMESPACE__.'\ApcCache class is deprecated since version 2.5 and will be removed in 3.0. Use DoctrineCache with the Doctrine\Common\Cache\ApcCache class instead.', E_USER_DEPRECATED); + use Symfony\Component\Validator\Mapping\ClassMetadata; /** - * @deprecated Deprecated since version 2.5, to be removed in 3.0. - * Use DoctrineCache with Doctrine\Common\Cache\ApcCache instead. + * @deprecated since version 2.5, to be removed in 3.0. + * Use DoctrineCache with \Doctrine\Common\Cache\ApcCache instead. */ class ApcCache implements CacheInterface { @@ -23,8 +25,6 @@ class ApcCache implements CacheInterface public function __construct($prefix) { - trigger_error('The Symfony\Component\Validator\Mapping\Cache\ApcCache class is deprecated since version 2.5 and will be removed in 3.0. Use DoctrineCache with Doctrine\Common\Cache\ApcCache instead.', E_USER_DEPRECATED); - if (!extension_loaded('apc')) { throw new \RuntimeException('Unable to use ApcCache to cache validator mappings as APC is not enabled.'); } diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php index a75cfbc867..ab945f0c30 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadata.php @@ -129,11 +129,11 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath, $propagatedGroup = null) { - trigger_error('The Symfony\Component\Validator\MetadataInterface::accept() method is deprecated since Symfony 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); if (null === $propagatedGroup && Constraint::DEFAULT_GROUP === $group && ($this->hasGroupSequence() || $this->isGroupSequenceProvider())) { @@ -373,10 +373,12 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface * * @param MemberMetadata $metadata * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. + * @deprecated since version 2.6, to be removed in 3.0. */ protected function addMemberMetadata(MemberMetadata $metadata) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the addPropertyMetadata() method instead.', E_USER_DEPRECATED); + $this->addPropertyMetadata($metadata); } @@ -387,10 +389,12 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface * * @return bool * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use {@link hasPropertyMetadata} instead. + * @deprecated since version 2.6, to be removed in 3.0. Use {@link hasPropertyMetadata} instead. */ public function hasMemberMetadatas($property) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the hasPropertyMetadata() method instead.', E_USER_DEPRECATED); + return $this->hasPropertyMetadata($property); } @@ -401,10 +405,12 @@ class ClassMetadata extends ElementMetadata implements ClassMetadataInterface * * @return MemberMetadata[] An array of MemberMetadata * - * @deprecated Deprecated since version 2.6, to be removed in 3.0. Use {@link getPropertyMetadata} instead. + * @deprecated since version 2.6, to be removed in 3.0. Use {@link getPropertyMetadata} instead. */ public function getMemberMetadatas($property) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the getPropertyMetadata() method instead.', E_USER_DEPRECATED); + return $this->getPropertyMetadata($property); } diff --git a/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php b/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php index 9b05edde8f..92cc85b2ef 100644 --- a/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php +++ b/src/Symfony/Component/Validator/Mapping/ClassMetadataFactory.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator\Mapping; +trigger_error('The '.__NAMESPACE__.'\ClassMetadataFactory class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory class instead.', E_USER_DEPRECATED); + use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; /** @@ -18,7 +20,7 @@ use Symfony\Component\Validator\Mapping\Factory\LazyLoadingMetadataFactory; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link LazyLoadingMetadataFactory} instead. */ class ClassMetadataFactory extends LazyLoadingMetadataFactory diff --git a/src/Symfony/Component/Validator/Mapping/Deprecated/TraversalStrategy.php b/src/Symfony/Component/Validator/Mapping/Deprecated/TraversalStrategy.php new file mode 100644 index 0000000000..28921e0b0b --- /dev/null +++ b/src/Symfony/Component/Validator/Mapping/Deprecated/TraversalStrategy.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Validator\Mapping\Deprecated; + +trigger_error('Constants STOP_RECURSION in class Symfony\Component\Validator\Mapping\TraversalStrategy is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED); + +/** + * @deprecated since version 2.7, to be removed in 3.0. + * @internal + */ +final class TraversalStrategy +{ + const STOP_RECURSION = 8; + + private function __construct() + { + } +} diff --git a/src/Symfony/Component/Validator/Mapping/ElementMetadata.php b/src/Symfony/Component/Validator/Mapping/ElementMetadata.php index 5e4566646d..d036dcf2f1 100644 --- a/src/Symfony/Component/Validator/Mapping/ElementMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/ElementMetadata.php @@ -11,14 +11,14 @@ namespace Symfony\Component\Validator\Mapping; -trigger_error('The "Symfony\Component\Validator\Mapping\ElementMetadata" class was deprecated in version 2.5 and will be removed in 3.0. Use "Symfony\Component\Validator\Mapping\GenericMetadata" instead.', E_USER_DEPRECATED); +trigger_error('The '.__NAMESPACE__.'\ElementMetadata class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Mapping\GenericMetadata class instead.', E_USER_DEPRECATED); /** * Contains the metadata of a structural element. * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Extend {@link GenericMetadata} instead. */ abstract class ElementMetadata extends GenericMetadata diff --git a/src/Symfony/Component/Validator/Mapping/GenericMetadata.php b/src/Symfony/Component/Validator/Mapping/GenericMetadata.php index 904dcd7688..cc0e54d361 100644 --- a/src/Symfony/Component/Validator/Mapping/GenericMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/GenericMetadata.php @@ -231,10 +231,11 @@ class GenericMetadata implements MetadataInterface * * Should not be used. * + * Implemented for backward compatibility with Symfony < 2.5. + * * @throws BadMethodCallException * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * Will be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath) { diff --git a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php index a0bbe0dbf0..394fa2059f 100644 --- a/src/Symfony/Component/Validator/Mapping/MemberMetadata.php +++ b/src/Symfony/Component/Validator/Mapping/MemberMetadata.php @@ -78,10 +78,12 @@ abstract class MemberMetadata extends ElementMetadata implements PropertyMetadat /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath, $propagatedGroup = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + $visitor->visit($this, $value, $group, $propertyPath); if ($this->isCascaded()) { @@ -185,11 +187,13 @@ abstract class MemberMetadata extends ElementMetadata implements PropertyMetadat * * @return bool * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link getCascadingStrategy()} instead. */ public function isCascaded() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getCascadingStrategy() method instead.', E_USER_DEPRECATED); + return (bool) ($this->cascadingStrategy & CascadingStrategy::CASCADE); } @@ -199,11 +203,13 @@ abstract class MemberMetadata extends ElementMetadata implements PropertyMetadat * * @return bool * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link getTraversalStrategy()} instead. */ public function isCollectionCascaded() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED); + return (bool) ($this->traversalStrategy & (TraversalStrategy::IMPLICIT | TraversalStrategy::TRAVERSE)); } @@ -213,11 +219,13 @@ abstract class MemberMetadata extends ElementMetadata implements PropertyMetadat * * @return bool * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link getTraversalStrategy()} instead. */ public function isCollectionCascadedDeeply() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. Use the getTraversalStrategy() method instead.', E_USER_DEPRECATED); + return !($this->traversalStrategy & TraversalStrategy::STOP_RECURSION); } diff --git a/src/Symfony/Component/Validator/Mapping/TraversalStrategy.php b/src/Symfony/Component/Validator/Mapping/TraversalStrategy.php index 5122c475d0..f8e646ffc4 100644 --- a/src/Symfony/Component/Validator/Mapping/TraversalStrategy.php +++ b/src/Symfony/Component/Validator/Mapping/TraversalStrategy.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator\Mapping; +use Symfony\Component\Validator\Mapping\Deprecated\TraversalStrategy as Deprecated; + /** * Specifies whether and how a traversable object should be traversed. * @@ -51,11 +53,11 @@ class TraversalStrategy * Specifies that nested instances of {@link \Traversable} should never be * iterated. Can be combined with {@link IMPLICIT} or {@link TRAVERSE}. * - * @deprecated This constant was added for backwards compatibility only. - * It will be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. This constant was added for backwards compatibility only. + * * @internal */ - const STOP_RECURSION = 8; + const STOP_RECURSION = Deprecated::STOP_RECURSION; /** * Not instantiable. diff --git a/src/Symfony/Component/Validator/MetadataFactoryInterface.php b/src/Symfony/Component/Validator/MetadataFactoryInterface.php index a1c8893328..555bea9aa2 100644 --- a/src/Symfony/Component/Validator/MetadataFactoryInterface.php +++ b/src/Symfony/Component/Validator/MetadataFactoryInterface.php @@ -11,14 +11,12 @@ namespace Symfony\Component\Validator; -trigger_error('The "Symfony\Component\Validator\MetadataFactoryInterface" interface is deprecated since version 2.5 and will be removed in Symfony 3.0. You should use the "Symfony\Component\Validator\Mapping\Factory\MetadataFactoryInterface" interface instead.', E_USER_DEPRECATED); - /** * Returns {@link MetadataInterface} instances for values. * * @author Bernhard Schussek * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Mapping\Factory\MetadataFactoryInterface} instead. */ interface MetadataFactoryInterface diff --git a/src/Symfony/Component/Validator/MetadataInterface.php b/src/Symfony/Component/Validator/MetadataInterface.php index b5c7acf806..2c8944903c 100644 --- a/src/Symfony/Component/Validator/MetadataInterface.php +++ b/src/Symfony/Component/Validator/MetadataInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Validator; -trigger_error('Symfony\Component\Validator\MetadataInterface was deprecated in version 2.5 and will be removed in 3.0. Use Symfony\Component\Validator\Mapping\MetadataInterface instead.', E_USER_DEPRECATED); - /** * A container for validation metadata. * @@ -44,7 +42,7 @@ trigger_error('Symfony\Component\Validator\MetadataInterface was deprecated in v * * @author Bernhard Schussek * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Mapping\MetadataInterface} instead. */ interface MetadataInterface @@ -60,7 +58,7 @@ interface MetadataInterface * @param string|string[] $group The validation group to validate in * @param string $propertyPath The current property path in the validation graph * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function accept(ValidationVisitorInterface $visitor, $value, $group, $propertyPath); diff --git a/src/Symfony/Component/Validator/PropertyMetadataContainerInterface.php b/src/Symfony/Component/Validator/PropertyMetadataContainerInterface.php index cc2ab4c296..5441be1c3d 100644 --- a/src/Symfony/Component/Validator/PropertyMetadataContainerInterface.php +++ b/src/Symfony/Component/Validator/PropertyMetadataContainerInterface.php @@ -11,14 +11,12 @@ namespace Symfony\Component\Validator; -trigger_error('Symfony\Component\Validator\PropertyMetadataContainerInterface is deprecated since version 2.5 and will be removed in 3.0. Use Symfony\Component\Validator\Mapping\ClassMetadataInterface instead.', E_USER_DEPRECATED); - /** * A container for {@link PropertyMetadataInterface} instances. * * @author Bernhard Schussek * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Mapping\ClassMetadataInterface} instead. */ interface PropertyMetadataContainerInterface diff --git a/src/Symfony/Component/Validator/PropertyMetadataInterface.php b/src/Symfony/Component/Validator/PropertyMetadataInterface.php index 12ddd89039..20af8a993b 100644 --- a/src/Symfony/Component/Validator/PropertyMetadataInterface.php +++ b/src/Symfony/Component/Validator/PropertyMetadataInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Validator; -trigger_error('Symfony\Component\Validator\PropertyMetadataInterface was deprecated in version 2.5 and will be removed in version 3.0. Please use Symfony\Component\Validator\Mapping\PropertyMetadataInterface instead', E_USER_DEPRECATED); - /** * A container for validation metadata of a property. * @@ -26,7 +24,7 @@ trigger_error('Symfony\Component\Validator\PropertyMetadataInterface was depreca * * @see MetadataInterface * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Mapping\PropertyMetadataInterface} instead. */ interface PropertyMetadataInterface extends MetadataInterface diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf index 7193e5357b..f0824bb2ec 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.es.xlf @@ -302,6 +302,10 @@ An empty file is not allowed. No está permitido un archivo vacío. + + The host could not be resolved. + No se puede resolver el host. + diff --git a/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php index d55e464268..d65070ee8f 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/AbstractConstraintValidatorTest.php @@ -25,7 +25,7 @@ use Symfony\Component\Validator\Tests\Fixtures\StubGlobalExecutionContext; use Symfony\Component\Validator\Validation; /** - * @since 2.5.3 + * @since 2.5.3 * * @author Bernhard Schussek */ @@ -42,19 +42,12 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa protected $validator; protected $group; - protected $metadata; - protected $object; - protected $value; - protected $root; - protected $propertyPath; - protected $constraint; - protected $defaultTimezone; protected function setUp() @@ -174,8 +167,7 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa * * @return ConstraintViolation * - * @deprecated To be removed in Symfony 3.0. Use - * {@link buildViolation()} instead. + * @deprecated to be removed in Symfony 3.0. Use {@link buildViolation()} instead. */ protected function createViolation($message, array $parameters = array(), $propertyPath = 'property.path', $invalidValue = 'InvalidValue', $plural = null, $code = null) { @@ -367,6 +359,8 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa */ protected function assertViolation($message, array $parameters = array(), $propertyPath = 'property.path', $invalidValue = 'InvalidValue', $plural = null, $code = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the buildViolation() method instead.', E_USER_DEPRECATED); + $this->buildViolation($message) ->setParameters($parameters) ->atPath($propertyPath) @@ -384,6 +378,8 @@ abstract class AbstractConstraintValidatorTest extends \PHPUnit_Framework_TestCa */ protected function assertViolations(array $expected) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the buildViolation() method instead.', E_USER_DEPRECATED); + $violations = $this->context->getViolations(); $this->assertCount(count($expected), $violations); diff --git a/src/Symfony/Component/Validator/Tests/Fixtures/StubGlobalExecutionContext.php b/src/Symfony/Component/Validator/Tests/Fixtures/StubGlobalExecutionContext.php index 6ae3663f04..84c5a80bf2 100644 --- a/src/Symfony/Component/Validator/Tests/Fixtures/StubGlobalExecutionContext.php +++ b/src/Symfony/Component/Validator/Tests/Fixtures/StubGlobalExecutionContext.php @@ -20,14 +20,12 @@ use Symfony\Component\Validator\ValidationVisitorInterface; * * @author Bernhard Schussek * - * @deprecated + * @deprecated since version 2.5, to be removed in 3.0 */ class StubGlobalExecutionContext implements GlobalExecutionContextInterface { private $violations; - private $root; - private $visitor; public function __construct($root = null, ValidationVisitorInterface $visitor = null) diff --git a/src/Symfony/Component/Validator/ValidationVisitor.php b/src/Symfony/Component/Validator/ValidationVisitor.php index 2edf1386b7..c7e06554b8 100644 --- a/src/Symfony/Component/Validator/ValidationVisitor.php +++ b/src/Symfony/Component/Validator/ValidationVisitor.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator; +trigger_error('The '.__NAMESPACE__.'\ValidationVisitor class 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\Exception\NoSuchMetadataException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; @@ -21,7 +23,7 @@ use Symfony\Component\Validator\Exception\UnexpectedTypeException; * * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionContextInterface { @@ -79,8 +81,6 @@ class ValidationVisitor implements ValidationVisitorInterface, GlobalExecutionCo */ public function __construct($root, MetadataFactoryInterface $metadataFactory, ConstraintValidatorFactoryInterface $validatorFactory, TranslatorInterface $translator, $translationDomain = null, array $objectInitializers = array()) { - trigger_error('Symfony\Component\Validator\ValidationVisitor was deprecated in version 2.5 and will be removed in version 3.0.', E_USER_DEPRECATED); - foreach ($objectInitializers as $initializer) { if (!$initializer instanceof ObjectInitializerInterface) { throw new UnexpectedTypeException($initializer, 'Symfony\Component\Validator\ObjectInitializerInterface'); diff --git a/src/Symfony/Component/Validator/ValidationVisitorInterface.php b/src/Symfony/Component/Validator/ValidationVisitorInterface.php index a1227e9c55..0ab7b73667 100644 --- a/src/Symfony/Component/Validator/ValidationVisitorInterface.php +++ b/src/Symfony/Component/Validator/ValidationVisitorInterface.php @@ -11,8 +11,6 @@ namespace Symfony\Component\Validator; -trigger_error('Symfony\Component\Validator\ValidationVisitorInterface was deprecated in version 2.5 and will be removed in version 3.0.', E_USER_DEPRECATED); - /** * Validates values against constraints defined in {@link MetadataInterface} * instances. @@ -36,7 +34,7 @@ trigger_error('Symfony\Component\Validator\ValidationVisitorInterface was deprec * * @author Bernhard Schussek * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ interface ValidationVisitorInterface { @@ -66,8 +64,6 @@ interface ValidationVisitorInterface * * @throws Exception\NoSuchMetadataException If no metadata can be found for * the given value. - * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. */ public function validate($value, $group, $propertyPath, $traverse = false, $deep = false); @@ -81,8 +77,6 @@ interface ValidationVisitorInterface * @param mixed $value The value to validate. * @param string $group The validation group to validate. * @param string $propertyPath The current property path in the validation graph. - * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. */ public function visit(MetadataInterface $metadata, $value, $group, $propertyPath); } diff --git a/src/Symfony/Component/Validator/Validator.php b/src/Symfony/Component/Validator/Validator.php index 6edbb7ac56..8243f17acb 100644 --- a/src/Symfony/Component/Validator/Validator.php +++ b/src/Symfony/Component/Validator/Validator.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator; +trigger_error('The '.__NAMESPACE__.'\Validator class is deprecated since version 2.5 and will be removed in 3.0. Use the Symfony\Component\Validator\Validator\RecursiveValidator class instead.', E_USER_DEPRECATED); + use Symfony\Component\Translation\TranslatorInterface; use Symfony\Component\Validator\Constraints\Valid; use Symfony\Component\Validator\Exception\ValidatorException; @@ -21,7 +23,7 @@ use Symfony\Component\Validator\Exception\ValidatorException; * @author Fabien Potencier * @author Bernhard Schussek * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Validator\RecursiveValidator} instead. */ class Validator implements ValidatorInterface, Mapping\Factory\MetadataFactoryInterface diff --git a/src/Symfony/Component/Validator/Validator/LegacyValidator.php b/src/Symfony/Component/Validator/Validator/LegacyValidator.php index 63a1ddc6cd..1d4153733d 100644 --- a/src/Symfony/Component/Validator/Validator/LegacyValidator.php +++ b/src/Symfony/Component/Validator/Validator/LegacyValidator.php @@ -34,8 +34,7 @@ use Symfony\Component\Validator\ValidatorInterface as LegacyValidatorInterface; * @see \Symfony\Component\Validator\ValidatorInterface * @see \Symfony\Component\Validator\Validator\ValidatorInterface * - * @deprecated Implemented for backwards compatibility with Symfony < 2.5. - * To be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ class LegacyValidator extends RecursiveValidator implements LegacyValidatorInterface { @@ -52,7 +51,7 @@ class LegacyValidator extends RecursiveValidator implements LegacyValidatorInter return parent::validate($value, $constraints, $groups); } - trigger_error('Symfony\\Component\\Validator\\ValidatorInterface::validate() was deprecated in version 2.5 and will be removed in version 3.0. Please use Symfony\\Component\\Validator\\Validator\\ValidatorInterface::validate() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::validate method instead.', E_USER_DEPRECATED); $constraint = new Valid(array('traverse' => $traverse, 'deep' => $deep)); @@ -61,13 +60,15 @@ class LegacyValidator extends RecursiveValidator implements LegacyValidatorInter public function validateValue($value, $constraints, $groups = null) { - trigger_error('Symfony\\Component\\Validator\\ValidatorInterface::validateValue() was deprecated in version 2.5 and will be removed in version 3.0. Please use Symfony\\Component\\Validator\\Validator\\ValidatorInterface::validate() instead.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::validate method instead.', E_USER_DEPRECATED); return parent::validate($value, $constraints, $groups); } public function getMetadataFactory() { + trigger_error('The '.__METHOD__.' method is deprecated in version 2.5 and will be removed in version 3.0. Use the Symfony\Component\Validator\Validator\ValidatorInterface::getMetadataFor or Symfony\Component\Validator\Validator\ValidatorInterface::hasMetadataFor method instead.', E_USER_DEPRECATED); + return $this->metadataFactory; } diff --git a/src/Symfony/Component/Validator/ValidatorBuilder.php b/src/Symfony/Component/Validator/ValidatorBuilder.php index 39452c5573..29bd1f9dcc 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilder.php +++ b/src/Symfony/Component/Validator/ValidatorBuilder.php @@ -303,11 +303,12 @@ class ValidatorBuilder implements ValidatorBuilderInterface /** * {@inheritdoc} * - * @deprecated Deprecated since version 2.5 and will be removed in 3.0. The validator will function without a property accessor. + * @deprecated since version 2.5, to be removed in 3.0. + * The validator will function without a property accessor. */ public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor) { - trigger_error('ValidatorBuilder::setPropertyAccessor() is deprecated since version 2.5 and will be removed in 3.0. The validator will function without a property accessor.', E_USER_DEPRECATED); + trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0. The validator will function without a property accessor.', E_USER_DEPRECATED); if (null !== $this->validatorFactory) { throw new ValidatorException('You cannot set a property accessor after setting a custom validator factory. Configure your validator factory instead.'); diff --git a/src/Symfony/Component/Validator/ValidatorBuilderInterface.php b/src/Symfony/Component/Validator/ValidatorBuilderInterface.php index 2fd0f9c58b..dc4f4277b4 100644 --- a/src/Symfony/Component/Validator/ValidatorBuilderInterface.php +++ b/src/Symfony/Component/Validator/ValidatorBuilderInterface.php @@ -167,7 +167,7 @@ interface ValidatorBuilderInterface * * @return ValidatorBuilderInterface The builder object * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. */ public function setPropertyAccessor(PropertyAccessorInterface $propertyAccessor); diff --git a/src/Symfony/Component/Validator/ValidatorInterface.php b/src/Symfony/Component/Validator/ValidatorInterface.php index a9c0a0d8fb..d207a9c940 100644 --- a/src/Symfony/Component/Validator/ValidatorInterface.php +++ b/src/Symfony/Component/Validator/ValidatorInterface.php @@ -18,7 +18,7 @@ namespace Symfony\Component\Validator; * * @api * - * @deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Validator\ValidatorInterface} instead. */ interface ValidatorInterface @@ -93,8 +93,9 @@ interface ValidatorInterface * * @api * - * @deprecated Renamed to {@link Validator\ValidatorInterface::validate()} - * in Symfony 2.5. Will be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. + * Renamed to {@link Validator\ValidatorInterface::validate()} + * in Symfony 2.5. */ public function validateValue($value, $constraints, $groups = null); @@ -105,7 +106,7 @@ interface ValidatorInterface * * @api * - * @deprecated Deprecated since version 2.5, to be removed in Symfony 3.0. + * @deprecated since version 2.5, to be removed in 3.0. * Use {@link Validator\ValidatorInterface::getMetadataFor()} or * {@link Validator\ValidatorInterface::hasMetadataFor()} * instead. diff --git a/src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php b/src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php index 0607552cfc..01effe46c8 100644 --- a/src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php +++ b/src/Symfony/Component/Validator/Violation/LegacyConstraintViolationBuilder.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Validator\Violation; +trigger_error('The '.__NAMESPACE__.'\LegacyConstraintViolationBuilder class is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED); + use Symfony\Component\Validator\ExecutionContextInterface; /** @@ -21,7 +23,7 @@ use Symfony\Component\Validator\ExecutionContextInterface; * @internal You should not instantiate or use this class. Code against * {@link ConstraintViolationBuilderInterface} instead. * - * @deprecated This class will be removed in Symfony 3.0. + * @deprecated since version 2.5.5, to be removed in 3.0. */ class LegacyConstraintViolationBuilder implements ConstraintViolationBuilderInterface { diff --git a/src/Symfony/Component/Yaml/Deprecated/Unescaper.php b/src/Symfony/Component/Yaml/Deprecated/Unescaper.php new file mode 100644 index 0000000000..3885dee7ce --- /dev/null +++ b/src/Symfony/Component/Yaml/Deprecated/Unescaper.php @@ -0,0 +1,19 @@ +