-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Container::set method description is wrong #30270
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
Comments
I think the phpdoc was not updated properly when deprecating that behavior.
There is a |
Thank you for the answer. What about adding the |
@speller it's in |
Yes, the only addition is:
Also, I've found I have two files implementing this interface: |
oh, oops. It's
Yes, |
PR welcome: we should add the "synthetic" word at the beginning to improve that, isn't it? |
…l behavior (xabbuh) This PR was merged into the 3.4 branch. Discussion ---------- [DependencyInjection] update docblock to match the actual behavior | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #30270 | License | MIT | Doc PR | Commits ------- 83826da update docblock to match the actual behavior
Symfony version(s) affected: 4.2
Description
The
Symfony\Component\DependencyInjection\Container::set
annotation states the following:But this is impossible to do because only synthetic services can be set to null. It is impossible to dispose a regular public or private service instance when using with app servers like PHP RoadRunner which doesn't finish scripts. In this case DB connections defined as regular services are not disposed and quickly wastes DB max connections.
Possible Solution
Allow to null any service.
Or define and document a legal way to do that.
The text was updated successfully, but these errors were encountered: