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

[Dependency Injection] Add autowiring types for aliases#19970

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

Closed
hason wants to merge1 commit intosymfony:masterfromhason-contributions:aw_alias

Conversation

@hason
Copy link
Contributor

@hasonhason commentedSep 19, 2016
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#18040
LicenseMIT
Doc PR

* Adds a type that will default to this definition.
*
* @param string $type
*
Copy link
Member

Choose a reason for hiding this comment

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

- @return Definition+ @return Alias

Same below

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Fixed

@ogizanagi
Copy link
Contributor

ogizanagi commentedSep 19, 2016
edited
Loading

Is it a good idea to use aliases for setting the autowiring type ?
I don't really have arguments against, but despite the fact it appears to be convenient, it feels strange to me to rely on aliases to "add something to the original definition". :/

chalasr reacted with thumbs up emoji

@hason
Copy link
ContributorAuthor

@stof
Copy link
Member

@hason the idea is to sayUse the "router" service when someone wants a UrlGeneratorInterface instead of sayingUse the private "router.default" service. This way, the autowired services would benefit from alias replacements

@hason
Copy link
ContributorAuthor

Oh no! This doesn't work. The autowiring types are lost after each change of alias definition.

@nicolas-grekasnicolas-grekas added this to the3.x milestoneDec 6, 2016
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedJan 31, 2017
edited
Loading

Did someone try using a ChildDefinition? I guess it doesn't work because it creates another instance.

services:foo_type:public:falseparent:fooautowiring_types:[ FooInterface ]

fabpot added a commit that referenced this pull requestFeb 1, 2017
…icolas-grekas)This PR was merged into the 3.3-dev branch.Discussion----------[DI] Deprecate autowiring-types in favor of aliases| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets |#21351,#19970, ~~#18040~~, ~~#17783~~| License       | MIT| Doc PR        |symfony/symfony-docs#7445https://github.com/symfony/symfony/pull/21494/files?w=1This PR deprecates autowiring-types and replaces them by plain aliases.ping@dunglas@weaverryanEg instead of```xml<service public="false">    <autowiring-type>Doctrine\Common\Annotations\Reader</autowiring-type></service>```just do:```xml<service public="false" /><service alias="annotations.reader" public="false" />```Commits-------b11d391 [DI] Deprecate autowiring-types in favor of aliases
@fabpotfabpot closed thisFeb 1, 2017
@nicolas-grekasnicolas-grekas modified the milestones:3.x,3.3Mar 24, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@chalasrchalasrchalasr left review comments

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

7 participants

@hason@ogizanagi@stof@nicolas-grekas@chalasr@fabpot@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp