-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
DependencyInjection not passing service via interface #34361
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
Comments
Might be related to changes done in #33350 |
@nicolas-grekas I will try. |
@nicolas-grekas see https://github.com/michaljusiega/issue-34361 & readme.md |
Thanks for the reproducer, it allowed me to spot the issue! |
…grekas) This PR was merged into the 4.4 branch. Discussion ---------- [DI] fix detecting singly implemented interfaces | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #34361 | License | MIT | Doc PR | - Commits ------- eccb937 [DI] fix detecting singly implemented interfaces
Will this be backported to 4.3? That would be great 👍 That's the minimum version I use now and it would allow me to drop my own compilser pass that adds this feature. |
Symfony version(s) affected: 4.4.0-BETA1
Description
In SF 4.3 I adding my custom services like:
So my all services pathname was a ProjectDir/src/Service. Each service implements custom interface naming like class name of service + 'Interface'. Path of interfaces was ProjectDir/src/Interfaces/Service so namespace looking like: Intranet\Interfaces\Service.
When I passing via DI one service using a interface, in SF 4.3 everything was fine, and i getting a object of passed service.
After update to 4.4 now i'm getting a error from DI like:
Cannot autowire service "Intranet\Controller\AdministracjaController": argument "$parseAddressIPService" of method "__construct()" references interface "Intranet\Interfaces\Service\ParseAddressIPServiceInterface" but no such service exists. You should maybe alias this interface to the existing "Intranet\Service\ParseAddressIPService" service.
Changing to passing directly by service resolve problem, but I don't wanna make this.
The text was updated successfully, but these errors were encountered: