Skip to content

Controller as a Service cookbook article missing failfast mentioning #6749

Closed
@linaori

Description

@linaori

One of the (imo) foremost advantages of controller as a service, is the fail fast principle. This means that if you're missing service definitions or try to inject something that does not exist, it will throw an error during compilation. When using the (Base)Controller provided by Symfony, you won't find out if the service exist until you call get() run-time, which might happen once in a blue moon. It also makes it impossible to use private services in 4.0.

http://symfony.com/doc/current/cookbook/controller/service.html

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