-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Do not set values of lazy arguments after inlining them #21312
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ private function inlineArguments(ContainerBuilder $container, array $arguments, | |
if (is_array($argument)) { | ||
$arguments[$k] = $this->inlineArguments($container, $argument); | ||
} elseif ($argument instanceof ArgumentInterface) { | ||
$argument->setValues($this->inlineArguments($container, $argument->getValues())); | ||
$this->inlineArguments($container, $argument->getValues()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there any case where this could break? For example, if someone uses their own implementation of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To answer my own question: the |
||
} elseif ($argument instanceof Reference) { | ||
if (!$container->hasDefinition($id = (string) $argument)) { | ||
continue; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by removing this, we miss the opportunity to inline inside lazy arguments.
only the call to setValue should be removed in fact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't dare to ask you about that. Updated