[Console] Avoided an unnecessary check.

It only makes sense to do the second check if the --no-interaction
option was not passed.

Running posix_isatty() raises a warning with some stream types (like MEMORY).
With this patch, warning could be avoided by passing the --no-interaction option.
This commit is contained in:
Jakub Zalas 2013-06-30 20:29:16 +02:00
parent b76a6fc72c
commit e46fd4e8fa
1 changed files with 1 additions and 3 deletions

View File

@ -859,9 +859,7 @@ class Application
if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) {
$input->setInteractive(false);
}
if (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) {
} elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) {
$inputStream = $this->getHelperSet()->get('dialog')->getInputStream();
if (!posix_isatty($inputStream)) {
$input->setInteractive(false);