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] Document FQCN aliases#7656

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
javiereguiluz merged 1 commit intosymfony:masterfromGuilhemN:AUTOWIRING
Apr 28, 2017

Conversation

@GuilhemN
Copy link
Contributor

Fix#7445

Not only do we need to remove autowiring-types, we should show clearly how you can use aliases to choose what class should be autowired for a specific interface/class.

Also, Stof noted that you can/should mark these aliases as private: we don't need them to be available on the final, cached container.

Acme\TransformerInterface:
alias:rot13_transformer
public:false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

why bother withpublic: false? Let's show the shortAcme\TransformerInterface: '@ rot13_transformer' instead :)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

because we don't need this alias in the dumped container, it's better to show the best practices imo ;)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't think we should bother with this kind of optimization that can lead to confusion here. And as it's not specific to autowiring, I should rather be in a dedicated section rather. The notion of public/private is a bit special in Symfony, I wouldn't mix it with autowiring.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

ok, let's remove it for now, we'll see if others think differently.

@theofidry
Copy link
Contributor

👍 just thepublic: false which is only confusing here to me, it's not specific to auto-wiring and it's not really the topic of that section

autowiring_types:Acme\TransformerInterface
class:Acme\Rot13Transformer
Acme\TransformerInterface:@rot13_transformer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The@rot13_transformer string needs to be quoted.

GuilhemN reacted with thumbs up emoji
<serviceid="rot13_transformer"class="Acme\Rot13Transformer">
<autowiring-type>Acme\TransformerInterface</autowiring-type>
</service>
<serviceid="rot13_transformer"class="Acme\Rot13Transformer" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

for consistency, we should add a blank line after this too

GuilhemN reacted with thumbs up emoji
Fortunately, the FQCN alias is here to specify which implementation
to use by default.

..versionadded::3.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

3.3

Copy link
Member

@xabbuhxabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

Copy link
Contributor

@HeahDudeHeahDude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍

@GuilhemNGuilhemNforce-pushed theAUTOWIRING branch 3 times, most recently from99ba301 toa544200CompareApril 12, 2017 17:28
@javiereguiluz
Copy link
Member

@GuilhemN could you please rebase this so we can merge it? Thanks!

@GuilhemN
Copy link
ContributorAuthor

rebased ☺

@javiereguiluz
Copy link
Member

@GuilhemN thanks for rebasing. This is now merged!

GuilhemN reacted with hooray emoji

@javiereguiluzjaviereguiluz merged commita530019 intosymfony:masterApr 28, 2017
javiereguiluz added a commit that referenced this pull requestApr 28, 2017
This PR was merged into the master branch.Discussion----------[DependencyInjection] Document FQCN aliasesFix#7445> Not only do we need to remove autowiring-types, we should show clearly how you can use aliases to choose what class should be autowired for a specific interface/class.>> Also, Stof noted that you can/should mark these aliases as private: we don't need them to be available on the final, cached container.Commits-------a530019 [DependencyInjection] Document FQCN aliases
@GuilhemNGuilhemN deleted the AUTOWIRING branchApril 28, 2017 15:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@xabbuhxabbuhxabbuh approved these changes

+2 more reviewers

@theofidrytheofidrytheofidry left review comments

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@GuilhemN@theofidry@javiereguiluz@xabbuh@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp