8000 [FrameworkBundle] show public/private for aliases in debug:container … · symfony/symfony@1df7742 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1df7742

Browse files
OskarStarknicolas-grekas
authored andcommitted
[FrameworkBundle] show public/private for aliases in debug:container command
1 parent 3ccbec3 commit 1df7742

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,11 @@ protected function describeContainerDefinition(Definition $definition, array $op
352352
*/
353353
protected function describeContainerAlias(Alias $alias, array $options = array(), ContainerBuilder $builder = null)
354354
{
355-
$options['output']->comment(sprintf('This service is an alias for the service <info>%s</info>', (string) $alias));
355+
if ($alias->isPublic()) {
356+
$options['output']->comment(sprintf('This service is a <info>public</info> alias for the service <info>%s</info>', (string) $alias));
357+
} else {
358+
$options['output']->comment(sprintf('This service is a <comment>private</comment> alias for the service <info>%s</info>', (string) $alias));
359+
}
356360

357361
if (!$builder) {
358362
return;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
 // This service is an alias for the service service_1
2+
 // This service is a public alias for the service service_1
33

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
 // This service is an alias for the service .service_2
2+
 // This service is a private alias for the service .service_2
33

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
 // This service is an alias for the service service_1
1+
 // This service is a public alias for the service service_1
22

33
Information for Service "service_1"
44
===================================

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_2.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
 // This service is an alias for the service .service_2
1+
 // This service is a private alias for the service .service_2
22

33
Information for Service ".service_2"
44
====================================

0 commit comments

Comments
 (0)
0