minor #20666 [FrameworkBundle] mark alias as private during creation (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 | https://github.com/symfony/symfony/pull/20577#discussion_r89133711
| License       | MIT
| Doc PR        | n/a

Commits
-------

828c761 mark alias as private during creation
This commit is contained in:
Fabien Potencier 2016-11-29 09:10:50 +01:00
commit e4a2c17a19

View File

@ -12,6 +12,7 @@
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
use Doctrine\Common\Annotations\Reader;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Definition;
@ -1044,8 +1045,7 @@ class FrameworkExtension extends Extension
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);
$container->setAlias('cache.'.$name, new Alias(Compiler\CachePoolPass::getServiceProvider($container, $config[$name]), false));
}
}
foreach (array('app', 'system') as $name) {