From 0e871a8e2eb9afc514aad59aed21431a930fad78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 13 Dec 2019 13:46:55 +0100 Subject: [PATCH 1/2] Fixing alias issue (PHP 7.4 compatibility) This makes the code compatible with PHP 7.4 --- src/SQLParser/Node/NodeFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SQLParser/Node/NodeFactory.php b/src/SQLParser/Node/NodeFactory.php index 545ce9d..05e99b6 100644 --- a/src/SQLParser/Node/NodeFactory.php +++ b/src/SQLParser/Node/NodeFactory.php @@ -183,7 +183,7 @@ public static function toObject(array $desc) } $expr->setJoinType($joinType); - if (isset($desc['alias'])) { + if (isset($desc['alias']['name'])) { $expr->setAlias($desc['alias']['name']); } $subTreeNodes = self::buildFromSubtree($desc['ref_clause']); @@ -366,7 +366,7 @@ public static function toObject(array $desc) $expr->setSubTree(self::buildFromSubtree($desc['sub_tree'])); } - if (isset($desc['alias'])) { + if (isset($desc['alias']['name'])) { $expr->setAlias($desc['alias']['name']); } if (isset($desc['direction'])) { From 375c14a0d7f9b2e811280891fa0f03eafa9cd989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Fri, 13 Dec 2019 13:48:36 +0100 Subject: [PATCH 2/2] Adding PHP 7.4 tests --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index facd522..fcdf5c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,3 +42,10 @@ jobs: - *composerupdate script: - *phpunit + - stage: test + php: 7.4 + env: PREFER_LOWEST="" + before_script: + - *composerupdate + script: + - *phpunit