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
Fixed a type and made the deprecation template clearer
  • Loading branch information
j92 committed Jan 26, 2018
commit 34ce7bfa815b6621d6e42b7cc2ef8a8f7f8f0072
2 changes: 1 addition & 1 deletion 2 src/Symfony/Component/DependencyInjection/Alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Alias
private $deprecated;
private $deprecationTemplate;

private static $defaultDeprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed.';
private static $defaultDeprecationTemplate = 'The "%service_id%" service alias is deprecated. You should stop using it, as it will soon be removed.';

public function __construct(string $id, bool $public = true)
{
Expand Down
4 changes: 2 additions & 2 deletions 4 src/Symfony/Component/DependencyInjection/Tests/AliasTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testItHasADefaultDeprecationMessage()
$alias = new Alias('foo', false);
$alias->setDeprecated();

$expectedMessage = 'The "foo" service is deprecated. You should stop using it, as it will soon be removed.';
$expectedMessage = 'The "foo" service alias is deprecated. You should stop using it, as it will soon be removed.';
$this->assertEquals($expectedMessage, $alias->getDeprecationMessage('foo'));
}

Expand Down Expand Up @@ -104,7 +104,7 @@ public function invalidDeprecationMessageProvider()
"With \rs" => array("invalid \r message %service_id%"),
"With \ns" => array("invalid \n message %service_id%"),
'With */s' => array('invalid */ message %service_id%'),
'message not containing require %service_id% variable' => array('this is deprecated'),
'message not containing required %service_id% variable' => array('this is deprecated'),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ public function testAliases()

/**
* @group legacy
* @expectedDeprecation The "foobar" service is deprecated. You should stop using it, as it will soon be removed.
* @expectedDeprecation The "foobar" service alias is deprecated. You should stop using it, as it will soon be removed.
*/
public function testDeprecatedAlias()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<deprecated />
</service>
<service id="alias_for_foobar" alias="foobar">
<deprecated>The "%service_id%" service is deprecated.</deprecated>
<deprecated>The "%service_id%" service alias is deprecated.</deprecated>
</service>
</services>
</container>
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ public function testDeprecatedAliases()
$loader->load('deprecated_alias_definitions.xml');

$this->assertTrue($container->getAlias('alias_for_foo')->isDeprecated());
$message = 'The "alias_for_foo" service is deprecated. You should stop using it, as it will soon be removed.';
$message = 'The "alias_for_foo" service alias is deprecated. You should stop using it, as it will soon be removed.';
$this->assertSame($message, $container->getAlias('alias_for_foo')->getDeprecationMessage('alias_for_foo'));

$this->assertTrue($container->getAlias('alias_for_foobar')->isDeprecated());
$message = 'The "alias_for_foobar" service is deprecated.';
$message = 'The "alias_for_foobar" service alias is deprecated.';
$this->assertSame($message, $container->getAlias('alias_for_foobar')->getDeprecationMessage('alias_for_foobar'));
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.