Skip to content

[DI] Have a better DX for excluded resources #30865

Closed
@lyrixx

Description

@lyrixx

Description

This configuration does not scale very well.

We end up creating smaller section by feature.

AppBundle\Feature\:
    resource: '../../../src/Feature/*'

But At some point, it becomes complicated to maintain and we finish with something like:

AppBundle\Feature\:
    resource: '../../../src/Feature/*'
    exclude: '../../../src/Feature/{Model,Foobar.php,Bar/Bar.php,James/James.php,James/Url.php,James/Link.php,James/Queue.php,James/Download.php}'

Instead, I could be nice to be able to use such syntax:

AppBundle\Feature\:
    resource: '../../../src/Feature/*'
    exclude:
        - '../../../src/Feature/Model/
        - '../../../src/Feature/Foobar.php
        - '../../../src/Feature/James/{James.php,Url.php,Link.php,Queue.php,Download.php}'

So to make it simple:
excludes should accept a string or an array of string.

WDYT ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DXDX = Developer eXperience (anything that improves the experience of using Symfony)DependencyInjection

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions