Skip to content

Commit 56fa973

Browse files
committed
minor symfony#15980 Updated the styles of the config parameters (javiereguiluz)
This PR was squashed before being merged into the 2.8 branch (closes symfony#15980). Discussion ---------- Updated the styles of the config parameters | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR uses comment() which hasn't been merged yet. WIP PR at symfony#15964 **I have a question**: is it mandatory that the output of this command is a valid YAML or XML file? If not, we can keep the changes in the title of the command. Otherwise, I'll revert those changes. ![config_1](https://cloud.githubusercontent.com/assets/73419/10144197/9018a138-661c-11e5-8c9d-dc1b721533b8.png) ![config_2](https://cloud.githubusercontent.com/assets/73419/10144199/925e5604-661c-11e5-8597-8e01013c2e86.png) Commits ------- fdaa513 Updated the styles of the config parameters
2 parents bee1faa + fdaa513 commit 56fa973

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/AbstractConfigCommand.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Symfony\Component\Config\Definition\ConfigurationInterface;
1515
use Symfony\Component\Console\Helper\Table;
16-
use Symfony\Component\Console\Output\OutputInterface;
1716
use Symfony\Component\Console\Style\StyleInterface;
1817
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
1918

@@ -26,7 +25,7 @@
2625
*/
2726
abstract class AbstractConfigCommand extends ContainerDebugCommand
2827
{
29-
protected function listBundles(OutputInterface $output)
28+
protected function listBundles($output)
3029
{
3130
$headers = array('Bundle name', 'Extension alias');
3231
$rows = array();
@@ -35,12 +34,10 @@ protected function listBundles(OutputInterface $output)
3534
$rows[] = array($bundle->getName(), $extension ? $extension->getAlias() : '');
3635
}
3736

38-
$message = 'Available registered bundles with their extension alias if available:';
3937
if ($output instanceof StyleInterface) {
40-
$output->writeln(' '.$message);
4138
$output->table($headers, $rows);
4239
} else {
43-
$output->writeln($message);
40+
$output->writeln('Available registered bundles with their extension alias if available:');
4441
$table = new Table($output);
4542
$table->setHeaders($headers)->setRows($rows)->render($output);
4643
}

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
6666
$name = $input->getArgument('name');
6767

6868
if (empty($name)) {
69+
$output->comment('Provide the name of a bundle as the first argument of this command to dump its configuration.');
70+
$output->newLine();
6971
$this->listBundles($output);
7072

7173
return;
@@ -85,9 +87,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
8587
$config = $processor->processConfiguration($configuration, $configs);
8688

8789
if ($name === $extension->getAlias()) {
88-
$output->writeln(sprintf('# Current configuration for extension with alias: "%s"', $name));
90+
$output->title(sprintf('Current configuration for extension with alias "%s"', $name));
8991
} else {
90-
$output->writeln(sprintf('# Current configuration for "%s"', $name));
92+
$output->title(sprintf('Current configuration for "%s"', $name));
9193
}
9294

9395
$output->writeln(Yaml::dump(array($extension->getAlias() => $config), 3));

src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
7171
$name = $input->getArgument('name');
7272

7373
if (empty($name)) {
74+
$output->comment('Provide the name of a bundle as the first argument of this command to dump its default configuration.');
75+
$output->newLine();
7476
$this->listBundles($output);
7577

7678
return;

0 commit comments

Comments
 (0)