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 6eaaf28

Browse filesBrowse files
committed
[FrameworkBundle][WebServerBundle] Use SymfonyStyle::getErrorStyle() in commands
1 parent d94da86 commit 6eaaf28
Copy full SHA for 6eaaf28

14 files changed

+16
-26
lines changed

‎src/Symfony/Bridge/Twig/Command/LintCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bridge/Twig/Command/LintCommand.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\InputInterface;
1717
use Symfony\Component\Console\Input\InputOption;
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\Finder\Finder;
2221

@@ -89,8 +88,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
8988
$io = new SymfonyStyle($input, $output);
9089

9190
if (null === $twig = $this->getTwigEnvironment()) {
92-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
93-
$errorIo->error('The Twig environment needs to be set.');
91+
$io->getErrorStyle()->error('The Twig environment needs to be set.');
9492

9593
return 1;
9694
}

‎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
/**
@@ -71,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7170
$io = new SymfonyStyle($input, $output);
7271

7372
if (null === $name = $input->getArgument('name')) {
74-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
73+
$errorIo = $io->getErrorStyle();
7574
$this->listBundles($errorIo);
7675
$errorIo->comment('Provide the name of a bundle as the first argument of this command to dump its default configuration. (e.g. <comment>config:dump-reference FrameworkBundle</comment>)');
7776

‎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;
@@ -94,7 +93,7 @@ protected function configure()
9493
protected function execute(InputInterface $input, OutputInterface $output)
9594
{
9695
$io = new SymfonyStyle($input, $output);
97-
$errorIo = $output instanceof ConsoleOutputInterface ? new SymfonyStyle($input, $output->getErrorOutput()) : $io;
96+
$errorIo = $io->getErrorStyle();
9897

9998
$this->validateInput($input);
10099
$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) {

‎src/Symfony/Bundle/FrameworkBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"require-dev": {
3535
"symfony/asset": "~2.8|~3.0",
3636
"symfony/browser-kit": "~2.8|~3.0",
37-
"symfony/console": "~2.8.8|~3.0.8|~3.1.2|~3.2",
37+
"symfony/console": "~3.3",
3838
"symfony/css-selector": "~2.8|~3.0",
3939
"symfony/dom-crawler": "~2.8|~3.0",
4040
"symfony/polyfill-intl-icu": "~1.0",

‎src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Command/UserPasswordEncoderCommand.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\Input\InputOption;
18-
use Symfony\Component\Console\Output\ConsoleOutputInterface;
1918
use Symfony\Component\Console\Output\OutputInterface;
2019
use Symfony\Component\Console\Question\Question;
2120
use Symfony\Component\Console\Style\SymfonyStyle;
@@ -86,7 +85,7 @@ protected function configure()
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
$input->isInteractive() ? $errorIo->title('Symfony Password Encoder Utility') : $errorIo->newLine();
9291

‎src/Symfony/Bundle/SecurityBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/composer.json
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"require-dev": {
2626
"symfony/asset": "~2.8|~3.0",
2727
"symfony/browser-kit": "~2.8|~3.0",
28-
"symfony/console": "~2.8|~3.0",
28+
"symfony/console": "~3.3",
2929
"symfony/css-selector": "~2.8|~3.0",
3030
"symfony/dom-crawler": "~2.8|~3.0",
3131
"symfony/form": "~2.8|~3.0",
@@ -44,7 +44,8 @@
4444
"twig/twig": "~1.28|~2.0"
4545
},
4646
"suggest": {
47-
"symfony/security-acl": "For using the ACL functionality of this bundle"
47+
"symfony/security-acl": "For using the ACL functionality of this bundle",
48+
"symfony/console": "For using the console commands"
4849
},
4950
"autoload": {
5051
"psr-4": { "Symfony\\Bundle\\SecurityBundle\\": "" },

‎src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function configure()
6868
*/
6969
protected function execute(InputInterface $input, OutputInterface $output)
7070
{
71-
$io = new SymfonyStyle($input, $output);
71+
$io = (new SymfonyStyle($input, $output))->getErrorStyle();
7272

7373
if (null === $documentRoot = $input->getOption('docroot')) {
7474
$documentRoot = $this->getContainer()->getParameter('kernel.root_dir').'/../web';

‎src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function configure()
6868
*/
6969
protected function execute(InputInterface $input, OutputInterface $output)
7070
{
71-
$io = new SymfonyStyle($input, $cliOutput = $output);
71+
$io = (new SymfonyStyle($input, $cliOutput = $output))->getErrorStyle();
7272

7373
if (!extension_loaded('pcntl')) {
7474
$io->error(array(

‎src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ protected function configure()
5353
*/
5454
protected function execute(InputInterface $input, OutputInterface $output)
5555
{
56-
$io = new SymfonyStyle($input, $output);
56+
$io = (new SymfonyStyle($input, $output))->getErrorStyle();
5757

5858
try {
5959
$server = new WebServer();

‎src/Symfony/Bundle/WebServerBundle/composer.json

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/WebServerBundle/composer.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"require": {
1919
"php": ">=5.5.9",
20-
"symfony/console": "~2.8.8|~3.0.8|~3.1.2|~3.2",
20+
"symfony/console": "~3.3",
2121
"symfony/process": "~2.8|~3.0"
2222
},
2323
"autoload": {

0 commit comments

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