Skip to content

[DI] PSR4 loader suggestion #22397

Closed
Closed
@kbond

Description

@kbond
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 3.3.0 (master)

I'm really enjoying the new PSR4 loader but have a suggestion. It would be nice if I could declare multiple definitions with the same prefix. Example:

services:
    command_handlers:
        psr4_prefix: App\Domain\
        resource: ../../src/Domain/*/CommandHandler
        tags: [command_handler]

    event_subscribers:
        psr4_prefix: App\Domain\
        resource: ../../src/Domain/*/EventSubscriber
        tags: [event_subscriber]

I can't use instanceof here because my handlers/subscribers don't have interfaces.

Ref: #22016 (comment)

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