-
-
Notifications
You must be signed in to change notification settings - Fork 110
Fix PHP warnings when building an incomplete CASE expression #241
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 PHP warnings when building an incomplete CASE expression #241
Conversation
Issue can be reproduced with the following code snippet:
```php
new \PhpMyAdmin\SqlParser\Parser('SELECT a CASE');
// PHP Warning: count(): Parameter must be an array or an object that implements Countable in src/Components/CaseExpression.php on line 296
// PHP Warning: count(): Parameter must be an array or an object that implements Countable in src/Components/CaseExpression.php on line 297
```
Codecov Report
@@ Coverage Diff @@
## master #241 +/- ##
=========================================
Coverage 99.63% 99.63%
Complexity 1849 1849
=========================================
Files 61 61
Lines 4118 4118
=========================================
Hits 4103 4103
Misses 15 15 |
devenbansod
left a comment
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.
LGTM 👍
williamdes
left a comment
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.
LGTM 💯
|
I'm a little unsure about this because it doesn't seem to have fixed anything with the command line interface: |
|
The PHP warnings have been fixed. Without this contribution: With this contribution: This change is very similar to other fixes like the one done in 2b3fb2e |
|
Yes, this makes sense now. Good job. I was initially testing with PHP 7.1 which does not give the warning, but with PHP 7.3 I see the same results you do. Merging this, thanks for your contribution. |
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
Issue can be reproduced with the following code snippet: