Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added support for deprecating aliases #24707

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

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Applied coding standard review
  • Loading branch information
j92 committed Jan 26, 2018
commit 70721a5573a608d41f52f841e2995568735d2b86
4 changes: 2 additions & 2 deletions 4 src/Symfony/Component/DependencyInjection/Alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function isPrivate()
* Whether this alias is deprecated, that means it should not be called
* anymore.
*
* @param bool $status Defaults to true
* @param bool $status Defaults to true
* @param string $template Optional template message to use if the alias is deprecated
*
* @return $this
Expand All @@ -116,7 +116,7 @@ public function setDeprecated($status = true, $template = null)
}

/**
* Returns whether this alias is deprecated
* Returns whether this alias is deprecated.
*
* @return bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ private function doGet($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_
if ($aliasDefinition->isDeprecated()) {
@trigger_error($aliasDefinition->getDeprecationMessage($id), E_USER_DEPRECATED);
}
return $this->doGet((string) $this->aliasDefinitions[$id], $invalidBehavior, $inlineServices);

return $this->doGet((string) $aliasDefinition, $invalidBehavior, $inlineServices);
}

try {
Expand Down
16 changes: 9 additions & 7 deletions 16 src/Symfony/Component/DependencyInjection/Tests/AliasTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<?php
/**
* (c) BKV

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);

namespace Symfony\Component\DependencyInjection\Tests;

Expand All @@ -18,23 +20,23 @@ public function testConstructor()
{
$alias = new Alias('foo');

$this->assertEquals('foo', (string)$alias);
$this->assertEquals('foo', (string) $alias);
$this->assertTrue($alias->isPublic());
}

public function testCanConstructANonPublicAlias()
{
$alias = new Alias('foo', false);

$this->assertEquals('foo', (string)$alias);
$this->assertEquals('foo', (string) $alias);
$this->assertFalse($alias->isPublic());
}

public function testCanConstructAPrivateAlias()
{
$alias = new Alias('foo', false, false);

$this->assertEquals('foo', (string)$alias);
$this->assertEquals('foo', (string) $alias);
$this->assertFalse($alias->isPublic());
$this->assertFalse($alias->isPrivate());
}
Expand All @@ -54,7 +56,7 @@ public function testCanDeprecateAnAlias()

$this->assertTrue($alias->isDeprecated());
}

public function testItHasADefaultDeprecationMessage()
{
$alias = new Alias('foo', false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public function testDeprecated()
public function testDeprecatedAliases()
{
$container = new ContainerBuilder();
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath . '/xml'));
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
$loader->load('deprecated_alias_definitions.xml');

$this->assertTrue($container->getAlias('alias_for_foo')->isDeprecated());
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.