From d87d817169349a1e6cf3c8c1aca118f10828ba83 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Thu, 20 Sep 2018 13:11:31 +0200 Subject: [PATCH 1/2] PHP 7.2 deprecation fixes --- .../implementations/query_select_sqlite.php | 8 ++++---- tests/sqlabstraction/query_subselect_test.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sqlabstraction/implementations/query_select_sqlite.php b/src/sqlabstraction/implementations/query_select_sqlite.php index de6b0fb..2e54a2e 100644 --- a/src/sqlabstraction/implementations/query_select_sqlite.php +++ b/src/sqlabstraction/implementations/query_select_sqlite.php @@ -171,13 +171,13 @@ private function buildRightJoins() $reversedConditions = array_reverse( $rJoinPart['conditions'] ); // adding first table. - list( $key, $val ) = each( $reversedTables ); + $val = current( $reversedTables ); $oneItemResult .= $val; - while ( list( $key, $nextCondition ) = each( $reversedConditions ) ) + foreach( $reversedConditions as $key => $nextCondition ) { - list( $key2, $nextTable ) = each( $reversedTables ); - $oneItemResult .= " LEFT JOIN {$nextTable} ON {$nextCondition}"; + $nextTable = next( $reversedTables ); + $oneItemResult .= " LEFT JOIN {$nextTable} ON {$nextCondition}"; } $resultArray[] = $oneItemResult; } diff --git a/tests/sqlabstraction/query_subselect_test.php b/tests/sqlabstraction/query_subselect_test.php index 79eec5b..e2e4a66 100644 --- a/tests/sqlabstraction/query_subselect_test.php +++ b/tests/sqlabstraction/query_subselect_test.php @@ -92,7 +92,7 @@ protected function setUp() $this->e = $this->q->expr; } - public function testSubSelect() + public function __construct() { $reference = '( SELECT column FROM table WHERE id = 1 )'; $q2 = $this->q->subSelect(); From eb0bb6a02d53dc85ae55f6e9d8a31abcff081388 Mon Sep 17 00:00:00 2001 From: Patrizio Bekerle Date: Fri, 21 Sep 2018 09:06:14 +0200 Subject: [PATCH 2/2] reverted a change and added a space character --- src/sqlabstraction/implementations/query_select_sqlite.php | 2 +- tests/sqlabstraction/query_subselect_test.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sqlabstraction/implementations/query_select_sqlite.php b/src/sqlabstraction/implementations/query_select_sqlite.php index 2e54a2e..c3809ab 100644 --- a/src/sqlabstraction/implementations/query_select_sqlite.php +++ b/src/sqlabstraction/implementations/query_select_sqlite.php @@ -174,7 +174,7 @@ private function buildRightJoins() $val = current( $reversedTables ); $oneItemResult .= $val; - foreach( $reversedConditions as $key => $nextCondition ) + foreach ( $reversedConditions as $key => $nextCondition ) { $nextTable = next( $reversedTables ); $oneItemResult .= " LEFT JOIN {$nextTable} ON {$nextCondition}"; diff --git a/tests/sqlabstraction/query_subselect_test.php b/tests/sqlabstraction/query_subselect_test.php index e2e4a66..79eec5b 100644 --- a/tests/sqlabstraction/query_subselect_test.php +++ b/tests/sqlabstraction/query_subselect_test.php @@ -92,7 +92,7 @@ protected function setUp() $this->e = $this->q->expr; } - public function __construct() + public function testSubSelect() { $reference = '( SELECT column FROM table WHERE id = 1 )'; $q2 = $this->q->subSelect();