From ae3d1ece1a6b806b4b28f33e53f296d53c9d2f9d Mon Sep 17 00:00:00 2001 From: dmason30 Date: Thu, 2 Sep 2021 15:55:36 +0100 Subject: [PATCH 1/9] Fix current binding count when previous binding is false --- src/CacheKey.php | 5 +- .../Integration/CachedBuilder/BooleanTest.php | 61 ++++++++++++++++++- 2 files changed, 64 insertions(+), 2 deletions(-) diff --git a/src/CacheKey.php b/src/CacheKey.php index c4b985f2..dd5acc71 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -174,7 +174,10 @@ protected function getValuesFromWhere(array $where) : string protected function getValuesFromBindings(array $where, string $values) : string { - if (($this->query->bindings["where"][$this->currentBinding] ?? false) !== false) { + // Fallback to this when the current binding does not exist in the bindings array + $bindingFallback = __CLASS__ . ':UNKNOWN_BINDING'; + + if (($this->query->bindings["where"][$this->currentBinding] ?? $bindingFallback) !== $bindingFallback) { $values = $this->query->bindings["where"][$this->currentBinding]; $this->currentBinding++; diff --git a/tests/Integration/CachedBuilder/BooleanTest.php b/tests/Integration/CachedBuilder/BooleanTest.php index f03188e7..93079fd4 100644 --- a/tests/Integration/CachedBuilder/BooleanTest.php +++ b/tests/Integration/CachedBuilder/BooleanTest.php @@ -1,12 +1,14 @@ testingSqlitePath}testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor-is_famous_=_1-authors.deleted_at_null"); $tags = [ @@ -29,4 +31,61 @@ public function testBooleanWhereCreatesCorrectCacheKey() $this->assertNotEmpty($cachedResults); $this->assertNotEmpty($liveResults); } + + public function testBooleanWhereFalseCreatesCorrectCacheKey() + { + $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:authors:genealabslaravelmodelcachingtestsfixturesauthor-is_famous_=_-authors.deleted_at_null"); + $tags = [ + "genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesauthor", + ]; + + $authors = (new Author) + ->where("is_famous", false) + ->get(); + $cachedResults = $this->cache() + ->tags($tags) + ->get($key)['value']; + $liveResults = (new UncachedAuthor) + ->where("is_famous", false) + ->get(); + + $this->assertEquals($liveResults->pluck("id"), $authors->pluck("id")); + $this->assertEquals($liveResults->pluck("id"), $cachedResults->pluck("id")); + $this->assertNotEmpty($authors); + $this->assertNotEmpty($cachedResults); + $this->assertNotEmpty($liveResults); + } + + public function testBooleanWhereHasRelationWithFalseConditionAndAdditionalParentRawCondition() + { + $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:books:genealabslaravelmodelcachingtestsfixturesbook-exists-and_books.author_id_=_authors.id-is_famous_=_-authors.deleted_at_null-_and_title_=_Mixed_Clause"); + $tags = [ + "genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesbook", + ]; + + $expectedAuthor = factory(Author::class)->create(['is_famous' => false]); + factory(Book::class)->create(['author_id' => $expectedAuthor->getKey(), 'title' => 'Mixed Clause']); + + $books = (new Book) + ->whereHas('author', function ($query) { + return $query->where('is_famous', false); + }) + ->whereRaw("title = ?", ['Mixed Clause']) // Test ensures this binding is included in the key + ->get(); + $cachedResults = $this->cache() + ->tags($tags) + ->get($key)['value']; + $liveResults = (new UncachedBook) + ->whereHas('author', function ($query) { + return $query->where('is_famous', false); + }) + ->whereRaw("title = ?", ['Mixed Clause']) + ->get(); + + $this->assertEquals($liveResults->pluck("id"), $books->pluck("id")); + $this->assertEquals($liveResults->pluck("id"), $cachedResults->pluck("id")); + $this->assertNotEmpty($books); + $this->assertNotEmpty($cachedResults); + $this->assertNotEmpty($liveResults); + } } From 6292bc930cd6fe507ef9a4c1b2d5437d41c83677 Mon Sep 17 00:00:00 2001 From: dmason30 Date: Wed, 26 Jan 2022 10:58:48 +0000 Subject: [PATCH 2/9] Use data_get to retrieve bindings --- src/CacheKey.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/CacheKey.php b/src/CacheKey.php index dd5acc71..2858031e 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -176,13 +176,14 @@ protected function getValuesFromBindings(array $where, string $values) : string { // Fallback to this when the current binding does not exist in the bindings array $bindingFallback = __CLASS__ . ':UNKNOWN_BINDING'; + $currentBinding = $this->getCurrentBinding('where') ?? $bindingFallback; - if (($this->query->bindings["where"][$this->currentBinding] ?? $bindingFallback) !== $bindingFallback) { - $values = $this->query->bindings["where"][$this->currentBinding]; + if ($currentBinding !== $bindingFallback) { + $values = $currentBinding; $this->currentBinding++; if ($where["type"] === "between") { - $values .= "_" . $this->query->bindings["where"][$this->currentBinding]; + $values .= "_" . $this->getCurrentBinding('where'); $this->currentBinding++; } } @@ -237,7 +238,7 @@ protected function getInAndNotInClauses(array $where) : string $type = strtolower($where["type"]); $subquery = $this->getValuesFromWhere($where); - $values = collect($this->query->bindings["where"][$this->currentBinding] ?? []); + $values = collect($this->getCurrentBinding('where') ?? []); if (Str::startsWith($subquery, $values->first())) { $this->currentBinding += count($where["values"]); @@ -298,7 +299,7 @@ protected function getRawClauses(array $where) : string while (count($queryParts) > 1) { $clause .= "_" . array_shift($queryParts); - $clause .= $this->query->bindings["where"][$this->currentBinding]; + $clause .= $this->getCurrentBinding('where'); $this->currentBinding++; } @@ -365,4 +366,10 @@ protected function getBindingsSlug() : string return Arr::query($this->model->query()->getBindings()); } + + + private function getCurrentBinding(string $type) + { + return data_get($this->query->bindings, "$type.$this->currentBinding"); + } } From eca0e62c1e202ce94802e1537da187980904dd72 Mon Sep 17 00:00:00 2001 From: dmason30 Date: Wed, 26 Jan 2022 11:34:59 +0000 Subject: [PATCH 3/9] fix test --- tests/Integration/CachedBuilder/PolymorphicOneToManyTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/CachedBuilder/PolymorphicOneToManyTest.php b/tests/Integration/CachedBuilder/PolymorphicOneToManyTest.php index 0a28cdb4..93725bd1 100644 --- a/tests/Integration/CachedBuilder/PolymorphicOneToManyTest.php +++ b/tests/Integration/CachedBuilder/PolymorphicOneToManyTest.php @@ -37,7 +37,7 @@ public function testEagerloadedRelationship() public function testLazyloadedRelationship() { - $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:comments:genealabslaravelmodelcachingtestsfixturescomment-comments.commentable_id_=_1-comments.commentable_id_notnull-comments.commentable_type_=_GeneaLabs\LaravelModelCaching\Tests\Fixtures\Post"); + $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:comments:genealabslaravelmodelcachingtestsfixturescomment-comments.commentable_type_=_GeneaLabs\LaravelModelCaching\Tests\Fixtures\Post-comments.commentable_id_=_1-comments.commentable_id_notnull"); $tags = [ "genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturescomment", ]; From 49d849d2874914d7870b201fe00fffa9d149031d Mon Sep 17 00:00:00 2001 From: dmason30 Date: Wed, 26 Jan 2022 11:41:09 +0000 Subject: [PATCH 4/9] fix test --- tests/Integration/CachedBuilder/PolymorphicOneToOneTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Integration/CachedBuilder/PolymorphicOneToOneTest.php b/tests/Integration/CachedBuilder/PolymorphicOneToOneTest.php index 5c9f25fe..92720586 100644 --- a/tests/Integration/CachedBuilder/PolymorphicOneToOneTest.php +++ b/tests/Integration/CachedBuilder/PolymorphicOneToOneTest.php @@ -37,7 +37,7 @@ public function testEagerloadedRelationship() public function testLazyloadedHasOneThrough() { - $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:images:genealabslaravelmodelcachingtestsfixturesimage-images.imagable_id_=_2-images.imagable_id_notnull-images.imagable_type_=_GeneaLabs\LaravelModelCaching\Tests\Fixtures\User-limit_1"); + $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:images:genealabslaravelmodelcachingtestsfixturesimage-images.imagable_type_=_GeneaLabs\LaravelModelCaching\Tests\Fixtures\User-images.imagable_id_=_2-images.imagable_id_notnull-limit_1"); $tags = [ "genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesimage", ]; From 1f8632020efbbf5506471d89e3d9d8920f430802 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Wed, 26 Jan 2022 05:17:01 -0700 Subject: [PATCH 5/9] Fixed ordering of methods and update binding resolution. --- src/CacheKey.php | 256 +++++++++++++++++++++++------------------------ 1 file changed, 127 insertions(+), 129 deletions(-) diff --git a/src/CacheKey.php b/src/CacheKey.php index 2858031e..a89bf32d 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -51,11 +51,66 @@ public function make( return $key; } + protected function getBindingsSlug() : string + { + if (! method_exists($this->model, 'query')) { + return ''; + } + + return Arr::query($this->model->query()->getBindings()); + } + + protected function getColumnClauses(array $where) : string + { + if ($where["type"] !== "Column") { + return ""; + } + + return "-{$where["boolean"]}_{$where["first"]}_{$where["operator"]}_{$where["second"]}"; + } + + protected function getCurrentBinding(string $type, string $bindingFallback): string + { + return data_get($this->query->bindings, "{$type}.{$this->currentBinding}", $bindingFallback); + } + protected function getIdColumn(string $idColumn) : string { return $idColumn ? "_{$idColumn}" : ""; } + protected function getInAndNotInClauses(array $where) : string + { + if (! in_array($where["type"], ["In", "NotIn", "InRaw"])) { + return ""; + } + + $type = strtolower($where["type"]); + $subquery = $this->getValuesFromWhere($where); + $values = collect($this->getCurrentBinding('where') ?? []); + + if (Str::startsWith($subquery, $values->first())) { + $this->currentBinding += count($where["values"]); + } + + if (! is_numeric($subquery) && ! is_numeric(str_replace("_", "", $subquery))) { + try { + $subquery = Uuid::fromBytes($subquery); + $values = $this->recursiveImplode([$subquery], "_"); + + return "-{$where["column"]}_{$type}{$values}"; + } catch (Exception $exception) { + // do nothing + } + } + + $subquery = preg_replace('/\?(?=(?:[^"]*"[^"]*")*[^"]*\Z)/m', "_??_", $subquery); + $subquery = collect(vsprintf(str_replace("_??_", "%s", $subquery), $values->toArray())); + $values = $this->recursiveImplode($subquery->toArray(), "_"); + + return "-{$where["column"]}_{$type}{$values}"; + } + protected function getLimitClause() : string { if (! property_exists($this->query, "limit") @@ -67,15 +122,18 @@ protected function getLimitClause() : string return "-limit_{$this->query->limit}"; } - protected function getTableSlug() : string + protected function getModelSlug() : string { - return (new Str)->slug($this->query->from) - . ":"; + return (new Str)->slug(get_class($this->model)); } - protected function getModelSlug() : string + protected function getNestedClauses(array $where) : string { - return (new Str)->slug(get_class($this->model)); + if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) { + return ""; + } + + return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres); } protected function getOffsetClause() : string @@ -110,6 +168,18 @@ protected function getOrderByClauses() : string ?: ""; } + protected function getOtherClauses(array $where) : string + { + if (in_array($where["type"], ["Exists", "Nested", "NotExists", "Column", "raw", "In", "NotIn", "InRaw"])) { + return ""; + } + + $value = $this->getTypeClause($where); + $value .= $this->getValuesClause($where); + + return "-{$where["column"]}_{$value}"; + } + protected function getQueryColumns(array $columns) : string { if (($columns === ["*"] @@ -129,6 +199,36 @@ protected function getQueryColumns(array $columns) : string return "_" . implode("_", $columns); } + protected function getRawClauses(array $where) : string + { + if (! in_array($where["type"], ["raw"])) { + return ""; + } + + $queryParts = explode("?", $where["sql"]); + $clause = "_{$where["boolean"]}"; + + while (count($queryParts) > 1) { + $clause .= "_" . array_shift($queryParts); + $clause .= $this->getCurrentBinding('where'); + $this->currentBinding++; + } + + $lastPart = array_shift($queryParts); + + if ($lastPart) { + $clause .= "_" . $lastPart; + } + + return "-" . str_replace(" ", "_", $clause); + } + + protected function getTableSlug() : string + { + return (new Str)->slug($this->query->from) + . ":"; + } + protected function getTypeClause($where) : string { $type = in_array($where["type"], ["InRaw", "In", "NotIn", "Null", "NotNull", "between", "NotInSub", "InSub", "JsonContains"]) @@ -174,9 +274,8 @@ protected function getValuesFromWhere(array $where) : string protected function getValuesFromBindings(array $where, string $values) : string { - // Fallback to this when the current binding does not exist in the bindings array $bindingFallback = __CLASS__ . ':UNKNOWN_BINDING'; - $currentBinding = $this->getCurrentBinding('where') ?? $bindingFallback; + $currentBinding = $this->getCurrentBinding('where', $bindingFallback); if ($currentBinding !== $bindingFallback) { $values = $currentBinding; @@ -211,57 +310,41 @@ protected function getWhereClauses(array $wheres = []) : string return $value; }); } - - protected function getNestedClauses(array $where) : string + + protected function getWheres(array $wheres) : Collection { - if (! in_array($where["type"], ["Exists", "Nested", "NotExists"])) { - return ""; - } - - return "-" . strtolower($where["type"]) . $this->getWhereClauses($where["query"]->wheres); - } + $wheres = collect($wheres); - protected function getColumnClauses(array $where) : string - { - if ($where["type"] !== "Column") { - return ""; + if ($wheres->isEmpty() + && property_exists($this->query, "wheres") + ) { + $wheres = collect($this->query->wheres); } - return "-{$where["boolean"]}_{$where["first"]}_{$where["operator"]}_{$where["second"]}"; + return $wheres; } - protected function getInAndNotInClauses(array $where) : string + protected function getWithModels() : string { - if (! in_array($where["type"], ["In", "NotIn", "InRaw"])) { - return ""; - } - - $type = strtolower($where["type"]); - $subquery = $this->getValuesFromWhere($where); - $values = collect($this->getCurrentBinding('where') ?? []); + $eagerLoads = collect($this->eagerLoad); - if (Str::startsWith($subquery, $values->first())) { - $this->currentBinding += count($where["values"]); + if ($eagerLoads->isEmpty()) { + return ""; } - if (! is_numeric($subquery) && ! is_numeric(str_replace("_", "", $subquery))) { - try { - $subquery = Uuid::fromBytes($subquery); - $values = $this->recursiveImplode([$subquery], "_"); - - return "-{$where["column"]}_{$type}{$values}"; - } catch (Exception $exception) { - // do nothing + return $eagerLoads->keys()->reduce(function ($carry, $related) { + if (! method_exists($this->model, $related)) { + return "{$carry}-{$related}"; } - } - $subquery = preg_replace('/\?(?=(?:[^"]*"[^"]*")*[^"]*\Z)/m', "_??_", $subquery); - $subquery = collect(vsprintf(str_replace("_??_", "%s", $subquery), $values->toArray())); - $values = $this->recursiveImplode($subquery->toArray(), "_"); + $relatedModel = $this->model->$related()->getRelated(); + $relatedConnection = $relatedModel->getConnection()->getName(); + $relatedDatabase = $relatedModel->getConnection()->getDatabaseName(); - return "-{$where["column"]}_{$type}{$values}"; + return "{$carry}-{$relatedConnection}:{$relatedDatabase}:{$related}"; + }); } - + protected function recursiveImplode(array $items, string $glue = ",") : string { $result = ""; @@ -287,89 +370,4 @@ protected function recursiveImplode(array $items, string $glue = ",") : string return $result; } - - protected function getRawClauses(array $where) : string - { - if (! in_array($where["type"], ["raw"])) { - return ""; - } - - $queryParts = explode("?", $where["sql"]); - $clause = "_{$where["boolean"]}"; - - while (count($queryParts) > 1) { - $clause .= "_" . array_shift($queryParts); - $clause .= $this->getCurrentBinding('where'); - $this->currentBinding++; - } - - $lastPart = array_shift($queryParts); - - if ($lastPart) { - $clause .= "_" . $lastPart; - } - - return "-" . str_replace(" ", "_", $clause); - } - - protected function getOtherClauses(array $where) : string - { - if (in_array($where["type"], ["Exists", "Nested", "NotExists", "Column", "raw", "In", "NotIn", "InRaw"])) { - return ""; - } - - $value = $this->getTypeClause($where); - $value .= $this->getValuesClause($where); - - return "-{$where["column"]}_{$value}"; - } - - protected function getWheres(array $wheres) : Collection - { - $wheres = collect($wheres); - - if ($wheres->isEmpty() - && property_exists($this->query, "wheres") - ) { - $wheres = collect($this->query->wheres); - } - - return $wheres; - } - - protected function getWithModels() : string - { - $eagerLoads = collect($this->eagerLoad); - - if ($eagerLoads->isEmpty()) { - return ""; - } - - return $eagerLoads->keys()->reduce(function ($carry, $related) { - if (! method_exists($this->model, $related)) { - return "{$carry}-{$related}"; - } - - $relatedModel = $this->model->$related()->getRelated(); - $relatedConnection = $relatedModel->getConnection()->getName(); - $relatedDatabase = $relatedModel->getConnection()->getDatabaseName(); - - return "{$carry}-{$relatedConnection}:{$relatedDatabase}:{$related}"; - }); - } - - protected function getBindingsSlug() : string - { - if (! method_exists($this->model, 'query')) { - return ''; - } - - return Arr::query($this->model->query()->getBindings()); - } - - - private function getCurrentBinding(string $type) - { - return data_get($this->query->bindings, "$type.$this->currentBinding"); - } } From ea09bba0a9febd1e97e0ad65bac041d1d46cb905 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Wed, 26 Jan 2022 05:21:33 -0700 Subject: [PATCH 6/9] Fix missing second parameter in other places. --- src/CacheKey.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CacheKey.php b/src/CacheKey.php index a89bf32d..45a06e68 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -87,7 +87,7 @@ protected function getInAndNotInClauses(array $where) : string $type = strtolower($where["type"]); $subquery = $this->getValuesFromWhere($where); - $values = collect($this->getCurrentBinding('where') ?? []); + $values = collect($this->getCurrentBinding('where', [])); if (Str::startsWith($subquery, $values->first())) { $this->currentBinding += count($where["values"]); @@ -210,7 +210,7 @@ protected function getRawClauses(array $where) : string while (count($queryParts) > 1) { $clause .= "_" . array_shift($queryParts); - $clause .= $this->getCurrentBinding('where'); + $clause .= $this->getCurrentBinding("where", ""); $this->currentBinding++; } @@ -275,14 +275,14 @@ protected function getValuesFromWhere(array $where) : string protected function getValuesFromBindings(array $where, string $values) : string { $bindingFallback = __CLASS__ . ':UNKNOWN_BINDING'; - $currentBinding = $this->getCurrentBinding('where', $bindingFallback); + $currentBinding = $this->getCurrentBinding("where", $bindingFallback); if ($currentBinding !== $bindingFallback) { $values = $currentBinding; $this->currentBinding++; if ($where["type"] === "between") { - $values .= "_" . $this->getCurrentBinding('where'); + $values .= "_" . $this->getCurrentBinding("where", ""); $this->currentBinding++; } } From 792d53c0ba22bbcc48797c31af5ad0f3bd56bcf1 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Wed, 26 Jan 2022 05:24:24 -0700 Subject: [PATCH 7/9] WIP --- src/CacheKey.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CacheKey.php b/src/CacheKey.php index 45a06e68..e360f6c1 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -87,7 +87,7 @@ protected function getInAndNotInClauses(array $where) : string $type = strtolower($where["type"]); $subquery = $this->getValuesFromWhere($where); - $values = collect($this->getCurrentBinding('where', [])); + $values = collect($this->getCurrentBinding('where', "")); if (Str::startsWith($subquery, $values->first())) { $this->currentBinding += count($where["values"]); From 1ea09742b8b07accfa7749c997f007d44ae2fbe8 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Wed, 26 Jan 2022 05:34:21 -0700 Subject: [PATCH 8/9] Fixed type hints. --- src/CacheKey.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CacheKey.php b/src/CacheKey.php index e360f6c1..4451b8a4 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -69,7 +69,7 @@ protected function getColumnClauses(array $where) : string return "-{$where["boolean"]}_{$where["first"]}_{$where["operator"]}_{$where["second"]}"; } - protected function getCurrentBinding(string $type, string $bindingFallback): string + protected function getCurrentBinding(string $type, mixed $bindingFallback = null): mixed { return data_get($this->query->bindings, "{$type}.{$this->currentBinding}", $bindingFallback); } @@ -87,7 +87,7 @@ protected function getInAndNotInClauses(array $where) : string $type = strtolower($where["type"]); $subquery = $this->getValuesFromWhere($where); - $values = collect($this->getCurrentBinding('where', "")); + $values = collect($this->getCurrentBinding('where', [])); if (Str::startsWith($subquery, $values->first())) { $this->currentBinding += count($where["values"]); @@ -210,7 +210,7 @@ protected function getRawClauses(array $where) : string while (count($queryParts) > 1) { $clause .= "_" . array_shift($queryParts); - $clause .= $this->getCurrentBinding("where", ""); + $clause .= $this->getCurrentBinding("where"); $this->currentBinding++; } @@ -282,7 +282,7 @@ protected function getValuesFromBindings(array $where, string $values) : string $this->currentBinding++; if ($where["type"] === "between") { - $values .= "_" . $this->getCurrentBinding("where", ""); + $values .= "_" . $this->getCurrentBinding("where"); $this->currentBinding++; } } From 66296ac1fb69cefa25ba514dfcf3750e7518f058 Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Wed, 26 Jan 2022 05:37:22 -0700 Subject: [PATCH 9/9] Removed type hinting because of older PHP versions. --- src/CacheKey.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CacheKey.php b/src/CacheKey.php index 4451b8a4..441d002e 100644 --- a/src/CacheKey.php +++ b/src/CacheKey.php @@ -69,7 +69,7 @@ protected function getColumnClauses(array $where) : string return "-{$where["boolean"]}_{$where["first"]}_{$where["operator"]}_{$where["second"]}"; } - protected function getCurrentBinding(string $type, mixed $bindingFallback = null): mixed + protected function getCurrentBinding(string $type, $bindingFallback = null) { return data_get($this->query->bindings, "{$type}.{$this->currentBinding}", $bindingFallback); }