8000 minor #20452 debug service with one line by tag (nykopol) · src-run/symfony@20076b0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 20076b0

Browse files
committed
minor symfony#20452 debug service with one line by tag (nykopol)
This PR was submitted for the 2.8 branch but it was merged into the 3.3-dev branch instead (closes symfony#20452). Discussion ---------- debug service with one line by tag | Q | A | ------------- | --- | Branch? | 2.8, 3.* | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Since the 2.8 branch, the `debug:container` command output service tags in one single line. So if the debugged service have many tags, this print an unreadable large table. This PR solve this issue by printing one line by tag. Commits ------- dbf4850 debug service with one line by tag
2 parents fe454e4 + dbf4850 commit 20076b0

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ protected function describeContainerDefinition(Definition $definition, array $op
254254

255255
$tags = $definition->getTags();
256256
if (count($tags)) {
257-
$tagInformation = '';
257+
$tagInformation = array();
258258
foreach ($tags as $tagName => $tagData) {
259259
foreach ($tagData as $tagParameters) {
260260
$parameters = array_map(function ($key, $value) {
@@ -263,12 +263,13 @@ protected function describeContainerDefinition(Definition $definition, array $op
263263
$parameters = implode(', ', $parameters);
264264

265265
if ('' === $parameters) {
266-
$tagInformation .= sprintf('%s', $tagName);
266+
$tagInformation[] = sprintf('%s', $tagName);
267267
} else {
268-
$tagInformation .= sprintf('%s (%s)', $tagName, $parameters);
268+
$tagInformation[] = sprintf('%s (%s)', $tagName, $parameters);
269269
}
270270
}
271271
}
272+
$tagInformation = implode("\n", $tagInformation);
272273
} else {
273274
$tagInformation = '-';
274275
}
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
------------------ -------------------------------------------------------
2-
 Option   Value 
3-
------------------ -------------------------------------------------------
4-
Service ID -
5-
Class Full\Qualified\Class2
6-
Tags tag1 (attr1: val1, attr2: val2)tag1 (attr3: val3)tag2
7-
Calls setMailer
8-
Public no
9-
Synthetic yes
10-
Lazy no
11-
Shared yes
12-
Abstract no
13-
Autowired no
14-
Autowiring Types -
15-
Required File /path/to/file
16-
Factory Service factory.service
17-
Factory Method get
18-
------------------ -------------------------------------------------------
1+
------------------ ---------------------------------
2+
 Option   Value 
3+
------------------ ---------------------------------
4+
Service ID -
5+
Class Full\Qualified\Class2
6+
Tags tag1 (attr1: val1, attr2: val2)
7+
tag1 (attr3: val3)
8+
tag2
9+
Calls setMailer
10+
Public no
11+
Synthetic yes
12+
Lazy no
13+
Shared yes
14+
Abstract no
15+
Autowired no
16+
Autowiring Types -
17+
Required File /path/to/file
18+
Factory Service factory.service
19+
Factory Method get
20+
------------------ ---------------------------------
1921

0 commit comments

Comments
 (0)
0