From 24dfdbe663f07b46ae5d1a519fe88a23933726df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Ostroluck=C3=BD?= Date: Sat, 6 Jun 2020 14:36:42 +0200 Subject: [PATCH] Silence stream_isatty and posix_isatty It was actually silence before (and still is in 3.4), but we removed this later, thinking it's not needed anymore. Without this, user will get `XX bytes of buffered data lost during stream conversion` errors Simple reproducer: ```php (new Application()) ->register('app') ->setCode(function(InputInterface $input, OutputInterface $output) { (new QuestionHelper())->ask($input, $output, (new Question('Foo?'))->setValidator(function () { throw new InvalidArgumentException('Foo!'); })); }) ->getApplication() ->setDefaultCommand('app', true) ->run() ; ``` echo "foo\n" | php console-app.php --- src/Symfony/Component/Console/Helper/QuestionHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Console/Helper/QuestionHelper.php b/src/Symfony/Component/Console/Helper/QuestionHelper.php index 134f6231e52fe..2ee31822c56ef 100644 --- a/src/Symfony/Component/Console/Helper/QuestionHelper.php +++ b/src/Symfony/Component/Console/Helper/QuestionHelper.php @@ -512,11 +512,11 @@ private function isTty(): bool $inputStream = !$this->inputStream && \defined('STDIN') ? STDIN : $this->inputStream; if (\function_exists('stream_isatty')) { - return stream_isatty($inputStream); + return @stream_isatty($inputStream); } if (\function_exists('posix_isatty')) { - return posix_isatty($inputStream); + return @posix_isatty($inputStream); } return true; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy