Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:6.4fromnicolas-grekas:di-target++
Jul 13, 2023

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedJun 20, 2023
edited
Loading

QA
Branch?6.4
Bug fix?no
New feature?yes
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

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:

image

  • Improvedebug:autowiring to display the target name to use with#[Target]:

image


public function__construct(string $name)
public functiongetParsedName(): string
Copy link
Member

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 ?

Copy link
MemberAuthor

@nicolas-grekasnicolas-grekasJun 20, 2023
edited
Loading

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.

@nicolas-grekasnicolas-grekasforce-pushed thedi-target++ branch 4 times, most recently fromd1abfdb to741a50cCompareJune 21, 2023 07:45
@lyrixx
Copy link
Member

i like the feature a lot. Thanks

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit6a65ebd intosymfony:6.4Jul 13, 2023
@nicolas-grekasnicolas-grekas deleted the di-target++ branchJuly 25, 2023 15:45
This was referencedOct 21, 2023
nicolas-grekas added a commit that referenced this pull requestDec 1, 2023
… 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       | MITFixing a regression introduced in#50718Commits-------69a115c [DependencyInjection] Fix parsing named autowiring aliases that contain underscores
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

@lyrixxlyrixxAwaiting requested review from lyrixxlyrixx is a code owner

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
6.4
Development

Successfully merging this pull request may close these issues.

5 participants
@nicolas-grekas@lyrixx@fabpot@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp