-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[RFC] [DependencyInjection] Automatically detect definitions class based on their factory #19161
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
DependencyInjection
Feature
RFC
RFC = Request For Comments (proposals about features that you want to be discussed)
Comments
This is must have. Already know it from other DI frameworks. |
I opened #19191, please review it in case you see something to change :) |
fabpot
added a commit
that referenced
this issue
Sep 19, 2016
…ions class when possible (Ener-Getick) This PR was merged into the 3.2-dev branch. Discussion ---------- [DependencyInjection] Automatically detect the definitions class when possible | Q | A | ------------- | --- | Branch? | "master" | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19161 | License | MIT | Doc PR | > Thanks to the features of php 7.0 we can now guess the class of a service created with a factory: > ```php > function myFactory(): MyServiceClass > { > } > ``` > > So I propose to create a new pass to automatically update the services definition when possible. This is particularly useful for autowiring (this way you don't have to copy-paste the class name of the service, especially when this is from a third party library). > > What do you think ? Commits ------- 63afe3c [DependencyInjection] Automatically detect the definitions class when possible
symfony-splitter
pushed a commit
to symfony/dependency-injection
that referenced
this issue
Sep 19, 2016
…ions class when possible (Ener-Getick) This PR was merged into the 3.2-dev branch. Discussion ---------- [DependencyInjection] Automatically detect the definitions class when possible | Q | A | ------------- | --- | Branch? | "master" | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony/symfony#19161 | License | MIT | Doc PR | > Thanks to the features of php 7.0 we can now guess the class of a service created with a factory: > ```php > function myFactory(): MyServiceClass > { > } > ``` > > So I propose to create a new pass to automatically update the services definition when possible. This is particularly useful for autowiring (this way you don't have to copy-paste the class name of the service, especially when this is from a third party library). > > What do you think ? Commits ------- 63afe3c [DependencyInjection] Automatically detect the definitions class when possible
Thank you @fabpot and @Ener-Getick |
You're welcome :) |
fabpot
added a commit
that referenced
this issue
Oct 21, 2016
…n PassConfig (hason) This PR was merged into the 3.2-dev branch. Discussion ---------- [DependencyInjection] Fix FactoryReturnTypePass position in PassConfig | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19161, #19191 | License | MIT | Doc PR | Commits ------- dfb5cc3 [DependencyInjection] Fix FactoryReturnTypePass position in PassConfig
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
DependencyInjection
Feature
RFC
RFC = Request For Comments (proposals about features that you want to be discussed)
Uh oh!
There was an error while loading. Please reload this page.
Thanks to the features of php 7.0 we can now guess the class of a service created with a factory:
So I propose to create a new pass to automatically update the services definition when possible. This is particularly useful for autowiring (this way you don't have to copy-paste the class name of the service, especially when this is from a third party library).
What do you think ?
An implementation could be this.
The text was updated successfully, but these errors were encountered: