[Dependency Injection] Add autowiring types for aliases#19970
[Dependency Injection] Add autowiring types for aliases#19970hason wants to merge 1 commit intosymfony:masterfrom
Conversation
| * Adds a type that will default to this definition. | ||
| * | ||
| * @param string $type | ||
| * |
There was a problem hiding this comment.
- @return Definition
+ @return AliasSame below
|
Is it a good idea to use aliases for setting the autowiring type ? |
|
@hason the idea is to say |
|
Oh no! This doesn't work. The autowiring types are lost after each change of alias definition. |
|
services:
foo_type:
public: false
parent: foo
autowiring_types: [ FooInterface ] |
…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#7445 https://github.com/symfony/symfony/pull/21494/files?w=1 This PR deprecates autowiring-types and replaces them by plain aliases. ping @dunglas @weaverryan Eg instead of ```xml <service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false"> <autowiring-type>Doctrine\Common\Annotations\Reader</autowiring-type> </service> ``` just do: ```xml <service id="annotations.reader" class="Doctrine\Common\Annotations\AnnotationReader" public="false" /> <service id="Doctrine\Common\Annotations\Reader" alias="annotations.reader" public="false" /> ``` Commits ------- b11d391 [DI] Deprecate autowiring-types in favor of aliases
Uh oh!
There was an error while loading. Please reload this page.