From e46fd4e8fa48f7b4adf358727755b280f7b32c5d Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Sun, 30 Jun 2013 20:29:16 +0200 Subject: [PATCH] [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. --- src/Symfony/Component/Console/Application.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index a3998a82e7..138248d87b 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -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);