From 324b160f98434560a09ad6c2d21fc557cc3a55c9 Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Mon, 24 Apr 2023 11:47:29 -0700 Subject: [PATCH] trim(): Argument #1 () must be of type string, bool given --- src/Symfony/Component/Console/Terminal.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Terminal.php b/src/Symfony/Component/Console/Terminal.php index 24cef534052f1..04653d3bd2bbc 100644 --- a/src/Symfony/Component/Console/Terminal.php +++ b/src/Symfony/Component/Console/Terminal.php @@ -77,7 +77,8 @@ public static function hasSttyAvailable(): bool private static function initDimensions() { if ('\\' === \DIRECTORY_SEPARATOR) { - if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) { + $ansicon = getenv('ANSICON'); + if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { // extract [w, H] from "wxh (WxH)" // or [w, h] from "wxh" self::$width = (int) $matches[1];