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

Fix: Fixed error return signature for \SplFileInfo #1034

Merged
merged 2 commits into from Feb 24, 2022

Conversation

siganushka
Copy link
Contributor

@siganushka siganushka commented Feb 23, 2022

Fixed error return signature for \SplFileInfo

issues: #6680

see: https://www.php.net/manual/zh/splfileinfo.getsize.php

@@ -11251,24 +11251,24 @@
'SplEnum::getConstList' => ['array', 'include_default='=>'bool'],
'SplFileInfo::__construct' => ['void', 'file_name'=>'string'],
'SplFileInfo::__toString' => ['string'],
'SplFileInfo::getATime' => ['int'],
'SplFileInfo::getATime' => ['int|false'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you wrap these in __benevolent<...>? Like this? __benevolent<int|false>

Because when SplFileInfo comes from a class like Symfony Finder, we can be sure those file exist, so having to check against false would be too annoying.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tired.

@ondrejmirtes ondrejmirtes merged commit 667ebb8 into phpstan:master Feb 24, 2022
@ondrejmirtes
Copy link
Member

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants