From 0da4b8319700645fa4057b444c6524bd01d79643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4dlich?= Date: Fri, 3 May 2019 10:56:32 +0200 Subject: [PATCH] [DI] Removes number of elements information in debug mode --- .../FrameworkBundle/Command/ContainerDebugCommand.php | 1 + .../FrameworkBundle/Console/Descriptor/TextDescriptor.php | 7 ++++++- .../Tests/Console/Descriptor/AbstractDescriptorTest.php | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php index 62adea0e55f8c..eb4f8e4f6dc47 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php @@ -137,6 +137,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $options['show_arguments'] = $input->getOption('show-arguments'); $options['raw_text'] = $input->getOption('raw'); $options['output'] = $io; + $options['is_debug'] = $this->getApplication()->getKernel()->isDebug(); $helper->describe($io, $object, $options); if (!$input->getArgument('name') && !$input->getOption('tag') && !$input->getOption('parameter') && $input->isInteractive()) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php index 90c7602604e2e..911e60c08be5b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php +++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php @@ -17,6 +17,7 @@ use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; +use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; @@ -339,7 +340,11 @@ protected function describeContainerDefinition(Definition $definition, array $op if ($argument instanceof Reference) { $argumentsInformation[] = sprintf('Service(%s)', (string) $argument); } elseif ($argument instanceof IteratorArgument) { - $argumentsInformation[] = sprintf('Iterator (%d element(s))', \count($argument->getValues())); + if ($argument instanceof TaggedIteratorArgument) { + $argumentsInformation[] = sprintf('Tagged Iterator for "%s"%s', $argument->getTag(), $options['is_debug'] ? '' : sprintf(' (%d element(s))', \count($argument->getValues()))); + } else { + $argumentsInformation[] = sprintf('Iterator (%d element(s))', \count($argument->getValues())); + } } elseif ($argument instanceof Definition) { $argumentsInformation[] = 'Inlined Service'; } else { diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php index 9bc05e538c76e..248b5396dfdc3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTest.php @@ -182,6 +182,7 @@ abstract protected function getFormat(); private function assertDescription($expectedDescription, $describedObject, array $options = []) { + $options['is_debug'] = false; $options['raw_output'] = true; $options['raw_text'] = true; $output = new BufferedOutput(BufferedOutput::VERBOSITY_NORMAL, true); 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