Skip to content

DependencyInjection not passing service via interface #34361

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy