-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Make tagged abstract services throw earlier #22420
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.
👍
* | ||
* @return array An array of tags with the tagged service as key, holding a list of attribute arrays | ||
*/ | ||
public function findTaggedServiceIds($name) | ||
public function findTaggedServiceIds($name, $throwOnAbstract = false) |
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.
what about set null
for now (and consider it as false
), trigger deprecation warning if no argument value provided (null
), change it to true
by default for 4.0?
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.
this is mostly internal, so not sure it's worth it
but please open a PR if you want to work on it
Thank you @nicolas-grekas. |
…las-grekas) This PR was squashed before being merged into the 3.3-dev branch (closes #22420). Discussion ---------- [DI] Make tagged abstract services throw earlier | Q | A | ------------- | --- | Branch? | 3.3 | Bug fix? | yes | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - As spotted by @stof in #22388 (comment), skipping abstract tagged services removes an opportunity to report config mistakes to users. Instead of skipping them, let's throw as done before (thus reverting #22039, ping @chalasr). I made `$container->findTaggedServiceIds()` accept a 2nd arg to make this more systematic. To keep the possibility to have abstract tagged services *for the purpose of tag inheritance*, `ResolveTagsInheritancePass` now resets their tags. Commits ------- 388e4b3 [DI] Make tagged abstract services throw earlier cd06c12 Revert "minor #22039 Skip abstract definitions in compiler passes (chalasr)"
As spotted by @stof in #22388 (comment), skipping abstract tagged services removes an opportunity to report config mistakes to users.
Instead of skipping them, let's throw as done before (thus reverting #22039, ping @chalasr).
I made
$container->findTaggedServiceIds()
accept a 2nd arg to make this more systematic.To keep the possibility to have abstract tagged services for the purpose of tag inheritance,
ResolveTagsInheritancePass
now resets their tags.