diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
index 9830609d969ad..f40e6cc2335ea 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
@@ -48,8 +48,9 @@ protected function configure()
$this
->setDefinition(array(
new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
- new InputOption('show-private', null, InputOption::VALUE_NONE, 'Used to show public *and* private services'),
+ new InputOption('show-private', null, InputOption::VALUE_NONE, 'Used to show public *and* private services (deprecated)'),
new InputOption('show-arguments', null, InputOption::VALUE_NONE, 'Used to show arguments in services'),
+ new InputOption('show-hidden', null, InputOption::VALUE_NONE, 'Used to show hidden (internal) services'),
new InputOption('tag', null, InputOption::VALUE_REQUIRED, 'Shows all services with a specific tag'),
new InputOption('tags', null, InputOption::VALUE_NONE, 'Displays tagged services for an application'),
new InputOption('parameter', null, InputOption::VALUE_REQUIRED, 'Displays a specific parameter for an application'),
@@ -72,11 +73,6 @@ protected function configure()
php %command.full_name% --types
-By default, private services are hidden. You can display all services by
-using the --show-private flag:
-
- php %command.full_name% --show-private
-
Use the --tags option to display tagged public services grouped by tag:
php %command.full_name% --tags
@@ -93,6 +89,11 @@ protected function configure()
php %command.full_name% --parameter=kernel.debug
+By default, internal services are hidden. You can display them
+using the --show-hidden flag:
+
+ php %command.full_name% --show-hidden
+
EOF
)
;
@@ -103,6 +104,10 @@ protected function configure()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
+ if ($input->getOption('show-private')) {
+ @trigger_error('The "--show-private" option no longer has any effect and is deprecated since Symfony 4.1.', E_USER_DEPRECATED);
+ }
+
$io = new SymfonyStyle($input, $output);
$errorIo = $io->getErrorStyle();
@@ -110,7 +115,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$object = $this->getContainerBuilder();
if ($input->getOption('types')) {
- $options = array('show_private' => true);
+ $options = array();
$options['filter'] = array($this, 'filterToServiceTypes');
} elseif ($input->getOption('parameters')) {
$parameters = array();
@@ -122,19 +127,20 @@ protected function execute(InputInterface $input, OutputInterface $output)
} elseif ($parameter = $input->getOption('parameter')) {
$options = array('parameter' => $parameter);
} elseif ($input->getOption('tags')) {
- $options = array('group_by' => 'tags', 'show_private' => $input->getOption('show-private'));
+ $options = array('group_by' => 'tags');
} elseif ($tag = $input->getOption('tag')) {
- $options = array('tag' => $tag, 'show_private' => $input->getOption('show-private'));
+ $options = array('tag' => $tag);
} elseif ($name = $input->getArgument('name')) {
$name = $this->findProperServiceName($input, $errorIo, $object, $name);
$options = array('id' => $name);
} else {
- $options = array('show_private' => $input->getOption('show-private'));
+ $options = array();
}
$helper = new DescriptorHelper();
$options['format'] = $input->getOption('format');
$options['show_arguments'] = $input->getOption('show-arguments');
+ $options['show_hidden'] = $input->getOption('show-hidden');
$options['raw_text'] = $input->getOption('raw');
$options['output'] = $io;
$helper->describe($io, $object, $options);
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
index 043b4fff6e078..7161a18cec8a9 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
@@ -15,6 +15,7 @@
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
@@ -230,17 +231,21 @@ protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceI
return $builder->getAlias($serviceId);
}
+ if ('service_container' === $serviceId) {
+ return (new Definition(ContainerInterface::class))->setPublic(true)->setSynthetic(true);
+ }
+
// the service has been injected in some special way, just return the service
return $builder->get($serviceId);
}
/**
* @param ContainerBuilder $builder
- * @param bool $showPrivate
+ * @param bool $showHidden
*
* @return array
*/
- protected function findDefinitionsByTag(ContainerBuilder $builder, $showPrivate)
+ protected function findDefinitionsByTag(ContainerBuilder $builder, $showHidden)
{
$definitions = array();
$tags = $builder->findTags();
@@ -250,7 +255,7 @@ protected function findDefinitionsByTag(ContainerBuilder $builder, $showPrivate)
foreach ($builder->findTaggedServiceIds($tag) as $serviceId => $attributes) {
$definition = $this->resolveServiceDefinition($builder, $serviceId);
- if (!$definition instanceof Definition || !$showPrivate && !$definition->isPublic()) {
+ if ($showHidden xor '.' === ($serviceId[0] ?? null)) {
continue;
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
index 7b87fcf8965cd..90747f4fd8bc1 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
@@ -63,10 +63,10 @@ protected function describeContainerParameters(ParameterBag $parameters, array $
*/
protected function describeContainerTags(ContainerBuilder $builder, array $options = array())
{
- $showPrivate = isset($options['show_private']) && $options['show_private'];
+ $showHidden = isset($options['show_hidden']) && $options['show_hidden'];
$data = array();
- foreach ($this->findDefinitionsByTag($builder, $showPrivate) as $tag => $definitions) {
+ foreach ($this->findDefinitionsByTag($builder, $showHidden) as $tag => $definitions) {
$data[$tag] = array();
foreach ($definitions as $definition) {
$data[$tag][] = $this->getContainerDefinitionData($definition, true);
@@ -100,7 +100,7 @@ protected function describeContainerService($service, array $options = array(),
protected function describeContainerServices(ContainerBuilder $builder, array $options = array())
{
$serviceIds = isset($options['tag']) && $options['tag'] ? array_keys($builder->findTaggedServiceIds($options['tag'])) : $builder->getServiceIds();
- $showPrivate = isset($options['show_private']) && $options['show_private'];
+ $showHidden = isset($options['show_hidden']) && $options['show_hidden'];
$omitTags = isset($options['omit_tags']) && $options['omit_tags'];
$showArguments = isset($options['show_arguments']) && $options['show_arguments'];
$data = array('definitions' => array(), 'aliases' => array(), 'services' => array());
@@ -112,14 +112,14 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
$service = $this->resolveServiceDefinition($builder, $serviceId);
+ if ($showHidden xor '.' === ($serviceId[0] ?? null)) {
+ continue;
+ }
+
if ($service instanceof Alias) {
- if ($showPrivate || ($service->isPublic() && !$service->isPrivate())) {
- $data['aliases'][$serviceId] = $this->getContainerAliasData($service);
- }
+ $data['aliases'][$serviceId] = $this->getContainerAliasData($service);
} elseif ($service instanceof Definition) {
- if (($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
- $data['definitions'][$serviceId] = $this->getContainerDefinitionData($service, $omitTags, $showArguments);
- }
+ $data['definitions'][$serviceId] = $this->getContainerDefinitionData($service, $omitTags, $showArguments);
} else {
$data['services'][$serviceId] = get_class($service);
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
index 8836cc234bfb0..f96b684dc00a2 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
@@ -82,10 +82,10 @@ protected function describeContainerParameters(ParameterBag $parameters, array $
*/
protected function describeContainerTags(ContainerBuilder $builder, array $options = array())
{
- $showPrivate = isset($options['show_private']) && $options['show_private'];
+ $showHidden = isset($options['show_hidden']) && $options['show_hidden'];
$this->write("Container tags\n==============");
- foreach ($this->findDefinitionsByTag($builder, $showPrivate) as $tag => $definitions) {
+ foreach ($this->findDefinitionsByTag($builder, $showHidden) as $tag => $definitions) {
$this->write("\n\n".$tag."\n".str_repeat('-', strlen($tag)));
foreach ($definitions as $serviceId => $definition) {
$this->write("\n\n");
@@ -119,9 +119,9 @@ protected function describeContainerService($service, array $options = array(),
*/
protected function describeContainerServices(ContainerBuilder $builder, array $options = array())
{
- $showPrivate = isset($options['show_private']) && $options['show_private'];
+ $showHidden = isset($options['show_hidden']) && $options['show_hidden'];
- $title = $showPrivate ? 'Public and private services' : 'Public services';
+ $title = $showHidden ? 'Hidden services' : 'Services';
if (isset($options['tag'])) {
$title .= ' with tag `'.$options['tag'].'`';
}
@@ -138,14 +138,14 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
$service = $this->resolveServiceDefinition($builder, $serviceId);
+ if ($showHidden xor '.' === ($serviceId[0] ?? null)) {
+ continue;
+ }
+
if ($service instanceof Alias) {
- if ($showPrivate || ($service->isPublic() && !$service->isPrivate())) {
- $services['aliases'][$serviceId] = $service;
- }
+ $services['aliases'][$serviceId] = $service;
} elseif ($service instanceof Definition) {
- if (($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
- $services['definitions'][$serviceId] = $service;
- }
+ $services['definitions'][$serviceId] = $service;
} else {
$services['services'][$serviceId] = $service;
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
index cc9aa505731a5..af88a82bbb7d4 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
@@ -122,15 +122,15 @@ protected function describeContainerParameters(ParameterBag $parameters, array $
*/
protected function describeContainerTags(ContainerBuilder $builder, array $options = array())
{
- $showPrivate = isset($options['show_private']) && $options['show_private'];
+ $showHidden = isset($options['show_hidden']) && $options['show_hidden'];
- if ($showPrivate) {
- $options['output']->title('Symfony Container Public and Private Tags');
+ if ($showHidden) {
+ $options['output']->title('Symfony Container Hidden Tags');
} else {
- $options['output']->title('Symfony Container Public Tags');
+ $options['output']->title('Symfony Container Tags');
}
- foreach ($this->findDefinitionsByTag($builder, $showPrivate) as $tag => $definitions) {
+ foreach ($this->findDefinitionsByTag($builder, $showHidden) as $tag => $definitions) {
$options['output']->section(sprintf('"%s" tag', $tag));
$options['output']->listing(array_keys($definitions));
}
@@ -165,13 +165,13 @@ protected function describeContainerService($service, array $options = array(),
*/
protected function describeContainerServices(ContainerBuilder $builder, array $options = array())
{
- $showPrivate = isset($options['show_private']) && $options['show_private'];
+ $showHidden = isset($options['show_hidden']) && $options['show_hidden'];
$showTag = isset($options['tag']) ? $options['tag'] : null;
- if ($showPrivate) {
- $title = 'Symfony Container Public and Private Services';
+ if ($showHidden) {
+ $title = 'Symfony Container Hidden Services';
} else {
- $title = 'Symfony Container Public Services';
+ $title = 'Symfony Container Services';
}
if ($showTag) {
@@ -189,12 +189,14 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
foreach ($serviceIds as $key => $serviceId) {
$definition = $this->resolveServiceDefinition($builder, $serviceId);
+
+ // filter out hidden services unless shown explicitly
+ if ($showHidden xor '.' === ($serviceId[0] ?? null)) {
+ unset($serviceIds[$key]);
+ continue;
+ }
+
if ($definition instanceof Definition) {
- // filter out private services unless shown explicitly
- if (!$showPrivate && (!$definition->isPublic() || $definition->isPrivate())) {
- unset($serviceIds[$key]);
- continue;
- }
if ($showTag) {
$tags = $definition->getTag($showTag);
foreach ($tags as $tag) {
@@ -208,11 +210,6 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
}
}
}
- } elseif ($definition instanceof Alias) {
- if (!$showPrivate && (!$definition->isPublic() || $definition->isPrivate())) {
- unset($serviceIds[$key]);
- continue;
- }
}
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
index 1e3148db9a697..849831812684e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
@@ -58,7 +58,7 @@ protected function describeContainerParameters(ParameterBag $parameters, array $
*/
protected function describeContainerTags(ContainerBuilder $builder, array $options = array())
{
- $this->writeDocument($this->getContainerTagsDocument($builder, isset($options['show_private']) && $options['show_private']));
+ $this->writeDocument($this->getContainerTagsDocument($builder, isset($options['show_hidden']) && $options['show_hidden']));
}
/**
@@ -78,7 +78,7 @@ protected function describeContainerService($service, array $options = array(),
*/
protected function describeContainerServices(ContainerBuilder $builder, array $options = array())
{
- $this->writeDocument($this->getContainerServicesDocument($builder, isset($options['tag']) ? $options['tag'] : null, isset($options['show_private']) && $options['show_private'], isset($options['show_arguments']) && $options['show_arguments'], isset($options['filter']) ? $options['filter'] : null));
+ $this->writeDocument($this->getContainerServicesDocument($builder, isset($options['tag']) ? $options['tag'] : null, isset($options['show_hidden']) && $options['show_hidden'], isset($options['show_arguments']) && $options['show_arguments'], isset($options['filter']) ? $options['filter'] : null));
}
/**
@@ -231,12 +231,12 @@ private function getContainerParametersDocument(ParameterBag $parameters): \DOMD
return $dom;
}
- private function getContainerTagsDocument(ContainerBuilder $builder, bool $showPrivate = false): \DOMDocument
+ private function getContainerTagsDocument(ContainerBuilder $builder, bool $showHidden = false): \DOMDocument
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($containerXML = $dom->createElement('container'));
- foreach ($this->findDefinitionsByTag($builder, $showPrivate) as $tag => $definitions) {
+ foreach ($this->findDefinitionsByTag($builder, $showHidden) as $tag => $definitions) {
$containerXML->appendChild($tagXML = $dom->createElement('tag'));
$tagXML->setAttribute('name', $tag);
@@ -269,7 +269,7 @@ private function getContainerServiceDocument($service, string $id, ContainerBuil
return $dom;
}
- private function getContainerServicesDocument(ContainerBuilder $builder, string $tag = null, bool $showPrivate = false, bool $showArguments = false, callable $filter = null): \DOMDocument
+ private function getContainerServicesDocument(ContainerBuilder $builder, string $tag = null, bool $showHidden = false, bool $showArguments = false, callable $filter = null): \DOMDocument
{
$dom = new \DOMDocument('1.0', 'UTF-8');
$dom->appendChild($containerXML = $dom->createElement('container'));
@@ -283,7 +283,7 @@ private function getContainerServicesDocument(ContainerBuilder $builder, string
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
$service = $this->resolveServiceDefinition($builder, $serviceId);
- if (($service instanceof Definition || $service instanceof Alias) && !($showPrivate || ($service->isPublic() && !$service->isPrivate()))) {
+ if ($showHidden xor '.' === ($serviceId[0] ?? null)) {
continue;
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php
index ae8415cb4efbd..2530d9e75e024 100644
--- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php
+++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/CachePoolPass.php
@@ -134,7 +134,7 @@ public static function getServiceProvider(ContainerBuilder $container, $name)
if ($usedEnvs || preg_match('#^[a-z]++://#', $name)) {
$dsn = $name;
- if (!$container->hasDefinition($name = 'cache_connection.'.ContainerBuilder::hash($dsn))) {
+ if (!$container->hasDefinition($name = '.cache_connection.'.ContainerBuilder::hash($dsn))) {
$definition = new Definition(AbstractAdapter::class);
$definition->setPublic(false);
$definition->setFactory(array(AbstractAdapter::class, 'createConnection'));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php
index ab5c95a7d8b85..e186395214ee6 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php
@@ -119,7 +119,7 @@ public function getDescribeContainerDefinitionWhichIsAnAliasTestData()
{
$builder = current(ObjectsProvider::getContainerBuilders());
$builder->setDefinition('service_1', $builder->getDefinition('definition_1'));
- $builder->setDefinition('service_2', $builder->getDefinition('definition_2'));
+ $builder->setDefinition('.service_2', $builder->getDefinition('.definition_2'));
$aliases = ObjectsProvider::getContainerAliases();
$aliasesWithDefinitions = array();
@@ -130,8 +130,10 @@ public function getDescribeContainerDefinitionWhichIsAnAliasTestData()
$i = 0;
$data = $this->getDescriptionTestData($aliasesWithDefinitions);
foreach ($aliases as $name => $alias) {
+ $file = array_pop($data[$i]);
$data[$i][] = $builder;
$data[$i][] = array('id' => $name);
+ $data[$i][] = $file;
++$i;
}
@@ -148,8 +150,12 @@ public function getDescribeContainerParameterTestData()
{
$data = $this->getDescriptionTestData(ObjectsProvider::getContainerParameter());
+ $file = array_pop($data[0]);
$data[0][] = array('parameter' => 'database_name');
+ $data[0][] = $file;
+ $file = array_pop($data[1]);
$data[1][] = array('parameter' => 'twig.form.resources');
+ $data[1][] = $file;
return $data;
}
@@ -203,8 +209,9 @@ private function getDescriptionTestData(array $objects)
{
$data = array();
foreach ($objects as $name => $object) {
- $description = file_get_contents(sprintf('%s/../../Fixtures/Descriptor/%s.%s', __DIR__, $name, $this->getFormat()));
- $data[] = array($object, $description);
+ $file = sprintf('%s.%s', trim($name, '.'), $this->getFormat());
+ $description = file_get_contents(__DIR__.'/../../Fixtures/Descriptor/'.$file);
+ $data[] = array($object, $description, $file);
}
return $data;
@@ -213,18 +220,19 @@ private function getDescriptionTestData(array $objects)
private function getContainerBuilderDescriptionTestData(array $objects)
{
$variations = array(
- 'services' => array('show_private' => true),
- 'public' => array('show_private' => false),
- 'tag1' => array('show_private' => true, 'tag' => 'tag1'),
- 'tags' => array('group_by' => 'tags', 'show_private' => true),
- 'arguments' => array('show_private' => false, 'show_arguments' => true),
+ 'services' => array('show_hidden' => true),
+ 'public' => array('show_hidden' => false),
+ 'tag1' => array('show_hidden' => true, 'tag' => 'tag1'),
+ 'tags' => array('group_by' => 'tags', 'show_hidden' => true),
+ 'arguments' => array('show_hidden' => false, 'show_arguments' => true),
);
$data = array();
foreach ($objects as $name => $object) {
foreach ($variations as $suffix => $options) {
- $description = file_get_contents(sprintf('%s/../../Fixtures/Descriptor/%s_%s.%s', __DIR__, $name, $suffix, $this->getFormat()));
- $data[] = array($object, $description, $options);
+ $file = sprintf('%s_%s.%s', trim($name, '.'), $suffix, $this->getFormat());
+ $description = file_get_contents(__DIR__.'/../../Fixtures/Descriptor/'.$file);
+ $data[] = array($object, $description, $options, $file);
}
}
@@ -241,8 +249,9 @@ private function getEventDispatcherDescriptionTestData(array $objects)
$data = array();
foreach ($objects as $name => $object) {
foreach ($variations as $suffix => $options) {
- $description = file_get_contents(sprintf('%s/../../Fixtures/Descriptor/%s_%s.%s', __DIR__, $name, $suffix, $this->getFormat()));
- $data[] = array($object, $description, $options);
+ $file = sprintf('%s_%s.%s', trim($name, '.'), $suffix, $this->getFormat());
+ $description = file_get_contents(__DIR__.'/../../Fixtures/Descriptor/'.$file);
+ $data[] = array($object, $description, $options, $file);
}
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
index ce5cc7880b27c..3c5917934fad3 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/ObjectsProvider.php
@@ -107,20 +107,20 @@ public static function getContainerDefinitions()
->setSynthetic(false)
->setLazy(true)
->setAbstract(true)
- ->addArgument(new Reference('definition2'))
+ ->addArgument(new Reference('.definition_2'))
->addArgument('%parameter%')
->addArgument(new Definition('inline_service', array('arg1', 'arg2')))
->addArgument(array(
'foo',
- new Reference('definition2'),
+ new Reference('.definition_2'),
new Definition('inline_service'),
))
->addArgument(new IteratorArgument(array(
new Reference('definition_1'),
- new Reference('definition_2'),
+ new Reference('.definition_2'),
)))
->setFactory(array('Full\\Qualified\\FactoryClass', 'get')),
- 'definition_2' => $definition2
+ '.definition_2' => $definition2
->setPublic(false)
->setSynthetic(true)
->setFile('/path/to/file')
@@ -138,7 +138,7 @@ public static function getContainerAliases()
{
return array(
'alias_1' => new Alias('service_1', true),
- 'alias_2' => new Alias('service_2', false),
+ '.alias_2' => new Alias('.service_2', false),
);
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
index 5157944c7a580..56998dcd6c1f1 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
@@ -1075,7 +1075,7 @@ public function testCacheDefaultRedisProvider()
$container = $this->createContainerFromFile('cache');
$redisUrl = 'redis://localhost';
- $providerId = 'cache_connection.'.ContainerBuilder::hash($redisUrl);
+ $providerId = '.cache_connection.'.ContainerBuilder::hash($redisUrl);
$this->assertTrue($container->hasDefinition($providerId));
@@ -1089,7 +1089,7 @@ public function testCacheDefaultRedisProviderWithEnvVar()
$container = $this->createContainerFromFile('cache_env_var');
$redisUrl = 'redis://paas.com';
- $providerId = 'cache_connection.'.ContainerBuilder::hash($redisUrl);
+ $providerId = '.cache_connection.'.ContainerBuilder::hash($redisUrl);
$this->assertTrue($container->hasDefinition($providerId));
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.json
index 6998dae2828a8..df17ea15e4937 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.json
@@ -1,4 +1,4 @@
{
- "service": "service_2",
+ "service": ".service_2",
"public": false
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.md
index 73a4101d8bce3..4373d2e05516a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.md
@@ -1,2 +1,2 @@
-- Service: `service_2`
-- Public: no
\ No newline at end of file
+- Service: `.service_2`
+- Public: no
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.txt
index 0dbee6ac67c85..d4d8a41cbfea0 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.txt
@@ -1,3 +1,3 @@
-[39;49m // [39;49mThis service is an alias for the service [32mservice_2[39m
+[39;49m // [39;49mThis service is an alias for the service [32m.service_2[39m
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.xml
index 847050b33a428..55adaf323b948 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_2.xml
@@ -1,2 +1,2 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.json
index 03780e3eebe7a..2fb039a9fa0f5 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.json
@@ -1,6 +1,6 @@
[
{
- "service": "service_2",
+ "service": ".service_2",
"public": false
},
{
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.md
index 406c5dcada7a4..7894367566b87 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.md
@@ -1,9 +1,9 @@
-### alias_2
+### .alias_2
-- Service: `service_2`
+- Service: `.service_2`
- Public: no
-### service_2
+### .service_2
- Class: `Full\Qualified\Class2`
- Public: no
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.txt
index 735fe0130d1e1..aaa6d658bc75b 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.txt
@@ -1,12 +1,12 @@
-[39;49m // [39;49mThis service is an alias for the service [32mservice_2[39m
+[39;49m // [39;49mThis service is an alias for the service [32m.service_2[39m
-[33mInformation for Service "[39m[32mservice_2[39m[33m"[39m
-[33m===================================[39m
+[33mInformation for Service "[39m[32m.service_2[39m[33m"[39m
+[33m====================================[39m
----------------- ---------------------------------
[32m Option [39m [32m Value [39m
----------------- ---------------------------------
- Service ID service_2
+ Service ID .service_2
Class Full\Qualified\Class2
[39;49m Tags tag1 ([39;49m[32mattr1[39m[39;49m: val1, [39;49m[32mattr2[39m[39;49m: val2)[39;49m[39;49m [39;49m
[39;49m [39;49m[39;49mtag1 ([39;49m[32mattr3[39m[39;49m: val3)[39;49m[39;49m [39;49m
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.xml
index 3c15460beebe8..bbb7b92e44f8a 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.xml
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.json
index df76274db6417..bcafe91b64ed9 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.json
@@ -12,7 +12,7 @@
"arguments": [
{
"type": "service",
- "id": "definition2"
+ "id": ".definition_2"
},
"%parameter%",
{
@@ -35,7 +35,7 @@
"foo",
{
"type": "service",
- "id": "definition2"
+ "id": ".definition_2"
},
{
"class": "inline_service",
@@ -58,7 +58,7 @@
},
{
"type": "service",
- "id": "definition_2"
+ "id": ".definition_2"
}
]
],
@@ -66,6 +66,19 @@
"factory_class": "Full\\Qualified\\FactoryClass",
"factory_method": "get",
"tags": []
+ },
+ "service_container": {
+ "class": "Symfony\\Component\\DependencyInjection\\ContainerInterface",
+ "public": true,
+ "synthetic": true,
+ "lazy": false,
+ "shared": true,
+ "abstract": false,
+ "autowire": false,
+ "autoconfigure": false,
+ "arguments": [],
+ "file": null,
+ "tags": []
}
},
"aliases": {
@@ -74,7 +87,5 @@
"public": true
}
},
- "services": {
- "service_container": "Symfony\\Component\\DependencyInjection\\ContainerBuilder"
- }
+ "services": []
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.md
index 757da8278ca34..2ace4d31cb77d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.md
@@ -1,5 +1,5 @@
-Public services
-===============
+Services
+========
Definitions
-----------
@@ -18,6 +18,18 @@ Definitions
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
+### service_container
+
+- Class: `Symfony\Component\DependencyInjection\ContainerInterface`
+- Public: yes
+- Synthetic: yes
+- Lazy: no
+- Shared: yes
+- Abstract: no
+- Autowired: no
+- Autoconfigured: no
+- Arguments: no
+
Aliases
-------
@@ -27,8 +39,3 @@ Aliases
- Service: `service_1`
- Public: yes
-
-Services
---------
-
-- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.txt
index 87f6b2125d764..5ab36e2ebf186 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.txt
@@ -1,12 +1,12 @@
-[33mSymfony Container Public Services[39m
-[33m=================================[39m
+[33mSymfony Container Services[39m
+[33m==========================[39m
- ------------------- --------------------------------------------------------
- [32m Service ID [39m [32m Class name [39m
- ------------------- --------------------------------------------------------
- alias_1 alias for "service_1"
- definition_1 Full\Qualified\Class1
- service_container Symfony\Component\DependencyInjection\ContainerBuilder
- ------------------- --------------------------------------------------------
+ ------------------- ----------------------------------------------------------
+ [32m Service ID [39m [32m Class name [39m
+ ------------------- ----------------------------------------------------------
+ alias_1 alias for "service_1"
+ definition_1 Full\Qualified\Class1
+ service_container Symfony\Component\DependencyInjection\ContainerInterface
+ ------------------- ----------------------------------------------------------
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.xml
index 59811b00d37b9..6efe597d8fd3e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_arguments.xml
@@ -3,7 +3,7 @@
-
+
%parameter%
@@ -13,15 +13,15 @@
foo
-
+
-
+
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json
index 3419083f572bd..bb1ef325958ce 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.json
@@ -13,6 +13,18 @@
"factory_class": "Full\\Qualified\\FactoryClass",
"factory_method": "get",
"tags": []
+ },
+ "service_container": {
+ "class": "Symfony\\Component\\DependencyInjection\\ContainerInterface",
+ "public": true,
+ "synthetic": true,
+ "lazy": false,
+ "shared": true,
+ "abstract": false,
+ "autowire": false,
+ "autoconfigure": false,
+ "file": null,
+ "tags": []
}
},
"aliases": {
@@ -21,7 +33,5 @@
"public": true
}
},
- "services": {
- "service_container": "Symfony\\Component\\DependencyInjection\\ContainerBuilder"
- }
+ "services": []
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md
index b8c62be4bcf23..fedb514965d8d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md
@@ -1,5 +1,5 @@
-Public services
-===============
+Services
+========
Definitions
-----------
@@ -17,6 +17,17 @@ Definitions
- Factory Class: `Full\Qualified\FactoryClass`
- Factory Method: `get`
+### service_container
+
+- Class: `Symfony\Component\DependencyInjection\ContainerInterface`
+- Public: yes
+- Synthetic: yes
+- Lazy: no
+- Shared: yes
+- Abstract: no
+- Autowired: no
+- Autoconfigured: no
+
Aliases
-------
@@ -26,8 +37,3 @@ Aliases
- Service: `service_1`
- Public: yes
-
-Services
---------
-
-- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.txt
index 87f6b2125d764..5ab36e2ebf186 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.txt
@@ -1,12 +1,12 @@
-[33mSymfony Container Public Services[39m
-[33m=================================[39m
+[33mSymfony Container Services[39m
+[33m==========================[39m
- ------------------- --------------------------------------------------------
- [32m Service ID [39m [32m Class name [39m
- ------------------- --------------------------------------------------------
- alias_1 alias for "service_1"
- definition_1 Full\Qualified\Class1
- service_container Symfony\Component\DependencyInjection\ContainerBuilder
- ------------------- --------------------------------------------------------
+ ------------------- ----------------------------------------------------------
+ [32m Service ID [39m [32m Class name [39m
+ ------------------- ----------------------------------------------------------
+ alias_1 alias for "service_1"
+ definition_1 Full\Qualified\Class1
+ service_container Symfony\Component\DependencyInjection\ContainerInterface
+ ------------------- ----------------------------------------------------------
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
index ac92a28ef6a4d..66aba252af78c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.xml
@@ -4,5 +4,5 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
index becd607b797a5..0eda1932f7a15 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.json
@@ -1,20 +1,6 @@
{
"definitions": {
- "definition_1": {
- "class": "Full\\Qualified\\Class1",
- "public": true,
- "synthetic": false,
- "lazy": true,
- "shared": true,
- "abstract": true,
- "autowire": false,
- "autoconfigure": false,
- "file": null,
- "factory_class": "Full\\Qualified\\FactoryClass",
- "factory_method": "get",
- "tags": []
- },
- "definition_2": {
+ ".definition_2": {
"class": "Full\\Qualified\\Class2",
"public": false,
"synthetic": true,
@@ -51,16 +37,10 @@
}
},
"aliases": {
- "alias_1": {
- "service": "service_1",
- "public": true
- },
- "alias_2": {
- "service": "service_2",
+ ".alias_2": {
+ "service": ".service_2",
"public": false
}
},
- "services": {
- "service_container": "Symfony\\Component\\DependencyInjection\\ContainerBuilder"
- }
+ "services": []
}
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
index 54655668b435b..2d0edfd01952e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.md
@@ -1,23 +1,10 @@
-Public and private services
-===========================
+Hidden services
+===============
Definitions
-----------
-### definition_1
-
-- Class: `Full\Qualified\Class1`
-- Public: yes
-- Synthetic: no
-- Lazy: yes
-- Shared: yes
-- Abstract: yes
-- Autowired: no
-- Autoconfigured: no
-- Factory Class: `Full\Qualified\FactoryClass`
-- Factory Method: `get`
-
-### definition_2
+### .definition_2
- Class: `Full\Qualified\Class2`
- Public: no
@@ -42,18 +29,8 @@ Definitions
Aliases
-------
-### alias_1
-
-- Service: `service_1`
-- Public: yes
-
-### alias_2
+### .alias_2
-- Service: `service_2`
+- Service: `.service_2`
- Public: no
-
-Services
---------
-
-- `service_container`: `Symfony\Component\DependencyInjection\ContainerBuilder`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.txt
index e23ea6d81f5ad..82b4909242d84 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.txt
@@ -1,14 +1,11 @@
-[33mSymfony Container Public and Private Services[39m
-[33m=============================================[39m
+[33mSymfony Container Hidden Services[39m
+[33m=================================[39m
- ------------------- --------------------------------------------------------
- [32m Service ID [39m [32m Class name [39m
- ------------------- --------------------------------------------------------
- alias_1 alias for "service_1"
- alias_2 alias for "service_2"
- definition_1 Full\Qualified\Class1
- definition_2 Full\Qualified\Class2
- service_container Symfony\Component\DependencyInjection\ContainerBuilder
- ------------------- --------------------------------------------------------
+ --------------- ------------------------
+ [32m Service ID [39m [32m Class name [39m
+ --------------- ------------------------
+ .alias_2 alias for ".service_2"
+ .definition_2 Full\Qualified\Class2
+ --------------- ------------------------
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
index 54da4f4f48427..a311a2e2bb991 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_services.xml
@@ -1,11 +1,7 @@
-
-
-
-
-
-
+
+
@@ -21,5 +17,4 @@
-
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json
index fb9634f67a309..caba59cd5ba47 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.json
@@ -1,6 +1,6 @@
{
"definitions": {
- "definition_2": {
+ ".definition_2": {
"class": "Full\\Qualified\\Class2",
"public": false,
"synthetic": true,
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md
index 9895f1fb5d8b2..a7a03bc391a55 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.md
@@ -1,10 +1,10 @@
-Public and private services with tag `tag1`
-===========================================
+Hidden services with tag `tag1`
+===============================
Definitions
-----------
-### definition_2
+### .definition_2
- Class: `Full\Qualified\Class2`
- Public: no
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.txt
index b8b393266acda..33c96b30d8ae3 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.txt
@@ -1,11 +1,11 @@
-[33mSymfony Container Public and Private Services Tagged with "tag1" Tag[39m
-[33m====================================================================[39m
+[33mSymfony Container Hidden Services Tagged with "tag1" Tag[39m
+[33m========================================================[39m
- -------------- ------- ------- ------- -----------------------
- [32m Service ID [39m [32m attr1 [39m [32m attr2 [39m [32m attr3 [39m [32m Class name [39m
- -------------- ------- ------- ------- -----------------------
- definition_2 val1 val2 Full\Qualified\Class2
- " val3
- -------------- ------- ------- ------- -----------------------
+ --------------- ------- ------- ------- -----------------------
+ [32m Service ID [39m [32m attr1 [39m [32m attr2 [39m [32m attr3 [39m [32m Class name [39m
+ --------------- ------- ------- ------- -----------------------
+ .definition_2 val1 val2 Full\Qualified\Class2
+ " val3
+ --------------- ------- ------- ------- -----------------------
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
index 9c39b653dd5fc..6dd2fc6173b10 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tag1.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md
index 205596259d2c6..563ce2d2caf39 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.md
@@ -4,7 +4,7 @@ Container tags
tag1
----
-### definition_2
+### .definition_2
- Class: `Full\Qualified\Class2`
- Public: no
@@ -23,7 +23,7 @@ tag1
tag2
----
-### definition_2
+### .definition_2
- Class: `Full\Qualified\Class2`
- Public: no
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.txt
index 45523dcb68ed7..b10e4661f6701 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.txt
@@ -1,14 +1,14 @@
-[33mSymfony Container Public and Private Tags[39m
-[33m=========================================[39m
+[33mSymfony Container Hidden Tags[39m
+[33m=============================[39m
[33m"tag1" tag[39m
[33m----------[39m
- * definition_2
+ * .definition_2
[33m"tag2" tag[39m
[33m----------[39m
- * definition_2
+ * .definition_2
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
index 4e98e77a19a23..77975ee27c639 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_tags.xml
@@ -1,7 +1,7 @@
-
+
@@ -9,7 +9,7 @@
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.json b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.json
index 2568b87dec458..209557d5baf5d 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.json
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.json
@@ -10,7 +10,7 @@
"arguments": [
{
"type": "service",
- "id": "definition2"
+ "id": ".definition_2"
},
"%parameter%",
{
@@ -33,7 +33,7 @@
"foo",
{
"type": "service",
- "id": "definition2"
+ "id": ".definition_2"
},
{
"class": "inline_service",
@@ -56,7 +56,7 @@
},
{
"type": "service",
- "id": "definition_2"
+ "id": ".definition_2"
}
]
],
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.txt
index 989f96ee1369f..b73eeedad61db 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.txt
@@ -13,7 +13,7 @@
Autoconfigured no
Factory Class Full\Qualified\FactoryClass
Factory Method get
-[39;49m Arguments Service(definition2)[39;49m[39;49m [39;49m
+[39;49m Arguments Service(.definition_2)[39;49m[39;49m [39;49m
[39;49m [39;49m[39;49m%parameter%[39;49m[39;49m [39;49m
[39;49m [39;49m[39;49mInlined Service[39;49m[39;49m [39;49m
[39;49m [39;49m[39;49mArray (3 element(s))[39;49m[39;49m [39;49m
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.xml
index e250060d75581..c3a099c152780 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.xml
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_1.xml
@@ -1,7 +1,7 @@
-
+
%parameter%
@@ -11,13 +11,13 @@
foo
-
+
-
+
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_2.md
index abe7dd475db2c..e9f0efbd10bea 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_2.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/definition_arguments_2.md
@@ -16,4 +16,4 @@
- Attr2: val2
- Tag: `tag1`
- Attr3: val3
-- Tag: `tag2`
\ No newline at end of file
+- Tag: `tag2`
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php
index d19b08f739b82..4bdf7592b45bc 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php
@@ -55,12 +55,12 @@ public function testPrivateAlias()
$application->setAutoExit(false);
$tester = new ApplicationTester($application);
- $tester->run(array('command' => 'debug:container', '--show-private' => true));
- $this->assertContains('public', $tester->getDisplay());
- $this->assertContains('private_alias', $tester->getDisplay());
+ $tester->run(array('command' => 'debug:container', '--show-hidden' => true));
+ $this->assertNotContains('public', $tester->getDisplay());
+ $this->assertNotContains('private_alias', $tester->getDisplay());
$tester->run(array('command' => 'debug:container'));
$this->assertContains('public', $tester->getDisplay());
- $this->assertNotContains('private_alias', $tester->getDisplay());
+ $this->assertContains('private_alias', $tester->getDisplay());
}
}
diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
index 88ab77577041e..137ba47c04a66 100644
--- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
+++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
@@ -634,7 +634,7 @@ private function createSwitchUserListener($container, $id, $config, $defaultProv
private function createExpression($container, $expression)
{
- if (isset($this->expressions[$id = 'security.expression.'.ContainerBuilder::hash($expression)])) {
+ if (isset($this->expressions[$id = '.security.expression.'.ContainerBuilder::hash($expression)])) {
return $this->expressions[$id];
}
@@ -657,7 +657,7 @@ private function createRequestMatcher($container, $path = null, $host = null, $m
$methods = array_map('strtoupper', (array) $methods);
}
- $id = 'security.request_matcher.'.ContainerBuilder::hash(array($path, $host, $methods, $ip, $attributes));
+ $id = '.security.request_matcher.'.ContainerBuilder::hash(array($path, $host, $methods, $ip, $attributes));
if (isset($this->requestMatchers[$id])) {
return $this->requestMatchers[$id];
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php
index f6237ad1ed6cc..1366a2608c872 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php
@@ -84,7 +84,7 @@ public function testFirewalls()
array(
'simple',
'security.user_checker',
- 'security.request_matcher.6tndozi',
+ '.security.request_matcher.6tndozi',
false,
),
array(
@@ -117,7 +117,7 @@ public function testFirewalls()
array(
'host',
'security.user_checker',
- 'security.request_matcher.and0kk1',
+ '.security.request_matcher.and0kk1',
true,
false,
'security.user.provider.concrete.default',
diff --git a/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php b/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
index 51d1e419ed190..bb0f1b3e4f2b2 100644
--- a/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
+++ b/src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
@@ -90,7 +90,7 @@ private function doProcessValue($value, $isRoot = false)
if (ContainerBuilder::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE === $value->getInvalidBehavior()) {
// since the error message varies by referenced id and $this->currentId, so should the id of the dummy errored definition
- $this->container->register($id = sprintf('_errored.%s.%s', $this->currentId, (string) $value), $value->getType())
+ $this->container->register($id = sprintf('.errored.%s.%s', $this->currentId, (string) $value), $value->getType())
->addError($message);
return new TypedReference($id, $value->getType(), $value->getInvalidBehavior());
diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php
index 15110261a2252..cf58f303f5c4e 100644
--- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php
+++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInstanceofConditionalsPass.php
@@ -77,8 +77,8 @@ private function processDefinition(ContainerBuilder $container, $id, Definition
foreach ($instanceofDefs as $key => $instanceofDef) {
/** @var ChildDefinition $instanceofDef */
$instanceofDef = clone $instanceofDef;
- $instanceofDef->setAbstract(true)->setParent($parent ?: 'abstract.instanceof.'.$id);
- $parent = 'instanceof.'.$interface.'.'.$key.'.'.$id;
+ $instanceofDef->setAbstract(true)->setParent($parent ?: '.abstract.instanceof.'.$id);
+ $parent = '.instanceof.'.$interface.'.'.$key.'.'.$id;
$container->setDefinition($parent, $instanceofDef);
$instanceofTags[] = $instanceofDef->getTags();
$instanceofDef->setTags(array());
@@ -91,7 +91,7 @@ private function processDefinition(ContainerBuilder $container, $id, Definition
if ($parent) {
$bindings = $definition->getBindings();
- $abstract = $container->setDefinition('abstract.instanceof.'.$id, $definition);
+ $abstract = $container->setDefinition('.abstract.instanceof.'.$id, $definition);
// cast Definition to ChildDefinition
$definition->setBindings(array());
diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php
index d894a2f99008b..97f4c1978d350 100644
--- a/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php
+++ b/src/Symfony/Component/DependencyInjection/Compiler/ResolveInvalidReferencesPass.php
@@ -105,7 +105,7 @@ private function processValue($value, $rootLevel = 0, $level = 0)
$e = new ServiceNotFoundException($id, $this->currentId);
// since the error message varies by $id and $this->currentId, so should the id of the dummy errored definition
- $this->container->register($id = sprintf('_errored.%s.%s', $this->currentId, $id), $value->getType())
+ $this->container->register($id = sprintf('.errored.%s.%s', $this->currentId, $id), $value->getType())
->addError($e->getMessage());
return new TypedReference($id, $value->getType(), $value->getInvalidBehavior());
diff --git a/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php b/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php
index fb32d501ac29e..3969c74fcb243 100644
--- a/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php
+++ b/src/Symfony/Component/DependencyInjection/Compiler/ServiceLocatorTagPass.php
@@ -54,7 +54,7 @@ protected function processValue($value, $isRoot = false)
$value->setArguments($arguments);
- $id = 'service_locator.'.ContainerBuilder::hash($value);
+ $id = '.service_locator.'.ContainerBuilder::hash($value);
if ($isRoot) {
if ($id !== $this->currentId) {
@@ -91,7 +91,7 @@ public static function register(ContainerBuilder $container, array $refMap, $cal
->setPublic(false)
->addTag('container.service_locator');
- if (!$container->has($id = 'service_locator.'.ContainerBuilder::hash($locator))) {
+ if (!$container->has($id = '.service_locator.'.ContainerBuilder::hash($locator))) {
$container->setDefinition($id, $locator);
}
diff --git a/src/Symfony/Component/DependencyInjection/Container.php b/src/Symfony/Component/DependencyInjection/Container.php
index 2afd4518496e2..2b3ab61e42f13 100644
--- a/src/Symfony/Component/DependencyInjection/Container.php
+++ b/src/Symfony/Component/DependencyInjection/Container.php
@@ -262,6 +262,9 @@ private function make(string $id, int $invalidBehavior)
$alternatives = array();
foreach ($this->getServiceIds() as $knownId) {
+ if ('' === $knownId || '.' === $knownId[0]) {
+ continue;
+ }
$lev = levenshtein($id, $knownId);
if ($lev <= strlen($id) / 3 || false !== strpos($knownId, $id)) {
$alternatives[] = $knownId;
diff --git a/src/Symfony/Component/DependencyInjection/Loader/Configurator/ServicesConfigurator.php b/src/Symfony/Component/DependencyInjection/Loader/Configurator/ServicesConfigurator.php
index ce122dcec96bf..978bb87a71725 100644
--- a/src/Symfony/Component/DependencyInjection/Loader/Configurator/ServicesConfigurator.php
+++ b/src/Symfony/Component/DependencyInjection/Loader/Configurator/ServicesConfigurator.php
@@ -79,7 +79,7 @@ final public function set(?string $id, string $class = null): ServiceConfigurato
throw new \LogicException('Anonymous services must have a class name.');
}
- $id = sprintf('%d_%s', ++$this->anonymousCount, preg_replace('/^.*\\\\/', '', $class).'~'.$this->anonymousHash);
+ $id = sprintf('.%d_%s', ++$this->anonymousCount, preg_replace('/^.*\\\\/', '', $class).'~'.$this->anonymousHash);
$definition->setPublic(false);
} else {
$definition->setPublic($defaults->isPublic());
diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
index 7c89984cefb70..fbffdb127f33d 100644
--- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
+++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
@@ -408,7 +408,7 @@ private function processAnonymousServices(\DOMDocument $xml, $file, $defaults)
foreach ($nodes as $node) {
if ($services = $this->getChildren($node, 'service')) {
// give it a unique name
- $id = sprintf('%d_%s', ++$count, preg_replace('/^.*\\\\/', '', $services[0]->getAttribute('class')).'~'.$suffix);
+ $id = sprintf('.%d_%s', ++$count, preg_replace('/^.*\\\\/', '', $services[0]->getAttribute('class')).'~'.$suffix);
$node->setAttribute('id', $id);
$node->setAttribute('service', $id);
diff --git a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
index 81584f57ef306..b3c0c99d5e273 100644
--- a/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
+++ b/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
@@ -707,7 +707,7 @@ private function resolveServices($value, $file, $isParameter = false)
$instanceof = $this->instanceof;
$this->instanceof = array();
- $id = sprintf('%d_%s', ++$this->anonymousServicesCount, preg_replace('/^.*\\\\/', '', isset($argument['class']) ? $argument['class'] : '').$this->anonymousServicesSuffix);
+ $id = sprintf('.%d_%s', ++$this->anonymousServicesCount, preg_replace('/^.*\\\\/', '', isset($argument['class']) ? $argument['class'] : '').$this->anonymousServicesSuffix);
$this->parseDefinition($id, $argument, $file, array());
if (!$this->container->hasDefinition($id)) {
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php
index aebb66863f306..21bdda7698f3a 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php
@@ -862,6 +862,6 @@ public function testErroredServiceLocator()
$erroredDefinition = new Definition(MissingClass::class);
- $this->assertEquals($erroredDefinition->addError('Cannot autowire service "some_locator": it has type "Symfony\Component\DependencyInjection\Tests\Compiler\MissingClass" but this class was not found.'), $container->getDefinition('_errored.some_locator.'.MissingClass::class));
+ $this->assertEquals($erroredDefinition->addError('Cannot autowire service "some_locator": it has type "Symfony\Component\DependencyInjection\Tests\Compiler\MissingClass" but this class was not found.'), $container->getDefinition('.errored.some_locator.'.MissingClass::class));
}
}
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php
index 21a2810578e97..7269f2bf54871 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php
@@ -29,7 +29,7 @@ public function testProcess()
(new ResolveInstanceofConditionalsPass())->process($container);
- $parent = 'instanceof.'.parent::class.'.0.foo';
+ $parent = '.instanceof.'.parent::class.'.0.foo';
$def = $container->getDefinition('foo');
$this->assertEmpty($def->getInstanceofConditionals());
$this->assertInstanceOf(ChildDefinition::class, $def);
@@ -242,7 +242,7 @@ public function testMergeReset()
(new ResolveInstanceofConditionalsPass())->process($container);
- $abstract = $container->getDefinition('abstract.instanceof.bar');
+ $abstract = $container->getDefinition('.abstract.instanceof.bar');
$this->assertEmpty($abstract->getArguments());
$this->assertEmpty($abstract->getMethodCalls());
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/anonymous.expected.yml b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/anonymous.expected.yml
index 3f26138991021..b425e53cb9c99 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/anonymous.expected.yml
+++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/anonymous.expected.yml
@@ -8,7 +8,7 @@ services:
class: Bar\FooClass
public: true
arguments: [!tagged listener]
- 2_stdClass~%s:
+ .2_stdClass~%s:
class: stdClass
public: false
tags:
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php
index 7ed23ebf7d5e3..2c887e0e21e0c 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php
@@ -54,11 +54,11 @@ public function isCompiled()
public function getRemovedIds()
{
return array(
+ '.service_locator.ljJrY4L' => true,
+ '.service_locator.ljJrY4L.foo_service' => true,
'Psr\\Container\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\ContainerInterface' => true,
'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => true,
- 'service_locator.ljJrY4L' => true,
- 'service_locator.ljJrY4L.foo_service' => true,
);
}
diff --git a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
index df625bb0131b1..ac11c92ffa457 100644
--- a/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
+++ b/src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php
@@ -555,7 +555,7 @@ public function testAnonymousServices()
$this->assertCount(1, $args);
$this->assertInstanceOf(Reference::class, $args[0]);
$this->assertTrue($container->has((string) $args[0]));
- $this->assertRegExp('/^\d+_Bar[._A-Za-z0-9]{7}$/', (string) $args[0]);
+ $this->assertRegExp('/^\.\d+_Bar[._A-Za-z0-9]{7}$/', (string) $args[0]);
$anonymous = $container->getDefinition((string) $args[0]);
$this->assertEquals('Bar', $anonymous->getClass());
@@ -567,7 +567,7 @@ public function testAnonymousServices()
$this->assertInternalType('array', $factory);
$this->assertInstanceOf(Reference::class, $factory[0]);
$this->assertTrue($container->has((string) $factory[0]));
- $this->assertRegExp('/^\d+_Quz[._A-Za-z0-9]{7}$/', (string) $factory[0]);
+ $this->assertRegExp('/^\.\d+_Quz[._A-Za-z0-9]{7}$/', (string) $factory[0]);
$this->assertEquals('constructFoo', $factory[1]);
$anonymous = $container->getDefinition((string) $factory[0]);
diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php b/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php
index 824b14967f7a0..cd76e56caab83 100644
--- a/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php
+++ b/src/Symfony/Component/HttpKernel/DependencyInjection/RegisterControllerArgumentLocatorsPass.php
@@ -139,7 +139,7 @@ public function process(ContainerBuilder $container)
$binding->setValues(array($bindingValue, $bindingId, true));
if (!$bindingValue instanceof Reference) {
- $args[$p->name] = new Reference('_value.'.$container->hash($bindingValue));
+ $args[$p->name] = new Reference('.value.'.$container->hash($bindingValue));
$container->register((string) $args[$p->name], 'mixed')
->setFactory('current')
->addArgument(array($bindingValue));