We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For the following code with generics,
<?php declare(strict_types = 1); /** * @template TKey * @template TValue */ class Collection { ... } /** * @param Collection<int, string|null> $collection */ function testFunc(Collection $collection): void { } $collection = new Collection([0 => 'foo', 1 => 'bar', 2 => null, 3 => 'baz']);
PHPStan reports the following inconsistent errors.
Parameter #1 $collection of function testFunc expects Collection<int, string|null>, Collection<int, string|null> given.
From my few attempts, this seems to happen when...
https://phpstan.org/r/6cb19ed5-8774-4178-a21b-a7e19d1934f9
No errors.
Yes, really helpful for finding bugs. Thank you so much! 😸
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug report
For the following code with generics,
PHPStan reports the following inconsistent errors.
From my few attempts, this seems to happen when...
Code snippet that reproduces the problem
https://phpstan.org/r/6cb19ed5-8774-4178-a21b-a7e19d1934f9
Expected output
No errors.
Did PHPStan help you today? Did it make you happy in any way?
Yes, really helpful for finding bugs. Thank you so much! 😸
The text was updated successfully, but these errors were encountered: