Skip to content

Commit ed07611

Browse files
committed
Making the service id jump out with debug:container or debug:types
1 parent e0c4a89 commit ed07611

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
224224

225225
$tableHeaders = array_merge(array('Service ID'), $tagsNames, array('Class name'));
226226
$tableRows = array();
227+
$rawOutput = isset($options['raw_output']) && $options['raw_output'];
227228
foreach ($this->sortServiceIds($serviceIds) as $serviceId) {
228229
$definition = $this->resolveServiceDefinition($builder, $serviceId);
230+
$styledServiceId = $rawOutput ? $serviceId : sprintf('<fg=cyan>%s</fg=cyan>', $serviceId);
229231
if ($definition instanceof Definition) {
230232
if ($showTag) {
231233
foreach ($definition->getTag($showTag) as $key => $tag) {
@@ -240,13 +242,13 @@ protected function describeContainerServices(ContainerBuilder $builder, array $o
240242
}
241243
}
242244
} else {
243-
$tableRows[] = array($serviceId, $definition->getClass());
245+
$tableRows[] = array($styledServiceId, $definition->getClass());
244246
}
245247
} elseif ($definition instanceof Alias) {
246248
$alias = $definition;
247-
$tableRows[] = array_merge(array($serviceId, sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, '') : array());
249+
$tableRows[] = array_merge(array($styledServiceId, sprintf('alias for "%s"', $alias)), $tagsCount ? array_fill(0, $tagsCount, '') : array());
248250
} else {
249-
$tableRows[] = array_merge(array($serviceId, get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, '') : array());
251+
$tableRows[] = array_merge(array($styledServiceId, get_class($definition)), $tagsCount ? array_fill(0, $tagsCount, '') : array());
250252
}
251253
}
252254

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy