Skip to content

Commit 0e871a8

Browse files
committed
Fixing alias issue (PHP 7.4 compatibility)
This makes the code compatible with PHP 7.4
1 parent 44ba318 commit 0e871a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/SQLParser/Node/NodeFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public static function toObject(array $desc)
183183
}
184184
$expr->setJoinType($joinType);
185185

186-
if (isset($desc['alias'])) {
186+
if (isset($desc['alias']['name'])) {
187187
$expr->setAlias($desc['alias']['name']);
188188
}
189189
$subTreeNodes = self::buildFromSubtree($desc['ref_clause']);
@@ -366,7 +366,7 @@ public static function toObject(array $desc)
366366
$expr->setSubTree(self::buildFromSubtree($desc['sub_tree']));
367367
}
368368

369-
if (isset($desc['alias'])) {
369+
if (isset($desc['alias']['name'])) {
370370
$expr->setAlias($desc['alias']['name']);
371371
}
372372
if (isset($desc['direction'])) {

0 commit comments

Comments
 (0)