From ebdd16fb88c4040a5f5b70f4a1c5962f08941a08 Mon Sep 17 00:00:00 2001 From: NiavlysB Date: Wed, 10 Mar 2021 11:55:37 +0100 Subject: [PATCH 1/3] Provide a default prefix to `compile` called from `sqlStatement` in ActiveQuery The prefix property in ActiveQuery is a nullable string, but the `compile` method in CompilerInterface expects a string. We provide an empty string if the prefix property is null. --- src/Query/ActiveQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Query/ActiveQuery.php b/src/Query/ActiveQuery.php index ed0322c1..a3931ccd 100644 --- a/src/Query/ActiveQuery.php +++ b/src/Query/ActiveQuery.php @@ -105,7 +105,7 @@ public function sqlStatement(QueryParameters $parameters = null): string return $this->driver->getQueryCompiler()->compile( $parameters ?? new QueryParameters(), - $this->prefix, + $this->prefix ?? "", $this ); } From 77e96cd9917ff81cd8027005663f8aa4efef0d2f Mon Sep 17 00:00:00 2001 From: NiavlysB Date: Wed, 10 Mar 2021 12:14:49 +0100 Subject: [PATCH 2/3] Use single quotes for consistency --- src/Query/ActiveQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Query/ActiveQuery.php b/src/Query/ActiveQuery.php index a3931ccd..ced9ddc1 100644 --- a/src/Query/ActiveQuery.php +++ b/src/Query/ActiveQuery.php @@ -105,7 +105,7 @@ public function sqlStatement(QueryParameters $parameters = null): string return $this->driver->getQueryCompiler()->compile( $parameters ?? new QueryParameters(), - $this->prefix ?? "", + $this->prefix ?? '', $this ); } From 9f0a620b908534569529e0825b353062bc5d5a06 Mon Sep 17 00:00:00 2001 From: sylbru Date: Wed, 28 Jul 2021 19:41:01 +0200 Subject: [PATCH 3/3] Cosmetic change in order to be able to rerun CI checks --- src/Query/ActiveQuery.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Query/ActiveQuery.php b/src/Query/ActiveQuery.php index ced9ddc1..351b7e7d 100644 --- a/src/Query/ActiveQuery.php +++ b/src/Query/ActiveQuery.php @@ -103,7 +103,9 @@ public function sqlStatement(QueryParameters $parameters = null): string throw new BuilderException('Unable to build query without associated driver'); } - return $this->driver->getQueryCompiler()->compile( + $compiler = $this->driver->getQueryCompiler(); + + return $compiler->compile( $parameters ?? new QueryParameters(), $this->prefix ?? '', $this