mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Make http_response_header possibly undefined
This commit is contained in:
parent
69da58d578
commit
a077bd4351
@ -612,7 +612,12 @@ class VariableFetchAnalyzer
|
||||
}
|
||||
|
||||
if ($var_id === '$http_response_header') {
|
||||
return Type::getNonEmptyList(Type::getNonFalsyString());
|
||||
// $http_response_header exists only in the local scope after a successful network request
|
||||
return new Union([
|
||||
Type::getNonEmptyList(Type::getNonFalsyString())
|
||||
], [
|
||||
'possibly_undefined' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
if ($var_id === '$GLOBALS') {
|
||||
|
Loading…
Reference in New Issue
Block a user