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 4214311

Browse filesBrowse files
committed
[bugfix] [Console] Set Input::$interactive to false when command is executed with --quiet as verbosity level
1 parent 2a9be06 commit 4214311
Copy full SHA for 4214311

File tree

Expand file treeCollapse file tree

2 files changed

+4
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-1
lines changed

‎src/Symfony/Component/Console/Application.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Application.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public function register($name)
337337
* Adds an array of command objects.
338338
*
339339
* If a Command is not enabled it will not be added.
340-
*
340+
*
341341
* @param Command[] $commands An array of commands
342342
*/
343343
public function addCommands(array $commands)
@@ -808,6 +808,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
808808

809809
if (true === $input->hasParameterOption(array('--quiet', '-q'))) {
810810
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
811+
$input->setInteractive(false);
811812
} else {
812813
if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || $input->getParameterOption('--verbose') === 3) {
813814
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);

‎src/Symfony/Component/Console/Tests/ApplicationTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/ApplicationTest.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,11 @@ public function testRun()
636636

637637
$tester->run(array('command' => 'list', '--quiet' => true));
638638
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
639+
$this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if --quiet is passed');
639640

640641
$tester->run(array('command' => 'list', '-q' => true));
641642
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
643+
$this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if -q is passed');
642644

643645
$tester->run(array('command' => 'list', '--verbose' => true));
644646
$this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');

0 commit comments

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