-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] 3.4 BC Break - all my services made private #24465
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
What the behavior you have? Any error message? |
I have my custom CompilerPass which checks for |
@Strate 4.0 will make services private by default. If you don't specify the visibility of services, 3.4 will indeed make them semi-private in this case: it will treat them as private, but ensure that they cannot be removed or inlined, so that they are still accessible in @nicolas-grekas should we do this change on |
@stof thank you, I've got a reason why it was done. I will definitely refactor my code for sf4 |
Yes, I think so too, but there is a reason to run it there: my compiler pass should run after ResolveDefinitionTemplates pass, and long time ago (when symfony was at version 2) I decided to just move my compiler pass to |
@nicolas-grekas there is even such compiler pass in Symfony core: #20116 |
…passes (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [DI] Turn private defs to non-public ones before removing passes | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24465 | License | MIT | Doc PR | - As spotted by @stof in #24465 (comment). Commits ------- e5d0934 [DI] Turn private defs to non-public ones before removing passes
…passes (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [DI] Turn private defs to non-public ones before removing passes | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24465 | License | MIT | Doc PR | - As spotted by @stof in symfony/symfony#24465 (comment). Commits ------- e5d0934b87 [DI] Turn private defs to non-public ones before removing passes
I tried to upgrade from 3.3 to 3.4.x-dev to test compatibility and found that all of my services made private by default. It happes from
Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass::process
method:->isPrivate()
method returnstrue
for all services by default, because\Symfony\Component\DependencyInjection\Definition::$private
set astrue
by default./cc @nicolas-grekas
The text was updated successfully, but these errors were encountered: