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
Comparing count() to integer literal and integer range variables should cause a non-empty assertion.
count()
https://psalm.dev/r/ad7cd85058 https://psalm.dev/r/cd657ad3a6 https://psalm.dev/r/e706d0612e
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php $c = 1; /** @var list<int> */ $arr = [1]; assert(count($arr) === $c); /** @psalm-check-type-exact $arr = non-empty-list<int> */;
Psalm output (using commit 8b7bc07): ERROR: CheckType - 7:58 - Checked variable $arr = non-empty-list<int> does not match $arr = list<int>
<?php /** @var int<1, max> */ $c = 1; /** @var list<int> */ $arr = [1]; assert(count($arr) === $c); /** @psalm-check-type-exact $arr = non-empty-list<int> */;
Psalm output (using commit 8b7bc07): ERROR: CheckType - 8:58 - Checked variable $arr = non-empty-list<int> does not match $arr = list<int>
<?php /** @var int<0, max> */ $c = 1; /** @var list<int> */ $arr = [1]; assert(count($arr) === $c); /** @psalm-check-type-exact $arr = list<int> */;
Psalm output (using commit 8b7bc07): No issues!
Sorry, something went wrong.
No branches or pull requests
Comparing
count()
to integer literal and integer range variables should cause a non-empty assertion.https://psalm.dev/r/ad7cd85058
https://psalm.dev/r/cd657ad3a6
https://psalm.dev/r/e706d0612e
The text was updated successfully, but these errors were encountered: