Skip to content

Make DependencyDecoration available without compiling the conatiner #10034

@movetodevnull

Description

@movetodevnull

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions