From b5f6da72850cf87a9432143e12db38c094fabd2b Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:31:35 +0200 Subject: [PATCH] add common phpunit $_SERVER values bool Fix https://github.com/vimeo/psalm/issues/8556 --- .../Statements/Expression/Fetch/VariableFetchAnalyzer.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php index 303caa17c..4a1058919 100644 --- a/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/VariableFetchAnalyzer.php @@ -645,6 +645,9 @@ class VariableFetchAnalyzer $request_time_float_helper = Type::getFloat(); $request_time_float_helper->possibly_undefined = true; + $bool_helper = Type::getBool(); + $bool_helper->possibly_undefined = true; + $detailed_type = new TKeyedArray([ // https://www.php.net/manual/en/reserved.variables.server.php 'PHP_SELF' => $non_empty_string_helper, @@ -719,6 +722,9 @@ class VariableFetchAnalyzer 'HTTP_SEC_CH_UA_PLATFORM' => $non_empty_string_helper, 'HTTP_SEC_CH_UA_MOBILE' => $non_empty_string_helper, 'HTTP_SEC_CH_UA' => $non_empty_string_helper, + // phpunit + 'APP_DEBUG' => $bool_helper, + 'APP_ENV' => $string_helper, ]); // generic case for all other elements