-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Simplify AutowirePass and other master-only cleanups #21797
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
Conversation
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.
LGTM
if ($value instanceof ArgumentInterface) { | ||
return $this->describeValue($value->getValues(), $omitTags, $showArguments); | ||
} | ||
|
||
if ($value instanceof Definition) { |
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.
changing the order here is because of the needs of #21708, right ? IMO, this is a clear sign that your other PR breaks BC (other bundles may have similar code)
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.
there is no BC issue: ArgumentInterface is a new feature of master
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.
but existing code might check for Definition. And in your PRs, you have ServiceLocatorArgument extending Definition but which should not be processed like a Definition.
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.
The existing code won't get a new ServiceLocatorArgument all of a sudden, so if they do, someone did write some new code - thus we're out of BC concerns.
Processing ServiceLocatorArgument as a Definition wouldn't be a big issue btw. Existing code won't get the added semantic, but they will not break. Note that this is also true for pure ArgumentInterface instances also.
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.
@nicolas-grekas existing bundles may have compiler passes processing the container. And Symfony 3.3 will change some existing services to use such argument.
Pure ArgumentInterface would be an argument for which they cannot do special processing. A Definition which must not be processed like a Definition is much worse, as they will think they can process it.
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.
See #21770
Thank you @nicolas-grekas. |
…(nicolas-grekas) This PR was merged into the 3.3-dev branch. Discussion ---------- [DI] Simplify AutowirePass and other master-only cleanups | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - A few minor cleanups and fixes, and an overall simplification of AutowirePass. Commits ------- 34e5cc7 [DI] Simplify AutowirePass and other master-only cleanups
A few minor cleanups and fixes, and an overall simplification of AutowirePass.