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
SplFileInfo::getSize can return int|false,
SplFileInfo::getSize
see https://www.php.net/manual/zh/splfileinfo.getsize.php
The filesize in bytes on success, or false on failure.
$file = new \SplFileInfo('./README.md'); $bytes = $file->getSize(); if (false === $bytes) { throw new \RuntimeException('Unable to get file size.'); }
Strict comparison using === between false and int will always evaluate to false.
The text was updated successfully, but these errors were encountered:
Please send a PR that updates https://github.com/phpstan/phpstan-src/blob/master/resources/functionMap.php. Thanks.
Sorry, something went wrong.
Fixed by phpstan/phpstan-src#1034
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
Bug report
SplFileInfo::getSize
can return int|false,see https://www.php.net/manual/zh/splfileinfo.getsize.php
Code snippet that reproduces the problem
Expected output
The text was updated successfully, but these errors were encountered: