Skip to content

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
Development

Successfully merging this pull request may close these issues.

2 participants