8000 DependencyInjection not passing service via interface · Issue #34361 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content 8000
DependencyInjection not passing service via interface #34361
Closed
@michaljusiega

Description

@michaljusiega

Symfony version(s) affected: 4.4.0-BETA1

Description
In SF 4.3 I adding my custom services like:

    # SERVICES #
    Intranet\Service\:
        resource:      '../../src/Service'
        public:        true
        autowire:      true
        autoconfigure: true

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0