Skip to content

Commit

Permalink
feature #11317 remove the scope from the output of the container:debu…
Browse files Browse the repository at this point in the history
…g command (xabbuh)

This PR was merged into the 2.6-dev branch.

Discussion
----------

remove the scope from the output of the container:debug command

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11302
| License       | MIT
| Doc PR        |

Commits
-------

f56b731 remove the scope from the output of the container:debug command
  • Loading branch information
fabpot committed Jul 23, 2014
2 parents cbfcc77 + f56b731 commit ee0a074
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o

$table = new TableHelper();
$table->setLayout(TableHelper::LAYOUT_COMPACT);
$table->setHeaders(array_merge(array('Service ID'), $tagsNames, array('Scope', 'Class name')));
$table->setHeaders(array_merge(array('Service ID'), $tagsNames, array('Class name')));

foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
$definition = $this->resolveServiceDefinition($builder, $serviceId);
Expand All @@ -214,20 +214,20 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
$tagValues[] = isset($tag[$tagName]) ? $tag[$tagName] : "";
}
if (0 === $key) {
$table->addRow(array_merge(array($serviceId), $tagValues, array($definition->getScope(), $definition->getClass())));
$table->addRow(array_merge(array($serviceId), $tagValues, array($definition->getClass())));
} else {
$table->addRow(array_merge(array(' "'), $tagValues, array('', '')));
$table->addRow(array_merge(array(' "'), $tagValues, array('')));
}
}
} else {
$table->addRow(array($serviceId, $definition->getScope(), $definition->getClass()));
$table->addRow(array($serviceId, $definition->getClass()));
}
} elseif ($definition instanceof Alias) {
$alias = $definition;
$table->addRow(array_merge(array($serviceId, 'n/a', sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, "") : array()));
$table->addRow(array_merge(array($serviceId, sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, "") : array()));
} else {
// we have no information (happens with "service_container")
$table->addRow(array_merge(array($serviceId, '', get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, "") : array()));
$table->addRow(array_merge(array($serviceId, get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, "") : array()));
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<info>[container]</info> <comment>Public</comment> services
Service ID Scope Class name
alias_1 n/a alias for "service_1"
alias_2 n/a alias for "service_2"
definition_1 container Full\Qualified\Class1
service_container Symfony\Component\DependencyInjection\ContainerBuilder
Service ID Class name
alias_1 alias for "service_1"
alias_2 alias for "service_2"
definition_1 Full\Qualified\Class1
service_container Symfony\Component\DependencyInjection\ContainerBuilder
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<info>[container]</info> <comment>Public</comment> and <comment>private</comment> services
Service ID Scope Class name
alias_1 n/a alias for "service_1"
alias_2 n/a alias for "service_2"
definition_1 container Full\Qualified\Class1
definition_2 container Full\Qualified\Class2
service_container Symfony\Component\DependencyInjection\ContainerBuilder

Service ID Class name
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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<info>[container]</info> <comment>Public</comment> and <comment>private</comment> services with tag <info>tag1</info>
Service ID attr1 attr2 attr3 Scope Class name
definition_2 val1 val2 container Full\Qualified\Class2
" val3
Service ID attr1 attr2 attr3 Class name
definition_2 val1 val2 Full\Qualified\Class2
" val3

0 comments on commit ee0a074

Please sign in to comment.