Bug report
Empty string and generics union type parameter does not accept an empty string.
''|class-string union type parameter accepts empty-string, but not with ''|class-string<T> parameter.
Code snippet that reproduces the problem
/**
* @param ''|class-string<T> $p
* @template T of object
*/
function ng($p): void
{
}
ng('');
Parameter #1 $p of function ng expects class-string<>, string given.
https://phpstan.org/r/c4e8c2a7-59a6-4863-94e4-48b0a02b7af3
Expected output
No error.
Did PHPStan help you today? Did it make you happy in any way?
It always helps. Arigato!
Bug report
Empty string and generics union type parameter does not accept an empty string.
''|class-stringunion type parameter accepts empty-string, but not with''|class-string<T>parameter.Code snippet that reproduces the problem
Parameter #1 $p of function ng expects class-string<>, string given.
https://phpstan.org/r/c4e8c2a7-59a6-4863-94e4-48b0a02b7af3
Expected output
No error.
Did PHPStan help you today? Did it make you happy in any way?
It always helps. Arigato!