Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DI] PSR4 loader suggestions #22016

Copy link
Copy link
Closed
Closed
Copy link
@theofidry

Description

@theofidry
Issue body actions
Q A
Bug report? no
Feature request? yes
BC Break report? no
RFC? yes
Symfony version 3.3.0 (master)

After playing a bit with #21289 I would like to make a few suggestions :)

The first suggestion would be to allow the usage of parameters to define the path of the resource. If I take the following example:

# app/config/services.yml

services:
    App\:
        resource: '../../src/Bundle/{Action,Console}'

Instead of that, I would prefer:

# app/config/services.yml

services:
    App\:
        resource: '%kernel.root_dir%/../src/Bundle/{Action,Console}'

I personally find it better, as it makes it easier to follow even if you are deeper in a hierarchy (I have an example where I have ../../../../src/blabla... it's not very readable).

Second suggestion (nitpicking) is about the syntax. The following doesn't work:

# app/config/services.yml

services:
    App\:
        resource: '../../src/Bundle/{Action, Console}'

Because of the extra space. I find that "stupid". I think if it doesn't cost much to do so, users should be free to add an extra space to make things more readable if they find it more readable that way.

Third suggestion (minor), let's take the following example:

# app/config/services.yml

services:
    App\:
        resource: '../../src/Bundle/{Action}'

why the brackets? You shouldn't IMO.

/cc @nicolas-grekas @dunglas (I remember requesting something similar with in dunglas/DunglasActionBundle#52, but maybe you have a different opinion for this one).

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.