From 3a420f4f7a1d59e4362123327883218d4d5ede1c Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Mon, 10 Oct 2022 17:06:00 +0200 Subject: [PATCH] phpunit bool|string --- .../Statements/Expression/Fetch/VariableFetchAnalyzer.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php index 86823148326..fb358a1a0be 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php @@ -646,8 +646,8 @@ public static function getGlobalType(string $var_id, int $codebase_analysis_php_ $request_time_float_helper = Type::getFloat(); $request_time_float_helper->possibly_undefined = true; - $bool_helper = Type::getBool(); - $bool_helper->possibly_undefined = true; + $bool_string_helper = new Union([new Bool(), new TString()]); + $bool_string_helper->possibly_undefined = true; $detailed_type = new TKeyedArray([ // https://www.php.net/manual/en/reserved.variables.server.php @@ -724,7 +724,7 @@ public static function getGlobalType(string $var_id, int $codebase_analysis_php_ 'HTTP_SEC_CH_UA_MOBILE' => $non_empty_string_helper, 'HTTP_SEC_CH_UA' => $non_empty_string_helper, // phpunit - 'APP_DEBUG' => $bool_helper, + 'APP_DEBUG' => $bool_string_helper, 'APP_ENV' => $string_helper, ]);