-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 phpstan errors #3801
Fix phpstan errors #3801
Conversation
All phpstan errors fixed now! @morozov, waiting for your feedback on assertions, in particular. |
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.
@BenMorel I reviewed this partially. Please see my recommendations on using assertions and see if the rest of the assertions follow them.
@@ -176,6 +176,7 @@ protected function fixRow($row, bool $iterateRow, bool $fixCase) | |||
} | |||
|
|||
if ($fixCase) { | |||
assert($this->case !== null); |
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.
Here we could use the same approach as with private methods above, however, this one is protected. We should see what prevents this class from being finalized (#3590).
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 should we do here then? There are only 4 assert()
left in this PR; do you want to find a solution to get rid of each of them individually, or is it OK if they stay?
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.
Let's leave those assertions for now. Please rebase and squash.
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.
Rebased & squashed!
@BenMorel once this is done, could you please also take a look at Lines 35 to 36 in f9b3e79
If the |
I'll try to have a look tomorrow! |
Thanks @BenMorel. Great work 👍 |
Summary
A method declared with a
string
return type attempts to returnnull
. This is not caught by tests as this method is never called becauseSqlitePlatform
does not support exceptions.This now throws a
LogicException
instead, as this is not expected to be executed.Update
Following the discussion below, this now fixes many more phpstan errors.