From 87e0bbcf89205988d458e0f5f2da4b957087bb6a Mon Sep 17 00:00:00 2001 From: Rudolph Gottesheim Date: Thu, 28 Sep 2023 10:22:31 +0200 Subject: [PATCH] Allow passing `stringable-object`s to sprintf() in all PHP versions --- stubs/CoreGenericFunctions.phpstub | 2 +- stubs/Php80.phpstub | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/stubs/CoreGenericFunctions.phpstub b/stubs/CoreGenericFunctions.phpstub index 89b18d0a444..793150fbdfa 100644 --- a/stubs/CoreGenericFunctions.phpstub +++ b/stubs/CoreGenericFunctions.phpstub @@ -1292,7 +1292,7 @@ function preg_quote(string $str, ?string $delimiter = null) : string {} /** * @psalm-pure * - * @param string|int|float $values + * @param string|stringable-object|int|float $values * @return (PHP_MAJOR_VERSION is 8 ? string : string|false) * @psalm-ignore-falsable-return * diff --git a/stubs/Php80.phpstub b/stubs/Php80.phpstub index 9a70506d912..2f2d5bf0b9b 100644 --- a/stubs/Php80.phpstub +++ b/stubs/Php80.phpstub @@ -247,17 +247,6 @@ function get_headers(string $url, bool $associative = false, $context = null) : */ function pack(string $format, mixed ...$values): string {} -/** - * @psalm-pure - * - * @param string|Stringable|int|float $values - * @return (PHP_MAJOR_VERSION is 8 ? string : string|false) - * @psalm-ignore-falsable-return - * - * @psalm-flow ($format, $values) -> return - */ -function sprintf(string $format, ...$values) {} - final class CurlHandle { private function __construct()