Skip to content

[3.0] Various deprecation removal #15685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function testCollapsedEntityField()
$this->setMaxRunningTime(1);

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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be done in 2.8

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is on 2.7 on #15687

'class' => self::ENTITY_CLASS,
));

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

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,
'choices' => $choices,
));
Expand All @@ -127,7 +127,7 @@ public function testCollapsedEntityFieldWithPreferredChoices()
$this->setMaxRunningTime(1);

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,
'preferred_choices' => $choices,
));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,6 @@ public function testCollectWhenAuthenticationTokenIsNull()
$this->assertEmpty($collector->getUser());
}

/**
* @group legacy
*/
public function testLegacyCollectWhenAuthenticationTokenIsNull()
{
$tokenStorage = $this->getMock('Symfony\Component\Security\Core\SecurityContextInterface');
$collector = new SecurityDataCollector($tokenStorage, $this->getRoleHierarchy());
$collector->collect($this->getRequest(), $this->getResponse());

$this->assertTrue($collector->isEnabled());
$this->assertFalse($collector->isAuthenticated());
$this->assertNull($collector->getTokenClass());
$this->assertTrue($collector->supportsRoleHierarchy());
$this->assertCount(0, $collector->getRoles());
$this->assertCount(0, $collector->getInheritedRoles());
$this->assertEmpty($collector->getUser());
}

/** @dataProvider provideRoles */
public function testCollectAuthenticationTokenAndRoles(array $roles, array $normalizedRoles, array $inheritedRoles)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,10 @@ public function getTestCreateMapTests()
'Foo\\TFooBar' => __DIR__.'/Fixtures/php5.4/traits.php',
'Foo\\CBar' => __DIR__.'/Fixtures/php5.4/traits.php',
)),
);

if (PHP_VERSION_ID >= 50500) {
$data[] = array(__DIR__.'/Fixtures/php5.5', array(
array(__DIR__.'/Fixtures/php5.5', array(
'ClassCons\\Foo' => __DIR__.'/Fixtures/php5.5/class_cons.php',
));
}
)),
);

return $data;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ public function __construct($name, NodeParentInterface $parent = null)
$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.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,4 @@ public function min($min)

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();
}
}
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Helper/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function getProgress()
/**
* Gets the progress bar step width.
*
* @return int The progress bar step width
* @return int The progress bar step width
*/
private function getStepWidth()
{
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Console/Input/StringInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class StringInput extends ArgvInput
/**
* 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
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Symfony/Component/Console/Output/OutputInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,28 @@ public function setVerbosity($level);
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
*/
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
*/
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
*/
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
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Symfony/Component/Debug/ExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function handle(\Exception $exception)

$caughtLength = $this->caughtLength = 0;

ob_start(function($buffer) {
ob_start(function ($buffer) {
$this->caughtBuffer = $buffer;

return '';
Expand All @@ -133,7 +133,7 @@ public function handle(\Exception $exception)
// Empty loop, everything is in the condition
}
if (isset($this->caughtBuffer[0])) {
ob_start(function($buffer) {
ob_start(function ($buffer) {
if ($this->caughtLength) {
// use substr_replace() instead of substr() for mbstring overloading resistance
$cleanBuffer = substr_replace($buffer, '', 0, $this->caughtLength);
Expand Down
1 change: 0 additions & 1 deletion src/Symfony/Component/EventDispatcher/Tests/EventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Symfony\Component\EventDispatcher\Tests;

use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\EventDispatcher\EventDispatcher;

/**
* Test class for Event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use Symfony\Component\HttpFoundation\Session\SessionBagInterface;
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\SessionHandlerProxy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler;
use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy;
use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ public function testIsWrapper()
*/
public function testIsActive()
{

$this->assertFalse($this->proxy->isActive());
session_start();
$this->assertTrue($this->proxy->isActive());
Expand Down
16 changes: 0 additions & 16 deletions src/Symfony/Component/Routing/Annotation/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,6 @@ public function getName()

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;
}

Expand Down
18 changes: 0 additions & 18 deletions src/Symfony/Component/Routing/Loader/XmlFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,6 @@ protected function parseRoute(RouteCollection $collection, \DOMElement $node, $p

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);
$collection->add($id, $route);
}
Expand Down
18 changes: 0 additions & 18 deletions src/Symfony/Component/Routing/Loader/YamlFileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,6 @@ protected function parseRoute(RouteCollection $collection, $name, array $config,
$methods = isset($config['methods']) ? $config['methods'] : array();
$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);

$collection->add($name, $route);
Expand Down
Loading