From 81c458bc932f25288e40b1f4baeeb4c763c4deec 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 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stubs/CoreGenericFunctions.phpstub b/stubs/CoreGenericFunctions.phpstub index 793150fbdfa..29bc367d568 100644 --- a/stubs/CoreGenericFunctions.phpstub +++ b/stubs/CoreGenericFunctions.phpstub @@ -1797,3 +1797,8 @@ 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) +*/ +function get_browser(?string $user_agent = null, bool $return_array = false): object|array|false {}