8000 feature #27551 [FrameworkBundle] show public/private for aliases in d… · symfony/symfony@c694804 · GitHub
[go: up one dir, main page]

Skip to content

Commit c694804

Browse files
feature #27551 [FrameworkBundle] show public/private for aliases in debug:container command (OskarStark)
This PR was merged into the 4.2-dev branch. Discussion ---------- [FrameworkBundle] show public/private for aliases in debug:container command | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | not needed <!-- required for new features --> It could be helpful to see the public/private status for aliases in `debug:container` command. Otherwise you need to dive into the code to get the information, because the result only shows the options of the aliased service. ## Look & Feel for public alias ![screenshot 2018-06-08 09 25 50](https://user-images.githubusercontent.com/995707/41144664-f3b50766-6afd-11e8-92d0-ca30513a1afc.png) _text has slightly changed_ ## Look & Feel for private alias ![screenshot 2018-06-08 09 23 31](https://user-images.githubusercontent.com/995707/41144593-b354aad2-6afd-11e8-8ab1-f9196e567f67.png) _text has slightly changed_ //cc @nicolas-grekas Commits ------- 1df7742 [FrameworkBundle] show public/private for aliases in debug:container command
2 parents c6b3135 + 1df7742 commit c694804

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

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/alias_with_definition_1.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_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