From 2671ea78da07cf0295bcb2f782c6bbf777c513d9 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 15 Jul 2021 20:15:08 +0200 Subject: [PATCH 1/2] Detailed return type for `strtoupper` --- stubs/CoreGenericFunctions.phpstub | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stubs/CoreGenericFunctions.phpstub b/stubs/CoreGenericFunctions.phpstub index 9d5f9cf6509..f79ce293507 100644 --- a/stubs/CoreGenericFunctions.phpstub +++ b/stubs/CoreGenericFunctions.phpstub @@ -515,6 +515,10 @@ function strtolower(string $str) : string {} /** * @psalm-pure * + * @return ( + * $str is non-empty-string ? non-empty-string : string + * ) + * * @psalm-flow ($str) -> return */ function strtoupper(string $str) : string {} From e037c4496a6dec6ede74388bdb8f7d71e486fd83 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 15 Jul 2021 20:40:18 +0200 Subject: [PATCH 2/2] Utilize non-falsy-string --- stubs/CoreGenericFunctions.phpstub | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stubs/CoreGenericFunctions.phpstub b/stubs/CoreGenericFunctions.phpstub index f79ce293507..cfe609872df 100644 --- a/stubs/CoreGenericFunctions.phpstub +++ b/stubs/CoreGenericFunctions.phpstub @@ -516,7 +516,9 @@ function strtolower(string $str) : string {} * @psalm-pure * * @return ( - * $str is non-empty-string ? non-empty-string : string + * $str is non-falsy-string + * ? non-falsy-string + * : ($str is non-empty-string ? non-empty-string : string) * ) * * @psalm-flow ($str) -> return