Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 201bb4a

Browse filesBrowse files
committed
[FrameworkBundle] Use getErrorStyle() when relevant
1 parent 2bf68f6 commit 201bb4a
Copy full SHA for 201bb4a

6 files changed

+6
-14
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use Symfony\Component\Console\Input\InputArgument;
1616
use Symfony\Component\Console\Input\InputInterface;
1717
use Symfony\Component\Console\Output\OutputInterface;
18-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1918
use Symfony\Component\Console\Style\SymfonyStyle;
2019
use Symfony\Component\Console\Exception\LogicException;
2120
use Symfony\Component\Yaml\Yaml;
@@ -63,7 +62,7 @@ protected function configure()
6362
protected function execute(InputInterface $input, OutputInterface $output)
6463
{
6564
$io = new SymfonyStyle($input, $output);
66-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
65+
$errorIo = $io->getErrorStyle();
6766

6867
if (null === $name = $input->getArgument('name')) {
6968
$this->listBundles($errorIo);

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ConfigDumpReferenceCommand.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\Console\Input\InputOption;
1818
use Symfony\Component\Console\Input\InputInterface;
1919
use Symfony\Component\Console\Output\OutputInterface;
20-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
2120
use Symfony\Component\Console\Style\SymfonyStyle;
2221

2322
/**
@@ -74,7 +73,7 @@ protected function configure()
7473
protected function execute(InputInterface $input, OutputInterface $output)
7574
{
7675
$io = new SymfonyStyle($input, $output);
77-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
76+
$errorIo = $io->getErrorStyle();
7877

7978
if (null === $name = $input->getArgument('name')) {
8079
$this->listBundles($errorIo);

‎src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\Console\Input\InputOption;
1717
use Symfony\Component\Console\Input\InputInterface;
1818
use Symfony\Component\Console\Output\OutputInterface;
19-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
2019
use Symfony\Component\Console\Style\SymfonyStyle;
2120
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
2221
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -95,7 +94,7 @@ protected function configure()
9594
protected function execute(InputInterface $input, OutputInterface $output)
9695
{
9796
$io = new SymfonyStyle($input, $output);
98-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
97+
$errorIo = $io->getErrorStyle();
9998

10099
$this->validateInput($input);
101100
$object = $this->getContainerBuilder();

‎src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/EventDispatcherDebugCommand.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Symfony\Component\Console\Input\InputOption;
1717
use Symfony\Component\Console\Input\InputInterface;
1818
use Symfony\Component\Console\Output\OutputInterface;
19-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
2019
use Symfony\Component\Console\Style\SymfonyStyle;
2120
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
2221

@@ -66,8 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6665
$options = array();
6766
if ($event = $input->getArgument('event')) {
6867
if (!$dispatcher->hasListeners($event)) {
69-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
70-
$errorIo->warning(sprintf('The event "%s" does not have any registered listeners.', $event));
68+
$io->getErrorStyle()->warning(sprintf('The event "%s" does not have any registered listeners.', $event));
7169

7270
return;
7371
}

‎src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/TranslationDebugCommand.php
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

1414
use Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader;
15-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1615
use Symfony\Component\Console\Style\SymfonyStyle;
1716
use Symfony\Component\Console\Input\InputInterface;
1817
use Symfony\Component\Console\Input\InputArgument;
@@ -160,8 +159,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
160159
$outputMessage .= sprintf(' and domain "%s"', $domain);
161160
}
162161

163-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
164-
$errorIo->warning($outputMessage);
162+
$io->getErrorStyle()->warning($outputMessage);
165163

166164
return;
167165
}

‎src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Command;
1313

14-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1514
use Symfony\Component\Console\Style\SymfonyStyle;
1615
use Symfony\Component\Translation\Catalogue\TargetOperation;
1716
use Symfony\Component\Translation\Catalogue\MergeOperation;
@@ -86,7 +85,7 @@ public function isEnabled()
8685
protected function execute(InputInterface $input, OutputInterface $output)
8786
{
8887
$io = new SymfonyStyle($input, $output);
89-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
88+
$errorIo = $io->getErrorStyle();
9089

9190
// check presence of force or dump-message
9291
if ($input->getOption('force') !== true && $input->getOption('dump-messages') !== true) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.