diff --git a/src/Symfony/Component/DependencyInjection/ChildDefinition.php b/src/Symfony/Component/DependencyInjection/ChildDefinition.php index 53a1d188a0..b157642bd3 100644 --- a/src/Symfony/Component/DependencyInjection/ChildDefinition.php +++ b/src/Symfony/Component/DependencyInjection/ChildDefinition.php @@ -14,8 +14,6 @@ namespace Symfony\Component\DependencyInjection; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\OutOfBoundsException; -class_alias(ChildDefinition::class, DefinitionDecorator::class); - /** * This definition extends another definition. * @@ -199,3 +197,5 @@ class ChildDefinition extends Definition return $this; } } + +class_alias(ChildDefinition::class, DefinitionDecorator::class); diff --git a/src/Symfony/Component/DependencyInjection/Tests/ChildDefinitionTest.php b/src/Symfony/Component/DependencyInjection/Tests/ChildDefinitionTest.php index 8f89e3b626..1b84cf90bb 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ChildDefinitionTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ChildDefinitionTest.php @@ -12,6 +12,7 @@ namespace Symfony\Component\DependencyInjection\Tests; use Symfony\Component\DependencyInjection\ChildDefinition; +use Symfony\Component\DependencyInjection\DefinitionDecorator; class ChildDefinitionTest extends \PHPUnit_Framework_TestCase { @@ -125,4 +126,9 @@ class ChildDefinitionTest extends \PHPUnit_Framework_TestCase $def->getArgument(1); } + + public function testDefinitionDecoratorAliasExistsForBackwardsCompatibility() + { + $this->assertInstanceOf(ChildDefinition::class, new DefinitionDecorator('foo')); + } }