Skip to content

[Framework+SecurityBundle] remove recently introduced *.class parameters #12150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2014

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets -
License MIT
Doc PR -

This is just a cleanup that removes *.class parameters introduced in the master branch (and not in the 2.5 one).
#12145 also removes the remaining params for the Debug/TwigBundle

@stof
Copy link
Member

stof commented Oct 6, 2014

👍

@fabpot
Copy link
Member

fabpot commented Oct 7, 2014

Thank you @nicolas-grekas.

@fabpot fabpot merged commit 56ae544 into symfony:master Oct 7, 2014
fabpot added a commit that referenced this pull request Oct 7, 2014
…class parameters (nicolas-grekas)

This PR was merged into the 2.6-dev branch.

Discussion
----------

[Framework+SecurityBundle] remove recently introduced *.class parameters

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

This is just a cleanup that removes `*.class` parameters introduced in the master branch (and not in the 2.5 one).
#12145 also removes the remaining params for the Debug/TwigBundle

Commits
-------

56ae544 [Framework+SecurityBundle] remove recently introduced *.class parameters
@nicolas-grekas nicolas-grekas deleted the class-params branch October 7, 2014 14:25
@tobias-93
Copy link
Contributor

What is the exact reason for this? Right now, I cannot overwrite/overload/whatever the newly introduced services with 2.6. I'd want to overwrite the security.authorization_checker service with a custom service, but that is impossible right now. This commit doesn't seem to add anything or fix any bugs, why is it merged? @fabpot @nicolas-grekas @stof

@stof
Copy link
Member

stof commented Dec 5, 2014

@tobias-93 Replacing the class is not a right extension point for services, because it means your own class must have the exact same arguments and method calls than the core one, and this will break if we add more arguments or method calls in a newer versions of Symfony (calls done in a service definition are not covered by our BC policy at all btw, so you have strictly no guarantee about it to work in a newer version, even patch ones if it is necessary to fix a bug).
There are several reliable ways to replace a service:

  • redefining a service with the same name (which erases the previous definition entirely)
  • decorating the existing service with the decorates feature of Symfony 2.5 in case you want to apply composition on your service.

This is why we decided to stop providing a broken extension point into our services (3.0 is removing all these parameters. this PR just avoided to add new ones in 2.6)

Btw, if you really want to replace the class of an existing service definition (taking into account the limitations listed above by acknowledging it goes outside the BC policy), a compiler pass can still alter the definition itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants