From 6f32c723f52547dbfb42ffd9d89e704189c080d8 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Tue, 24 Oct 2023 15:03:39 +0200 Subject: [PATCH] Narrow down `get_browser` returning array or object based on `$return_array` param --- stubs/CoreGenericFunctions.phpstub | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stubs/CoreGenericFunctions.phpstub b/stubs/CoreGenericFunctions.phpstub index 793150fbdfa..e793b13d22b 100644 --- a/stubs/CoreGenericFunctions.phpstub +++ b/stubs/CoreGenericFunctions.phpstub @@ -1797,3 +1797,9 @@ if (defined('GLOB_BRACE')) { * @psalm-taint-sink shell $command */ function exec(string $command, &$output = null, int &$result_code = null): string|false {} + +/** +* @return ($return_array is true ? array|false : object|false) +* @psalm-ignore-falsable-return +*/ +function get_browser(?string $user_agent = null, bool $return_array = false): object|array|false {}