Skip to content

[FrameworkBundle] "Ghost" services when excluding non-matches #48607

Closed
@apfelbox

Description

@apfelbox

Symfony version(s) affected

6.2.1

Description

I have a bundle with a service MyBundle\SystemInformation\SystemInformation that I would like to include.
So I now edit my services.yaml and add an invalid exclusion rules, as I forgot the star:

services:
    _defaults:
        autoconfigure: true
        autowire: true

    MyBundle\:
        resource: ../src/*
        exclude:
            - ../src/SystemInformation #oops

If I now do a debug:container in the main application, it lists a non-existant service:

CleanShot 2022-12-12 at 11 52 59

CleanShot 2022-12-12 at 11 53 19

One thing to not here is that the original service is gone now. So maybe the dummy excluded service that is added due to #46279 just uses the wrong id?

How to reproduce

See above

Possible Solution

This will be fixed if #48606 is implemented. Not sure if this has more consequences somewhere else.

Additional Context

No response

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