-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
Setting up Abstract Definition with some Arguments.
$container->setDefinition( 'class_abstraction', new Definition() )
->setAbstract( true )
->addArgument( new Reference( 'SomeRef' ) );
Then register some service like this
$container->setDefinition( 'class_implementation', new DefinitionDecorator( 'class_abstraction' ) )->setClass( 'MyImplClass' );
Then retriefing the Definition for the implementing class
$def = $container->getDefinition('class_implementation');
doesn't have a reference to the Argument configured in its parent.
First after compiling the container
$container->compile();
$def = $container->getDefinition('class_implementation');
print_r( $def );
the Definition shows the argument "inherited" of its parent Definition.
It would be great if the decoration is done on ->getDefinition and you don't have to call ->compile() first.