-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Improve reporting named autowiring aliases #50718
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
|
||
public function __construct(string $name) | ||
public function getParsedName(): string |
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.
should we even have it as a public method if calling it directly would be a mistake ?
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 think yes. Calling it directly works, but only if you gave a name to the constructor.
d1abfdb
to
741a50c
Compare
i like the feature a lot. Thanks |
741a50c
to
8d60a7e
Compare
Thank you @nicolas-grekas. |
… that contain underscores (nicolas-grekas) This PR was merged into the 6.4 branch. Discussion ---------- [DependencyInjection] Fix parsing named autowiring aliases that contain underscores | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #52815 | License | MIT Fixing a regression introduced in #50718 Commits ------- 69a115c [DependencyInjection] Fix parsing named autowiring aliases that contain underscores
This PR started as a fix of #48707 to improve the error message reported when
#[Target]
is used with an invalid target, and ended up with many other related improvements:Allow using
#[Target]
with no arguments. This has the effect of throwing an exception if the name of the argument that has the attribute doesn't match a named autowiring alias.Improve the error message when a target doesn't match:
debug:autowiring
to display the target name to use with#[Target]
: