Skip to content

Commit dd1a312

Browse files
authored
Merge pull request #63 from thecodingmachine/1.3
Porting alias fix (PHP 7.4 compatiblity) to 1.4 branch
2 parents 3574121 + b63c50f commit dd1a312

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,10 @@ jobs:
4242
- *composerupdate
4343
script:
4444
- *phpunit
45+
- stage: test
46+
php: 7.4
47+
env: PREFER_LOWEST=""
48+
before_script:
49+
- *composerupdate
50+
script:
51+
- *phpunit

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)