Skip to content

Commit be2f4da

Browse files
committed
Stop instanciating an object to check its class name.
1 parent b00f1c2 commit be2f4da

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Statement.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,11 @@ public function parse(Parser $parser, TokensList $list)
407407
$this->after($parser, $list, $token);
408408

409409
// #223 Here may make a patch, if last is delimiter, back one
410-
if ($class !== null) {
411-
if ((new $class()) instanceof FunctionCall) {
412-
if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
413-
--$list->idx;
414-
}
415-
}
410+
// TODO: when not supporting PHP 5.3 anymore, replace this by FunctionCall::class.
411+
if ($class === 'PhpMyAdmin\\SqlParser\\Components\\FunctionCall'
412+
&& $list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER
413+
) {
414+
--$list->idx;
416415
}
417416
}
418417

0 commit comments

Comments
 (0)