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 many "Only booleans are allowed in an if condition" #5501
fix many "Only booleans are allowed in an if condition" #5501
Conversation
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
lib/Minz/ModelPdo.php
Outdated
$ex->getMessage(), | ||
$db['user'], Minz_Exception::ERROR | ||
); | ||
} |
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.
What happened here? This looks quite wrong
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.
if I don't do this phpstan returns an error because $ex is unknown at this point
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.
I have reverted without problem, as far as I can see. But the point was that the logic was broken with your changes.
I have fixed several regressions and other smaller details |
Let's not hurry making more changes of this type, especially because I believe that it leads to less readable and more error-prone code in many situations, for instance the calls to |
hello, the problem is polymorphism. it must be reduced as much as possible. a function must return only one type. See : if a native php function is polymorphic (for historical reasons), the best thing to do is to create a method that encapsulates and returns only what is necessary. |
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
`preg_grep` returns an empty array if the username matches no elements from the usernames array. Regression introduced in 7f9594b Reference: FreshRSS#5501
Changes proposed in this pull request:
Pull request checklist: