Skip to content
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

Spoofchecker::setChecks generates a confusing error #9254

Closed
stof opened this issue Feb 9, 2023 · 1 comment · Fixed by #9256
Closed

Spoofchecker::setChecks generates a confusing error #9254

stof opened this issue Feb 9, 2023 · 1 comment · Fixed by #9256
Labels
bug easy problems Issues that can be fixed without background knowledge of Psalm internal stubs/callmap

Comments

@stof
Copy link
Contributor

stof commented Feb 9, 2023

https://psalm.dev/r/87ed292445

This code snippet shows an error saying Argument 1 of Spoofchecker::setChecks expects long, but int provided. However, the method accepts an int as parameter according to https://www.php.net/manual/en/spoofchecker.setchecks.php and https://github.com/php/php-src/blob/0f706745b770e312bb44205c7cd89fa372d7d562/ext/intl/spoofchecker/spoofchecker.stub.php#L94

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/87ed292445
<?php

function takesAnInt(int $i): void {
    $s = new Spoofchecker();
    $s->setChecks($i);
}
Psalm output (using commit 9c6dfb8):

ERROR: InvalidArgument - 5:19 - Argument 1 of Spoofchecker::setChecks expects long, but int provided

@weirdan weirdan added bug easy problems Issues that can be fixed without background knowledge of Psalm internal stubs/callmap Help wanted labels Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug easy problems Issues that can be fixed without background knowledge of Psalm internal stubs/callmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants