Skip to content

Commit

Permalink
Merge #290 - stop instanciating an object to check its class name.
Browse files Browse the repository at this point in the history
Pull-request: #290

Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Feb 9, 2020
2 parents b00f1c2 + be2f4da commit 4accf0b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/Statement.php
Expand Up @@ -407,12 +407,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 ($class !== null) {
if ((new $class()) instanceof FunctionCall) {
if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
--$list->idx;
}
}
// TODO: when not supporting PHP 5.3 anymore, replace this by FunctionCall::class.
if ($class === 'PhpMyAdmin\\SqlParser\\Components\\FunctionCall'
&& $list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER
) {
--$list->idx;
}
}

Expand Down

0 comments on commit 4accf0b

Please sign in to comment.