From d1a42f6c690910397333b6769dde425b10499a09 Mon Sep 17 00:00:00 2001 From: lhchavez Date: Tue, 1 Sep 2020 06:21:32 -0700 Subject: [PATCH] Add `null` as a possible type parameter to `strval` (#4100) https://www.php.net/manual/en/language.types.string.php#language.types.string.casting mentions > `NULL` is always converted to an empty string. Which seems to indicate that it is a valid argument for it. As opposed to stringifying other types (like arrays), `strval(null)` does not cause a warning in PHP. --- src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub b/src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub index 594cc6af0..adbc118c7 100644 --- a/src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub +++ b/src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub @@ -680,7 +680,7 @@ function bcdiv(string $left_operand, string $right_operand, int $scale = 0): ?st /** * @psalm-pure * - * @param scalar|object $var + * @param scalar|null|object $var * @return string The string value of var. * * @psalm-flow ($var) -> return