镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Added null check - #245

Merged
ibennetch merged 1 commit into
phpmyadmin:masterfrom
staabm:patch-1
May 9, 2019
Merged

ibennetch merged 1 commit into
phpmyadmin:masterfrom
staabm:patch-1

Conversation

@staabm

@staabm staabm commented May 7, 2019 •

Copy link
Copy Markdown
Contributor

a shot in the dark to fix:

Error: Class name must be a valid object or a string

#224 (comment)

Comment thread src/Statement.php
if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
--$list->idx;
if ($class !== null) {
if ((new $class()) instanceof FunctionCall) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this could be simplified using is_a() so we would not need to create a object just to check for its class

https://php.net/is_a

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@staabm I think I'll merge this now to fix the current errors, and if you have time and a desire to modify the code to use is_a() instead, that would be a big benefit. Since we can implement the is_a() method in more places than just this one, I think it makes more sense to merge this and then make modifications. Sound good?

@staabm staabm May 7, 2019 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, Please go ahead

@staabm

staabm commented May 7, 2019

Copy link
Copy Markdown
Contributor Author

//cc @ibennetch

@ibennetch

Copy link
Copy Markdown
Member

That sure looks like it fixes it! I'll let the whole Travis suite finish running first, but this works correctly on my local system. Nice work.

@codecov

codecov Bot commented May 7, 2019

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@59af899). Click here to learn what that means.
The diff coverage is 100%.

@@            Coverage Diff            @@
##             master     #245   +/-   ##
=========================================
  Coverage          ?   99.58%           
  Complexity        ?     1854           
=========================================
  Files             ?       62           
  Lines             ?     4127           
  Branches          ?        0           
=========================================
  Hits              ?     4110           
  Misses            ?       17           
  Partials          ?        0

@devenbansod devenbansod left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@ibennetch
ibennetch merged commit b032d82 into phpmyadmin:master May 9, 2019
@staabm
staabm deleted the patch-1 branch May 9, 2019 07:54
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.

5 participants