New issue
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
0 + 1 positive-int ArgumentTypeCoercion #4081
Labels
Comments
I found these snippets: https://psalm.dev/r/f1f013e2b5<?php
$tick = 0;
test($tick + 1);
test(0 + 1);
/**
* @psalm-param positive-int $tickedTimes
*/
function test(int $tickedTimes): void
{
}
|
Do you have a real-world example? |
|
I found these snippets: https://psalm.dev/r/93ac6549b2<?php
$i = 0;
for ($j = 0; $j < random_int(0, 100); $j++) {
// do smth that needs a zero-based index $i
++$i;
}
notifyHowManyOperationsItTook($i + 1);
/**
* @psalm-param positive-int $times
*/
function notifyHowManyOperationsItTook(int $times): void
{
}
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/f1f013e2b5
The text was updated successfully, but these errors were encountered: