-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] Mark cache.default_*_provider services private #20577
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thank you @nicolas-grekas. |
fabpot
added a commit
that referenced
this pull request
Nov 21, 2016
…rivate (nicolas-grekas) This PR was merged into the 3.1 branch. Discussion ---------- [FrameworkBundle] Mark cache.default_*_provider services private | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20563 | License | MIT | Doc PR | - I know making a service private has a potential for breaking BC. Yet, these services should not be used directly in controllers/userland code, and I really doubt anyone did. Let's make it private now and fix linked issue (even if it's a false positive from SymfonyServiceDefinitionValidator, it shows we have this service that really isn't meant to be public). Commits ------- 09adfda [FrameworkBundle] Mark cache.default_*_provider services private
stof
reviewed
Nov 22, 2016
@@ -1045,6 +1045,7 @@ private function registerCacheConfiguration(array $config, ContainerBuilder $con | |||
foreach (array('doctrine', 'psr6', 'redis') as $name) { | |||
if (isset($config[$name = 'default_'.$name.'_provider'])) { | |||
$container->setAlias('cache.'.$name, Compiler\CachePoolPass::getServiceProvider($container, $config[$name])); | |||
$container->getAlias('cache.'.$name)->setPublic(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could even set it as private directly instead of getting the alias again:
setAlias('cache.'.$name, new Alias(..., false));
Merged
fabpot
added a commit
that referenced
this pull request
Nov 29, 2016
…(xabbuh) This PR was merged into the 3.1 branch. Discussion ---------- [FrameworkBundle] mark alias as private during creation | Q | A | ------------- | --- | Branch? | 3.1 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #20577 (comment) | License | MIT | Doc PR | n/a Commits ------- 828c761 mark alias as private during creation
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I know making a service private has a potential for breaking BC. Yet, these services should not be used directly in controllers/userland code, and I really doubt anyone did. Let's make it private now and fix linked issue (even if it's a false positive from SymfonyServiceDefinitionValidator, it shows we have this service that really isn't meant to be public).