Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a32e9ac

Browse files
committed
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
2 parents 42a47bf + b1f3d52 commit a32e9ac

File tree

17 files changed

+15
-120
lines changed

17 files changed

+15
-120
lines changed

src/Symfony/Bridge/Doctrine/Tests/Form/Type/EntityTypePerformanceTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testCollapsedEntityField()
9090
$this->setMaxRunningTime(1);
9191

9292
for ($i = 0; $i < 40; ++$i) {
93-
$form = $this->factory->create('entity', null, array(
93+
$form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
9494
'class' => self::ENTITY_CLASS,
9595
));
9696

@@ -108,7 +108,7 @@ public function testCollapsedEntityFieldWithChoices()
108108
$this->setMaxRunningTime(1);
109109

110110
for ($i = 0; $i < 40; ++$i) {
111-
$form = $this->factory->create('entity', null, array(
111+
$form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
112112
'class' => self::ENTITY_CLASS,
113113
'choices' => $choices,
114114
));
@@ -127,7 +127,7 @@ public function testCollapsedEntityFieldWithPreferredChoices()
127127
$this->setMaxRunningTime(1);
128128

129129
for ($i = 0; $i < 40; ++$i) {
130-
$form = $this->factory->create('entity', null, array(
130+
$form = $this->factory->create('Symfony\Bridge\Doctrine\Form\Type\EntityType', null, array(
131131
'class' => self::ENTITY_CLASS,
132132
'preferred_choices' => $choices,
133133
));

src/Symfony/Component/ClassLoader/Tests/ClassMapGeneratorTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,10 @@ public function getTestCreateMapTests()
110110
'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php',
111111
'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php',
112112
)),
113-
);
114-
115-
if (PHP_VERSION_ID >= 50500) {
116-
$data[] = array(__DIR__.'/Fixtures/php5.5', array(
113+
array(__DIR__.'/Fixtures/php5.5', array(
117114
'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php',
118-
));
119-
}
115+
)),
116+
);
120117

121118
return $data;
122119
}

src/Symfony/Component/Config/Definition/Builder/BooleanNodeDefinition.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,6 @@ public function __construct($name, NodeParentInterface $parent = null)
3030
$this->nullEquivalent = true;
3131
}
3232

33-
/**
34-
* {@inheritdoc}
35-
*
36-
* @deprecated Deprecated since version 2.8, to be removed in 3.0.
37-
*/
38-
public function cannotBeEmpty()
39-
{
40-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
41-
42-
return parent::cannotBeEmpty();
43-
}
44-
4533
/**
4634
* Instantiate a Node.
4735
*

src/Symfony/Component/Config/Definition/Builder/NumericNodeDefinition.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,4 @@ public function min($min)
5858

5959
return $this;
6060
}
61-
62-
/**
63-
* {@inheritdoc}
64-
*
65-
* @deprecated Deprecated since version 2.8, to be removed in 3.0.
66-
*/
67-
public function cannotBeEmpty()
68-
{
69-
@trigger_error('The '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
70-
71-
return parent::cannotBeEmpty();
72-
}
7361
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public function getProgress()
181181
/**
182182
* Gets the progress bar step width.
183183
*
184-
* @return int The progress bar step width
184+
* @return int The progress bar step width
185185
*/
186186
private function getStepWidth()
187187
{

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class StringInput extends ArgvInput
3030
/**
3131
* Constructor.
3232
*
33-
* @param string $input An array of parameters from the CLI (in the argv format)
33+
* @param string $input An array of parameters from the CLI (in the argv format)
3434
*
3535
* @api
3636
*/

src/Symfony/Component/Console/Output/OutputInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,28 +76,28 @@ public function setVerbosity($level);
7676
public function getVerbosity();
7777

7878
/**
79-
* Returns whether verbosity is quiet (-q)
79+
* Returns whether verbosity is quiet (-q).
8080
*
8181
* @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise
8282
*/
8383
public function isQuiet();
8484

8585
/**
86-
* Returns whether verbosity is verbose (-v)
86+
* Returns whether verbosity is verbose (-v).
8787
*
8888
* @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise
8989
*/
9090
public function isVerbose();
9191

9292
/**
93-
* Returns whether verbosity is very verbose (-vv)
93+
* Returns whether verbosity is very verbose (-vv).
9494
*
9595
* @return bool true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise
9696
*/
9797
public function isVeryVerbose();
9898

9999
/**
100-
* Returns whether verbosity is debug (-vvv)
100+
* Returns whether verbosity is debug (-vvv).
101101
*
102102
* @return bool true if verbosity is set to VERBOSITY_DEBUG, false otherwise
103103
*/

src/Symfony/Component/Debug/ExceptionHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function handle(\Exception $exception)
122122

123123
$caughtLength = $this->caughtLength = 0;
124124

125-
ob_start(function($buffer) {
125+
ob_start(function ($buffer) {
126126
$this->caughtBuffer = $buffer;
127127

128128
return '';
@@ -133,7 +133,7 @@ public function handle(\Exception $exception)
133133
// Empty loop, everything is in the condition
134134
}
135135
if (isset($this->caughtBuffer[0])) {
136-
ob_start(function($buffer) {
136+
ob_start(function ($buffer) {
137137
if ($this->caughtLength) {
138138
// use substr_replace() instead of substr() for mbstring overloading resistance
139139
$cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength);

src/Symfony/Component/EventDispatcher/Tests/EventTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Component\EventDispatcher\Tests;
1313

1414
use Symfony\Component\EventDispatcher\Event;
15-
use Symfony\Component\EventDispatcher\EventDispatcher;
1615

1716
/**
1817
* Test class for Event.

src/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
1515
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
16-
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
1716
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy;
1817
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
1918

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
1717
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
1818
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
19-
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
2019
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;
2120

2221
/**

src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Proxy/AbstractProxyTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ public function testIsWrapper()
9191
*/
9292
public function testIsActive()
9393
{
94-
9594
$this->assertFalse($this->proxy->isActive());
9695
session_start();
9796
$this->assertTrue($this->proxy->isActive());

src/Symfony/Component/Routing/Annotation/Route.php

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,22 +86,6 @@ public function getName()
8686

8787
public function setRequirements($requirements)
8888
{
89-
if (isset($requirements['_method'])) {
90-
if (0 === count($this->methods)) {
91-
$this->methods = explode('|', $requirements['_method']);
92-
}
93-
94-
@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);
95-
}
96-
97-
if (isset($requirements['_scheme'])) {
98-
if (0 === count($this->schemes)) {
99-
$this->schemes = explode('|', $requirements['_scheme']);
100-
}
101-
102-
@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);
103-
}
104-
10589
$this->requirements = $requirements;
10690
}
10791

src/Symfony/Component/Routing/Loader/XmlFileLoader.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -122,24 +122,6 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $node, $p
122122

123123
list($defaults, $requirements, $options, $condition) = $this->parseConfigs($node, $path);
124124

125-
if (isset($requirements['_method'])) {
126-
if (0 === count($methods)) {
127-
$methods = explode('|', $requirements['_method']);
128-
}
129-
130-
unset($requirements['_method']);
131-
@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);
132-
}
133-
134-
if (isset($requirements['_scheme'])) {
135-
if (0 === count($schemes)) {
136-
$schemes = explode('|', $requirements['_scheme']);
137-
}
138-
139-
unset($requirements['_scheme']);
140-
@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);
141-
}
142-
143125
$route = new Route($node->getAttribute('path'), $defaults, $requirements, $options, $node->getAttribute('host'), $schemes, $methods, $condition);
144126
$collection->add($id, $route);
145127
}

src/Symfony/Component/Routing/Loader/YamlFileLoader.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,24 +116,6 @@ protected function parseRoute(RouteCollection $collection, $name, array $config,
116116
$methods = isset($config['methods']) ? $config['methods'] : array();
117117
$condition = isset($config['condition']) ? $config['condition'] : null;
118118

119-
if (isset($requirements['_method'])) {
120-
if (0 === count($methods)) {
121-
$methods = explode('|', $requirements['_method']);
122-
}
123-
124-
unset($requirements['_method']);
125-
@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);
126-
}
127-
128-
if (isset($requirements['_scheme'])) {
129-
if (0 === count($schemes)) {
130-
$schemes = explode('|', $requirements['_scheme']);
131-
}
132-
133-
unset($requirements['_scheme']);
134-
@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);
135-
}
136-
137119
$route = new Route($config['path'], $defaults, $requirements, $options, $host, $schemes, $methods, $condition);
138120

139121
$collection->add($name, $route);

src/Symfony/Component/Translation/Translator.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -265,28 +265,6 @@ protected function getLoaders()
265265
return $this->loaders;
266266
}
267267

268-
/**
269-
* Collects all messages for the given locale.
270-
*
271-
* @param string|null $locale Locale of translations, by default is current locale
272-
*
273-
* @return array[array] indexed by catalog
274-
*
275-
* @deprecated since version 2.8, to be removed in 3.0. Use TranslatorBagInterface::getCatalogue() method instead.
276-
*/
277-
public function getMessages($locale = null)
278-
{
279-
@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);
280-
281-
$catalogue = $this->getCatalogue($locale);
282-
$messages = $catalogue->all();
283-
while ($catalogue = $catalogue->getFallbackCatalogue()) {
284-
$messages = array_replace_recursive($catalogue->all(), $messages);
285-
}
286-
287-
return $messages;
288-
}
289-
290268
/**
291269
* @param string $locale
292270
*/

src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function setMaxString($maxString)
178178
*/
179179
public function cloneVar($var, $filter = 0)
180180
{
181-
$this->prevErrorHandler = set_error_handler(function($type, $msg, $file, $line, $context) {
181+
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context) {
182182
if (E_RECOVERABLE_ERROR === $type || E_USER_ERROR === $type) {
183183
// Cloner never dies
184184
throw new \ErrorException($msg, 0, $type, $file, $line);

0 commit comments

Comments
 (0)