8000 Adds deprecation notices for structures to be removed in 3.0. · symfony/symfony@ef08363 · GitHub
[go: up one dir, main page]

Skip to content

Commit ef08363

Browse files
author
Hugo Hamon
committed
Adds deprecation notices for structures to be removed in 3.0.
1 parent f2c54c7 commit ef08363
  • HttpKernel
  • Locale
  • OptionsResolver
  • Process
  • PropertyAccess
  • Routing
  • Security
  • Serializer/Encoder
  • Templating
  • Translation
  • Validator
  • Yaml
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    151 files changed

    +388
    -72
    lines changed

    src/Symfony/Bridge/Doctrine/Form/ChoiceList/EntityChoiceList.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -299,6 +299,8 @@ public function getValuesForChoices(array $entities)
    299299
    */
    300300
    public function getIndicesForChoices(array $entities)
    301301
    {
    302+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
    303+
    302304
    // Performance optimization
    303305
    if (empty($entities)) {
    304306
    return array();
    @@ -341,6 +343,8 @@ public function getIndicesForChoices(array $entities)
    341343
    */
    342344
    public function getIndicesForValues(array $values)
    343345
    {
    346+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
    347+
    344348
    // Performance optimization
    345349
    if (empty($values)) {
    346350
    return array();

    src/Symfony/Bridge/Doctrine/Tests/DoctrineOrmTestCase.php

    Lines changed: 2 additions & 0 deletions
    Original file line numbe 10000 rDiff line numberDiff line change
    @@ -11,6 +11,8 @@
    1111

    1212
    namespace Symfony\Bridge\Doctrine\Tests;
    1313

    14+
    trigger_error(__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);
    15+
    1416
    use Symfony\Bridge\Doctrine\Test\DoctrineTestHelper;
    1517

    1618
    /**

    src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -304,6 +304,8 @@ public function getValuesForChoices(array $models)
    304304
    */
    305305
    public function getIndicesForChoices(array $models)
    306306
    {
    307+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
    308+
    307309
    if (empty($models)) {
    308310
    return array();
    309311
    }
    @@ -350,6 +352,8 @@ public function getIndicesForChoices(array $models)
    350352
    */
    351353
    public function getIndicesForValues(array $values)
    352354
    {
    355+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.4 and will be removed in 3.0.', E_USER_DEPRECATED);
    356+
    353357
    if (empty($values)) {
    354358
    return array();
    355359
    }

    src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -272,7 +272,7 @@ public function createFormBuilder($data = null, array $options = array())
    272272
    */
    273273
    public function getRequest()
    274274
    {
    275-
    trigger_error('The "getRequest" method of the base "Controller" class has been deprecated since Symfony 2.4 and will be removed in 3.0. The only reliable way to get the "Request" object is to inject it in the action method.', E_USER_DEPRECATED);
    275+
    trigger_error('The '.__METHOD__.' method has been deprecated since Symfony 2.4 and will be removed in 3.0. The only reliable way to get the "Request" object is to inject it in the action method.', E_USER_DEPRECATED);
    276276

    277277
    return $this->container->get('request_stack')->getCurrentRequest();
    278278
    }

    src/Symfony/Bundle/FrameworkBundle/Templating/Debugger.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,8 @@
    1111

    1212
    namespace Symfony\Bundle\FrameworkBundle\Templating;
    1313

    14+
    trigger_error('The '.__CLASS__.' class is deprecated since version 2.4 and will be removed in 3.0. Use Psr\Log\LoggerInterface instead.', E_USER_DEPRECATED);
    15+
    1416
    use Symfony\Component\Templating\DebuggerInterface;
    1517
    use Psr\Log\LoggerInterface;
    1618

    src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -42,6 +42,8 @@ public function __construct(ContainerInterface $container)
    4242
    */
    4343
    public function getSecurity()
    4444
    {
    45+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
    46+
    4547
    if ($this->container->has('security.context')) {
    4648
    return $this->container->get('security.context');
    4749
    }

    src/Symfony/Bundle/FrameworkBundle/Templating/Helper/RequestHelper.php

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -35,6 +35,7 @@ class RequestHelper extends Helper
    3535
    public function __construct($requestStack)
    3636
    {
    3737
    if ($requestStack instanceof Request) {
    38+
    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);
    3839
    $this->request = $requestStack;
    3940
    } elseif ($requestStack instanceof RequestStack) {
    4041
    $this->requestStack = $requestStack;

    src/Symfony/Bundle/FrameworkBundle/Templating/Helper/SessionHelper.php

    Lines changed: 1 addition & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -35,6 +35,7 @@ class SessionHelper extends Helper
    3535
    public function __construct($requestStack)
    3636
    {
    3737
    if ($requestStack instanceof Request) {
    38+
    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);
    3839
    $this->session = $requestStack->getSession();
    3940
    } elseif ($requestStack instanceof RequestStack) {
    4041
    $this->requestStack = $requestStack;

    src/Symfony/Bundle/TwigBundle/Extension/ActionsExtension.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,8 @@
    1111

    1212
    namespace Symfony\Bundle\TwigBundle\Extension;
    1313

    14+
    trigger_error('The '.__CLASS__.' class is deprecated since version 2.2 and will be removed in Symfony 3.0.', E_USER_DEPRECATED);
    15+
    1416
    use Symfony\Bundle\TwigBundle\TokenParser\RenderTokenParser;
    1517
    use Symfony\Component\DependencyInjection\ContainerInterface;
    1618

    src/Symfony/Component/ClassLoader/DebugClassLoader.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,8 @@
    1111

    1212
    namespace Symfony\Component\ClassLoader;
    1313

    14+
    trigger_error('The '.__CLASS__.' 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);
    15+
    1416
    /**
    1517
    * Autoloader checking if the class is really defined in the file found.
    1618
    *

    src/Symfony/Component/ClassLoader/UniversalClassLoader.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -11,7 +11,7 @@
    1111

    1212
    namespace Symfony\Component\ClassLoader;
    1313

    14-
    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);
    14+
    trigger_error('The '.__CLASS__.' class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\ClassLoader\ClassLoader class instead.', E_USER_DEPRECATED);
    1515

    1616
    /**
    1717
    * UniversalClassLoader implements a "universal" autoloader for PHP 5.3.

    src/Symfony/Component/Config/Definition/ReferenceDumper.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,8 @@
    1111

    1212
    namespace Symfony\Component\Config\Definition;
    1313

    14+
    trigger_error('The '.__CLASS__.' class is deprecated since version 2.4 and will be removed in 3.0. Use the Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper class instead.', E_USER_DEPRECATED);
    15+
    1416
    use Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper;
    1517

    1618
    /**

    src/Symfony/Component/Console/Application.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -628,6 +628,8 @@ public static function getAbbreviations($names)
    628628
    */
    629629
    public function asText($namespace = null, $raw = false)
    630630
    {
    631+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED);
    632+
    631633
    $descriptor = new TextDescriptor();
    632634
    $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, !$raw);
    633635
    $descriptor->describe($output, $this, array('namespace' => $namespace, 'raw_output' => true));
    @@ -647,6 +649,8 @@ public function asText($namespace = null, $raw = false)
    647649
    */
    648650
    public function asXml($namespace = null, $asDom = false)
    649651
    {
    652+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED);
    653+
    650654
    $descriptor = new XmlDescriptor();
    651655

    652656
    if ($asDom) {

    src/Symfony/Component/Console/Command/Command.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -609,6 +609,8 @@ public function getHelper($name)
    609609
    */
    610610
    public function asText()
    611611
    {
    612+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED);
    613+
    612614
    $descriptor = new TextDescriptor();
    613615
    $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
    614616
    $descriptor->describe($output, $this, array('raw_output' => true));
    @@ -627,6 +629,8 @@ public function asText()
    627629
    */
    628630
    public function asXml($asDom = false)
    629631
    {
    632+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED);
    633+
    630634
    $descriptor = new XmlDescriptor();
    631635

    632636
    if ($asDom) {

    src/Symfony/Component/Console/Helper/ProgressBar.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -177,6 +177,8 @@ public function getMaxSteps()
    177177
    */
    178178
    public function getStep()
    179179
    {
    180+
    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);
    181+
    180182
    return $this->getProgress();
    181183
    }
    182184

    @@ -366,6 +368,8 @@ public function advance($step = 1)
    366368
    */
    367369
    public function setCurrent($step)
    368370
    {
    371+
    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);
    372+
    369373
    $this->setProgress($step);
    370374
    }
    371375

    src/Symfony/Component/Console/Input/InputDefinition.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -421,6 +421,8 @@ public function getSynopsis()
    421421
    */
    422422
    public function asText()
    423423
    {
    424+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED);
    425+
    424426
    $descriptor = new TextDescriptor();
    425427
    $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true);
    426428
    $descriptor->describe($output, $this, array('raw_output' => true));
    @@ -439,6 +441,8 @@ public function asText()
    439441
    */
    440442
    public function asXml($asDom = false)
    441443
    {
    444+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0.', E_USER_DEPRECATED);
    445+
    442446
    $descriptor = new XmlDescriptor();
    443447

    444448
    if ($asDom) {

    src/Symfony/Component/Console/Input/StringInput.php

    Lines changed: 4 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -39,6 +39,10 @@ class StringInput extends ArgvInput
    3939
    */
    4040
    public function __construct($input, InputDefinition $definition = null)
    4141
    {
    42+
    if ($definition) {
    43+
    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);
    44+
    }
    45+
    4246
    parent::__construct(array(), null);
    4347

    4448
    $this->setTokens($this->tokenize($input));

    src/Symfony/Component/Debug/DebugClassLoader.php

    Lines changed: 13 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -41,6 +41,10 @@ class DebugClassLoader
    4141
    */
    4242
    public function __construct($classLoader)
    4343
    {
    44+
    if (is_object($classLoader)) {
    45+
    trigger_error('Since 2.5, passing an object in the $classLoader argument of the '.__METHOD__.' is deprecated and support for it will be removed in 3.0.', E_USER_DEPRECATED);
    46+
    }
    47+
    4448
    $this->wasFinder = is_object($classLoader) && method_exists($classLoader, 'fi 10000 ndFile');
    4549

    4650
    if ($this->wasFinder) {
    @@ -65,7 +69,13 @@ public function __construct($classLoader)
    6569
    */
    6670
    public function getClassLoader()
    6771
    {
    68-
    return $this->wasFinder ? $this->classLoader[0] : $this->classLoader;
    72+
    $classLoader = $this->wasFinder ? $this->classLoader[0] : $this->classLoader;
    73+
    74+
    if (is_object($classLoader)) {
    75+
    trigger_error('Since version 2.5, returning an object in '.__METHOD__.' method is deprecated and support for it will be removed in 3.0.', E_USER_DEPRECATED);
    76+
    }
    77+
    78+
    return $classLoader;
    6979
    }
    7080

    7181
    /**
    @@ -127,6 +137,8 @@ public static function disable()
    127137
    */
    128138
    public function findFile($class)
    129139
    {
    140+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
    141+
    130142
    if ($this->wasFinder) {
    131143
    return $this->classLoader[0]->findFile($class);
    132144
    }

    src/Symfony/Component/Debug/ErrorHandler.php

    Lines changed: 10 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -590,6 +590,8 @@ protected function getFatalErrorHandlers()
    590590
    */
    591591
    public function setLevel($level)
    592592
    {
    593+
    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);
    594+
    593595
    $level = null === $level ? error_reporting() : $level;
    594596
    $this->throwAt($level, true);
    595597
    }
    @@ -603,6 +605,8 @@ public function setLevel($level)
    603605
    */
    604606
    public function setDisplayErrors($displayErrors)
    605607
    {
    608+
    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);
    609+
    606610
    if ($displayErrors) {
    607611
    $this->throwAt($this->displayErrors, true);
    608612
    } else {
    @@ -622,6 +626,8 @@ public function setDisplayErrors($displayErrors)
    622626
    */
    623627
    public static function setLogger(LoggerInterface $logger, $channel = 'deprecation')
    624628
    {
    629+
    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);
    630+
    625631
    $handler = set_error_handler('var_dump', 0);
    626632
    $handler = is_array($handler) ? $handler[0] : null;
    627633
    restore_error_handler();
    @@ -645,6 +651,8 @@ public static function setLogger(LoggerInterface $logger, $channel = 'deprecatio
    645651
    */
    646652
    public function handle($level, $message, $file = 'unknown', $line = 0, $context = array())
    647653
    {
    654+
    trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the handleError() method instead.', E_USER_DEPRECATED);
    655+
    648656
    return $this->handleError($level, $message, $file, $line, (array) $context);
    649657
    }
    650658

    @@ -655,6 +663,8 @@ public function handle($level, $message, $file = 'unknown', $line = 0, $context
    655663
    */
    656664
    public function handleFatal()
    657665
    {
    666+
    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);
    667+
    658668
    static::handleFatalError();
    659669
    }
    660670
    }

    src/Symfony/Component/Debug/Exception/DummyException.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,8 @@
    1111

    1212
    namespace Symfony\Component\Debug\Exception;
    1313

    14+
    trigger_error('The '.__CLASS__.' class is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
    15+
    1416
    /**
    1517
    * @author Fabien Potencier <fabien@symfony.com>
    1618
    *

    src/Symfony/Component/DependencyInjection/Definition.php

    Lines changed: 9 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -98,7 +98,7 @@ public function getFactory()
    9898
    */
    9999
    public function setFactoryClass($factoryClass)
    100100
    {
    101-
    trigger_error('Definition::setFactoryClass() is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED);
    101+
    trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED);
    102102

    103103
    $this->factoryClass = $factoryClass;
    104104

    @@ -115,6 +115,8 @@ public function setFactoryClass($factoryClass)
    115115
    */
    116116
    public function getFactoryClass()
    117117
    {
    118+
    trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
    119+
    118120
    return $this->factoryClass;
    119121
    }
    120122

    @@ -130,7 +132,7 @@ public function getFactoryClass()
    130132
    */
    131133
    public function setFactoryMethod($factoryMethod)
    132134
    {
    133-
    trigger_error('Definition::setFactoryMethod() is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED);
    135+
    trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED);
    134136

    135137
    $this->factoryMethod = $factoryMethod;
    136138

    @@ -182,6 +184,8 @@ public function getDecoratedService()
    182184
    */
    183185
    public function getFactoryMethod()
    184186
    {
    187+
    trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
    188+
    185189
    return $this->factoryMethod;
    186190
    }
    187191

    @@ -197,7 +201,7 @@ public function getFactoryMethod()
    197201
    */
    198202
    public function setFactoryService($factoryService)
    199203
    {
    200-
    trigger_error('Definition::setFactoryService() is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED);
    204+
    trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0. Use Definition::setFactory() instead.', E_USER_DEPRECATED);
    201205

    202206
    $this->factoryService = $factoryService;
    203207

    @@ -214,6 +218,8 @@ public function setFactoryService($factoryService)
    214218
    */
    215219
    public function getFactoryService()
    216220
    {
    221+
    trigger_error('The '.__METHOD__.' is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
    222+
    217223
    return $this->factoryService;
    218224
    }
    219225

    src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1408,6 +1408,8 @@ public function dumpParameter($name)
    14081408
    */
    14091409
    public function addExpressionLanguageProvider(ExpressionFunctionProviderInterface $provider)
    14101410
    {
    1411+
    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);
    1412+
    14111413
    $this->expressionLanguageProviders[] = $provider;
    14121414
    }
    14131415

    src/Symfony/Component/DependencyInjection/SimpleXMLElement.php

    Lines changed: 2 additions & 0 deletions
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,8 @@
    1111

    1212
    namespace Symfony\Component\DependencyInjection;
    1313

    14+
    trigger_error('The '.__CLASS__.' method is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
    15+
    1416
    use Symfony\Component\Config\Util\XmlUtils;
    1517
    use Symfony\Component\ExpressionLanguage\Expression;
    1618

    0 commit comments

    Comments
     (0)
    0