1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00

add common phpunit $_SERVER values bool

Fix https://github.com/vimeo/psalm/issues/8556
This commit is contained in:
kkmuffme 2022-10-10 14:31:35 +02:00
parent b424de92d2
commit b5f6da7285

View File

@ -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