-
Notifications
You must be signed in to change notification settings - Fork 671
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
SplFileInfo::getSize returns int instead of int|false #8642
Comments
I found these snippets: https://psalm.dev/r/bdaae2f851<?php declare(strict_types = 1);
class HelloWorld
{
public function __construct(private \SplFileObject $file) {}
public function sayHello(): ?int
{
$size = $this->file->getSize();
if ($size !== false) {
return $size;
}
// so some other things.
return null;
}
}
|
neclimdul
added a commit
to neclimdul/psalm
that referenced
this issue
Nov 1, 2022
Update SplFileInfo method signatures and related classes. Fixes vimeo#8642
neclimdul
added a commit
to neclimdul/psalm
that referenced
this issue
Nov 1, 2022
Update SplFileInfo method signatures and related classes. Fixes vimeo#8642
orklah
pushed a commit
to neclimdul/psalm
that referenced
this issue
Nov 4, 2022
Update SplFileInfo method signatures and related classes. Fixes vimeo#8642
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At least, I think there's something wrong with the stub for this method. The documentation says int or null on failure but trying to handle the failure condition results in a warning from psalm.
The text was updated successfully, but these errors were encountered: