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] Clarify the#[Target] attribute#19789

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

Conversation

HypeMC
Copy link
Member

The#[Target] attribute seems to be a constant source of confusion for developers, as evident by:

Also, the example given is either unclear or just wrong. Hopefully, this helps clarify things.

@ghost
Copy link

ghost commentedApr 14, 2024
edited by ghost
Loading

Good clarification. I've never understood how this attribute works 😄 I had two interpretations but both wrong.

Btw. I think this should also be clarified in the source code above $name constructor parameter doc block and class doc block (the latter is a little better but still can be improved).https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/DependencyInjection/Attribute/Target.php

@HypeMCHypeMCforce-pushed theclarify-the-target-attribute branch from210f1a5 to06d88b6CompareApril 15, 2024 09:16
@OskarStark
Copy link
Contributor

@nicolas-grekas a final review from your side would be helpful, thanks

@HypeMCHypeMCforce-pushed theclarify-the-target-attribute branch from06d88b6 to2fb1adaCompareApril 19, 2024 18:53
@nicolas-grekas
Copy link
Member

LGTM but maybe we should tell about the debug:autowiring command, which does report the target name sincesymfony/symfony#50718?

xabbuh, HypeMC, and OskarStark reacted with thumbs up emoji

@HypeMC
Copy link
MemberAuthor

@nicolas-grekas Good idea, I've created afollowup PR since this one targets 5.4, and the feature was introduced in 6.4.

@javiereguiluz
Copy link
Member

@HypeMC thanks for this contribution and sorry it took us so long to merge it.

@javiereguiluz
Copy link
Member

@HypeMC I upmerged this in 6.4, 7.0, 7.1 and 7.2 branches.

I'm not sure I did everything right, because in 6.4 we show both upperTransformer and shoutyTransformer. I don't know if both are correct or the "shouty" thing is a leftover from 5.4 branch and 6.4 branch was wrong before merging this PR.

If you can, please review it. Seead1e3b2

@HypeMCHypeMC deleted the clarify-the-target-attribute branchJune 24, 2024 09:42
javiereguiluz added a commit that referenced this pull requestJun 24, 2024
…2 (HypeMC)This PR was squashed before being merged into the 6.4 branch.Discussion----------[DependencyInjection] Clarify the `#[Target]` attribute 2Follow-up to#19789, adds a [paragraph](bd00116) about the `debug:autowiring` command.Commits-------81cc7f0 [DependencyInjection] Clarify the `#[Target]` attribute 2
@HypeMC
Copy link
MemberAuthor

@javiereguiluz Yep, everything looks ok, I see you've also merged the follow up PR.

javiereguiluz reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@OskarStarkOskarStarkOskarStark left review comments

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

5 participants
@HypeMC@OskarStark@nicolas-grekas@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp