Skip to content

Commit b032d82

Browse files
authored
Merge pull request #245 from staabm/patch-1
Added null check to fix tests from pull request #224.
2 parents ce4e30e + 323eae3 commit b032d82

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Statement.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,11 @@ public function parse(Parser $parser, TokensList $list)
403403
$this->after($parser, $list, $token);
404404

405405
// #223 Here may make a patch, if last is delimiter, back one
406-
if ((new $class()) instanceof FunctionCall) {
407-
if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
408-
--$list->idx;
406+
if ($class !== null) {
407+
if ((new $class()) instanceof FunctionCall) {
408+
if ($list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER) {
409+
--$list->idx;
410+
}
409411
}
410412
}
411413
}

0 commit comments

Comments
 (0)