feature #15685 [3.0] Various deprecation removal (nicolas-grekas)
This PR was merged into the 3.0-dev branch.
Discussion
----------
[3.0] Various deprecation removal
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
b1f3d52
[3.0] Various deprecation removal
This commit is contained in:
commit
a32e9ac153
@ -90,7 +90,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
|
|||||||
$this->setMaxRunningTime(1);
|
$this->setMaxRunningTime(1);
|
||||||
|
|
||||||
for ($i = 0; $i < 40; ++$i) {
|
for ($i = 0; $i < 40; ++$i) {
|
||||||
$form = $this->factory->create('entity', null, array(
|
$form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
|
||||||
'class' => self::ENTITY_CLASS,
|
'class' => self::ENTITY_CLASS,
|
||||||
));
|
));
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
|
|||||||
$this->setMaxRunningTime(1);
|
$this->setMaxRunningTime(1);
|
||||||
|
|
||||||
for ($i = 0; $i < 40; ++$i) {
|
for ($i = 0; $i < 40; ++$i) {
|
||||||
$form = $this->factory->create('entity', null, array(
|
$form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
|
||||||
'class' => self::ENTITY_CLASS,
|
'class' => self::ENTITY_CLASS,
|
||||||
'choices' => $choices,
|
'choices' => $choices,
|
||||||
));
|
));
|
||||||
@ -127,7 +127,7 @@ class EntityTypePerformanceTest extends FormPerformanceTestCase
|
|||||||
$this->setMaxRunningTime(1);
|
$this->setMaxRunningTime(1);
|
||||||
|
|
||||||
for ($i = 0; $i < 40; ++$i) {
|
for ($i = 0; $i < 40; ++$i) {
|
||||||
$form = $this->factory->create('entity', null, array(
|
$form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
|
||||||
'class' => self::ENTITY_CLASS,
|
'class' => self::ENTITY_CLASS,
|
||||||
'preferred_choices' => $choices,
|
'preferred_choices' => $choices,
|
||||||
));
|
));
|
||||||
|
@ -110,13 +110,10 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
|||||||
'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php',
|
'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php',
|
||||||
'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php',
|
'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php',
|
||||||
)),
|
)),
|
||||||
);
|
array(__DIR__.'/Fixtures/php5.5', array(
|
||||||
|
|
||||||
if (PHP_VERSION_ID >= 50500) {
|
|
||||||
$data[] = array(__DIR__.'/Fixtures/php5.5', array(
|
|
||||||
'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php',
|
'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php',
|
||||||
));
|
)),
|
||||||
}
|
);
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
@ -30,18 +30,6 @@ class BooleanNodeDefinition extends ScalarNodeDefinition
|
|||||||
$this->nullEquivalent = true;
|
$this->nullEquivalent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*
|
|
||||||
* @deprecated Deprecated since version 2.8, to be removed in 3.0.
|
|
||||||
*/
|
|
||||||
public function cannotBeEmpty()
|
|
||||||
{
|
|
||||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
return parent::cannotBeEmpty();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiate a Node.
|
* Instantiate a Node.
|
||||||
*
|
*
|
||||||
|
@ -58,16 +58,4 @@ abstract class NumericNodeDefinition extends ScalarNodeDefinition
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*
|
|
||||||
* @deprecated Deprecated since version 2.8, to be removed in 3.0.
|
|
||||||
*/
|
|
||||||
public function cannotBeEmpty()
|
|
||||||
{
|
|
||||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
return parent::cannotBeEmpty();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -181,7 +181,7 @@ class ProgressBar
|
|||||||
/**
|
/**
|
||||||
* Gets the progress bar step width.
|
* Gets the progress bar step width.
|
||||||
*
|
*
|
||||||
* @return int The progress bar step width
|
* @return int The progress bar step width
|
||||||
*/
|
*/
|
||||||
private function getStepWidth()
|
private function getStepWidth()
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@ class StringInput extends ArgvInput
|
|||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param string $input An array of parameters from the CLI (in the argv format)
|
* @param string $input An array of parameters from the CLI (in the argv format)
|
||||||
*
|
*
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
|
@ -76,28 +76,28 @@ interface OutputInterface
|
|||||||
public function getVerbosity();
|
public function getVerbosity();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether verbosity is quiet (-q)
|
* Returns whether verbosity is quiet (-q).
|
||||||
*
|
*
|
||||||
* @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise
|
* @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise
|
||||||
*/
|
*/
|
||||||
public function isQuiet();
|
public function isQuiet();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether verbosity is verbose (-v)
|
* Returns whether verbosity is verbose (-v).
|
||||||
*
|
*
|
||||||
* @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise
|
* @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise
|
||||||
*/
|
*/
|
||||||
public function isVerbose();
|
public function isVerbose();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether verbosity is very verbose (-vv)
|
* Returns whether verbosity is very verbose (-vv).
|
||||||
*
|
*
|
||||||
* @return bool true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise
|
* @return bool true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise
|
||||||
*/
|
*/
|
||||||
public function isVeryVerbose();
|
public function isVeryVerbose();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether verbosity is debug (-vvv)
|
* Returns whether verbosity is debug (-vvv).
|
||||||
*
|
*
|
||||||
* @return bool true if verbosity is set to VERBOSITY_DEBUG, false otherwise
|
* @return bool true if verbosity is set to VERBOSITY_DEBUG, false otherwise
|
||||||
*/
|
*/
|
||||||
|
@ -122,7 +122,7 @@ class ExceptionHandler
|
|||||||
|
|
||||||
$caughtLength = $this->caughtLength = 0;
|
$caughtLength = $this->caughtLength = 0;
|
||||||
|
|
||||||
ob_start(function($buffer) {
|
ob_start(function ($buffer) {
|
||||||
$this->caughtBuffer = $buffer;
|
$this->caughtBuffer = $buffer;
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
@ -133,7 +133,7 @@ class ExceptionHandler
|
|||||||
// Empty loop, everything is in the condition
|
// Empty loop, everything is in the condition
|
||||||
}
|
}
|
||||||
if (isset($this->caughtBuffer[0])) {
|
if (isset($this->caughtBuffer[0])) {
|
||||||
ob_start(function($buffer) {
|
ob_start(function ($buffer) {
|
||||||
if ($this->caughtLength) {
|
if ($this->caughtLength) {
|
||||||
// use substr_replace() instead of substr() for mbstring overloading resistance
|
// use substr_replace() instead of substr() for mbstring overloading resistance
|
||||||
$cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength);
|
$cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength);
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
namespace Symfony\Component\EventDispatcher\Tests;
|
namespace Symfony\Component\EventDispatcher\Tests;
|
||||||
|
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for Event.
|
* Test class for Event.
|
||||||
|
@ -13,7 +13,6 @@ namespace Symfony\Component\HttpFoundation\Session\Storage;
|
|||||||
|
|
||||||
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
|
||||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
|
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
|
||||||
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
|
|
||||||
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
|
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
|
||||||
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
|
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ use Symfony\Component\HttpFoundation\Session\Flash\FlashBag;
|
|||||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
|
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
|
||||||
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
|
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
|
||||||
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
|
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
|
||||||
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
|
|
||||||
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
|
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,7 +91,6 @@ class AbstractProxyTest extends \PHPUnit_Framework_TestCase
|
|||||||
*/
|
*/
|
||||||
public function testIsActive()
|
public function testIsActive()
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->assertFalse($this->proxy->isActive());
|
$this->assertFalse($this->proxy->isActive());
|
||||||
session_start();
|
session_start();
|
||||||
$this->assertTrue($this->proxy->isActive());
|
$this->assertTrue($this->proxy->isActive());
|
||||||
|
@ -86,22 +86,6 @@ class Route
|
|||||||
|
|
||||||
public function setRequirements($requirements)
|
public function setRequirements($requirements)
|
||||||
{
|
{
|
||||||
if (isset($requirements['_method'])) {
|
|
||||||
if (0 === count($this->methods)) {
|
|
||||||
$this->methods = explode('|', $requirements['_method']);
|
|
||||||
}
|
|
||||||
|
|
||||||
@trigger_error('The "_method" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" option instead.', E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($requirements['_scheme'])) {
|
|
||||||
if (0 === count($this->schemes)) {
|
|
||||||
$this->schemes = explode('|', $requirements['_scheme']);
|
|
||||||
}
|
|
||||||
|
|
||||||
@trigger_error('The "_scheme" requirement is deprecated since version 2.2 and will be removed in 3.0. Use the "schemes" option instead.', E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->requirements = $requirements;
|
$this->requirements = $requirements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,24 +122,6 @@ class XmlFileLoader extends FileLoader
|
|||||||
|
|
||||||
list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path);
|
list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path);
|
||||||
|
|
||||||
if (isset($requirements['_method'])) {
|
|
||||||
if (0 === count($methods)) {
|
|
||||||
$methods = explode('|', $requirements['_method']);
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($requirements['_method']);
|
|
||||||
@trigger_error(sprintf('The "_method" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" attribute instead.', $id, $path), E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($requirements['_scheme'])) {
|
|
||||||
if (0 === count($schemes)) {
|
|
||||||
$schemes = explode('|', $requirements['_scheme']);
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($requirements['_scheme']);
|
|
||||||
@trigger_error(sprintf('The "_scheme" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "schemes" attribute instead.', $id, $path), E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
$route = new Route($node->getAttribute('path'), $defaults, $requirements, $options, $node->getAttribute('host'), $schemes, $methods, $condition);
|
$route = new Route($node->getAttribute('path'), $defaults, $requirements, $options, $node->getAttribute('host'), $schemes, $methods, $condition);
|
||||||
$collection->add($id, $route);
|
$collection->add($id, $route);
|
||||||
}
|
}
|
||||||
|
@ -116,24 +116,6 @@ class YamlFileLoader extends FileLoader
|
|||||||
$methods = isset($config['methods']) ? $config['methods'] : array();
|
$methods = isset($config['methods']) ? $config['methods'] : array();
|
||||||
$condition = isset($config['condition']) ? $config['condition'] : null;
|
$condition = isset($config['condition']) ? $config['condition'] : null;
|
||||||
|
|
||||||
if (isset($requirements['_method'])) {
|
|
||||||
if (0 === count($methods)) {
|
|
||||||
$methods = explode('|', $requirements['_method']);
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($requirements['_method']);
|
|
||||||
@trigger_error(sprintf('The "_method" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "methods" option instead.', $name, $path), E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($requirements['_scheme'])) {
|
|
||||||
if (0 === count($schemes)) {
|
|
||||||
$schemes = explode('|', $requirements['_scheme']);
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($requirements['_scheme']);
|
|
||||||
@trigger_error(sprintf('The "_scheme" requirement of route "%s" in file "%s" is deprecated since version 2.2 and will be removed in 3.0. Use the "schemes" option instead.', $name, $path), E_USER_DEPRECATED);
|
|
||||||
}
|
|
||||||
|
|
||||||
$route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
|
$route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
|
||||||
|
|
||||||
$collection->add($name, $route);
|
$collection->add($name, $route);
|
||||||
|
@ -265,28 +265,6 @@ class Translator implements TranslatorInterface, TranslatorBagInterface
|
|||||||
return $this->loaders;
|
return $this->loaders;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Collects all messages for the given locale.
|
|
||||||
*
|
|
||||||
* @param string|null $locale Locale of translations, by default is current locale
|
|
||||||
*
|
|
||||||
* @return array[array] indexed by catalog
|
|
||||||
*
|
|
||||||
* @deprecated since version 2.8, to be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead.
|
|
||||||
*/
|
|
||||||
public function getMessages($locale = null)
|
|
||||||
{
|
|
||||||
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead.', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
$catalogue = $this->getCatalogue($locale);
|
|
||||||
$messages = $catalogue->all();
|
|
||||||
while ($catalogue = $catalogue->getFallbackCatalogue()) {
|
|
||||||
$messages = array_replace_recursive($catalogue->all(), $messages);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $messages;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $locale
|
* @param string $locale
|
||||||
*/
|
*/
|
||||||
|
@ -178,7 +178,7 @@ abstract class AbstractCloner implements ClonerInterface
|
|||||||
*/
|
*/
|
||||||
public function cloneVar($var, $filter = 0)
|
public function cloneVar($var, $filter = 0)
|
||||||
{
|
{
|
||||||
$this->prevErrorHandler = set_error_handler(function($type, $msg, $file, $line, $context) {
|
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context) {
|
||||||
if (E_RECOVERABLE_ERROR === $type || E_USER_ERROR === $type) {
|
if (E_RECOVERABLE_ERROR === $type || E_USER_ERROR === $type) {
|
||||||
// Cloner never dies
|
// Cloner never dies
|
||||||
throw new \ErrorException($msg, 0, $type, $file, $line);
|
throw new \ErrorException($msg, 0, $type, $file, $line);
|
||||||
|
Reference in New Issue
Block a user