From 3dc53a44e2cb0415ad79df0d4a1d7e02716ef298 Mon Sep 17 00:00:00 2001 From: James Gilliland Date: Thu, 23 Sep 2021 10:00:15 -0500 Subject: [PATCH] Silence isatty warnings during tty detection --- src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php | 4 ++-- src/Symfony/Component/Console/Helper/QuestionHelper.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php index bff2db7d87257..00fb4bc8a2433 100644 --- a/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php +++ b/src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php @@ -396,11 +396,11 @@ private static function hasColorSupport() } if (\function_exists('stream_isatty')) { - return stream_isatty(\STDOUT); + return @stream_isatty(\STDOUT); } if (\function_exists('posix_isatty')) { - return posix_isatty(\STDOUT); + return @posix_isatty(\STDOUT); } $stat = fstat(\STDOUT); diff --git a/src/Symfony/Component/Console/Helper/QuestionHelper.php b/src/Symfony/Component/Console/Helper/QuestionHelper.php index 0516545bc9bc7..a4754b82458f9 100644 --- a/src/Symfony/Component/Console/Helper/QuestionHelper.php +++ b/src/Symfony/Component/Console/Helper/QuestionHelper.php @@ -485,11 +485,11 @@ private function isInteractiveInput($inputStream): bool } if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = stream_isatty(fopen('php://stdin', 'r')); + return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); } if (\function_exists('posix_isatty')) { - return self::$stdinIsInteractive = posix_isatty(fopen('php://stdin', 'r')); + return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r')); } if (!\function_exists('exec')) {