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

[3.0] [DependencyInjection] Remove the *.class parameters from core #11881

Copy link
Copy link
Closed
@fabpot

Description

@fabpot
Issue body actions

All services in core define their classes as parameters. The convention is to create a foo.class parameter for the class of the foo service. This approach comes with several problems:

  • The parameters are dumped like any other one in the compiled class and it makes the file larger for no good reasons (read: it slows down your app for free).
  • When someone wants to change a service, just changing the class name is rarely enough: the new service probably have some different constructor arguments, ... Or put another way, overriding a service by just changing the class name of a service is a very rare use case.
  • Of course, if several bundles change the value of such a parameter, the "last" definition wins. Classic inheritance vs composition problem.

For all these reasons, I like to remove all those parameters for Symfony 3.0.

On a side note, it's now possible to easily replace a service by decorating it (see #9003).

Metadata

Metadata

Assignees

No one assigned

    Labels

    DependencyInjectionRFCRFC = Request For Comments (proposals about features that you want to be discussed)RFC = Request For Comments (proposals about features that you want to be discussed)

    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.