From 4705e6f7cc7c349a5e59e640b534d1f47bf7f9d2 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 18 Sep 2013 14:22:34 +0200 Subject: [PATCH] fixed previous merge (refs #8635) --- .../Command/ConfigDumpReferenceCommand.php | 22 +++++++++---------- .../Definition/Dumper/XmlReferenceDumper.php | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php index 3eddc9cffa..8f4e34fc1b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php @@ -14,6 +14,7 @@ namespace Symfony\Bundle\FrameworkBundle\Command; use Symfony\Component\Config\Definition\Dumper\YamlReferenceDumper; use Symfony\Component\Config\Definition\Dumper\XmlReferenceDumper; use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -34,25 +35,21 @@ class ConfigDumpReferenceCommand extends ContainerDebugCommand $this ->setName('config:dump-reference') ->setDefinition(array( - new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle or extension alias'), + new InputArgument('name', InputArgument::OPTIONAL, 'The Bundle name or the extension alias'), new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The format, either yaml or xml', 'yaml'), )) - ->setDescription('Dumps default configuration for an extension') + ->setDescription('Dumps the default configuration for an extension') ->setHelp(<<%command.name% command dumps the default configuration for an extension/bundle. +The %command.name% command dumps the default configuration for an +extension/bundle. The extension alias or bundle name can be used: -Example: - php %command.full_name% framework - -or - php %command.full_name% FrameworkBundle -With the format option specifies the format of the configuration, this is either yaml -or xml. When the option is not provided, yaml is used. +With the format option specifies the format of the configuration, +this is either yaml or xml. When the option is not provided, yaml is used. EOF ) ; @@ -122,16 +119,17 @@ EOF throw new \LogicException(sprintf('Configuration class "%s" should implement ConfigurationInterface in order to be dumpable', get_class($configuration))); } - $output->writeln($message); - switch ($input->getOption('format')) { case 'yaml': + $output->writeln(sprintf('# %s', $message)); $dumper = new YamlReferenceDumper(); break; case 'xml': + $output->writeln(sprintf('', $message)); $dumper = new XmlReferenceDumper(); break; default: + $output->writeln($message); throw new \InvalidArgumentException('Only the yaml and xml formats are supported.'); } diff --git a/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php b/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php index d5c63a6169..d9c8423235 100644 --- a/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php +++ b/src/Symfony/Component/Config/Definition/Dumper/XmlReferenceDumper.php @@ -44,7 +44,7 @@ class XmlReferenceDumper /** * @param NodeInterface $node * @param integer $depth - * @param boolean $root If the node is the root node + * @param Boolean $root If the node is the root node * @param string $namespace The namespace of the node */ private function writeNode(NodeInterface $node, $depth = 0, $root = false, $namespace = null)