-
Notifications
You must be signed in to change notification settings - Fork 145
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
Add notFalse
#164
Add notFalse
#164
Conversation
Not sure why the test is failing, it appears that it installs |
Proof that it works: https://psalm.dev/r/dfa38a60dc |
pslam uses this library internally, however that is not an issue as it doesn't use that for its static analysis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but it does need tests.
A lot of PHP functions return a value or false in case of error. Therefore, `notFalse` makes it easier to assert that no error occured. This also makes Psalm/PHPStan happy.
@BackEndTea Thanks for reviewing. Added the tests. |
@BackEndTea What do you think? Is shippable? Or do you want me to make adjustments? Thanks. |
I'll take a look at this within the week |
Thank you for the work on this @ruudk |
Thanks for merging. Do you think this can be tagged? |
@BackEndTea As this feature is extremely useful in cases where PHPStan complains about something (from php) returning |
A lot of PHP functions return a value or false in case of error. Therefore,
notFalse
makes it easier to assert that no error occured. This also makes Psalm/PHPStan happy.