Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,11 @@ public function parse(Parser $parser, TokensList $list)
$this->after($parser, $list, $token);

// #223 Here may make a patch, if last is delimiter, back one
if ((new $class()) instanceof FunctionCall) {
if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
--$list->idx;
if ($class !== null) {
if ((new $class()) instanceof FunctionCall) {
Copy link
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
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?

Copy link
Contributor Author

@staabm staabm May 7, 2019

Choose a reason for hiding this comment

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

sure, Please go ahead

if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
--$list->idx;
}
}
}
}
Expand Down