Skip to content

Claim in documentation not supported by code #5502

Closed
@rcousens

Description

@rcousens

http://symfony.com/doc/current/cookbook/bundles/best_practices.html

screenshot from 2015-07-08 13 11 14

I cannot find any reference in Symfony2 code to EventListener being a specific emplacement (I understand that it may be a convention) whereas the Command, Controller and Resources subdirectories have some degree of auto-wiring functionality during compiler passes hence the specific emplacement claim.

Command: src/Symfony/Component/HttpKernel/Bundle/Bundle.php <-- wires up Command directory
Controller: src/Symfony/Bundle/FrameworkBundle/Controller/ControllerNameParser.php <-- relies on a specific emplacement of Controller to generate short names
etc...

My understanding of "specific emplacement" is that it is mandated due to the way Symfony2 processes bundles being loaded into the AppKernel. Am I missing something here?

You could put listeners under any directory and it makes no difference. It's just poor style. This is not true for the other directories listed in the screenshot above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    hasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions