WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 24d10eb

Browse files
author
Josh Ralph
committed
Updated expressionToString methods to handle all types rather than explicitly strings or Expressions
1 parent 4c1e91b commit 24d10eb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/CacheKey.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,12 @@ private function processEnums(array $values): array
469469
return array_map(fn($value) => $this->processEnum($value), $values);
470470
}
471471

472-
private function expressionToString(Expression|string $value): string
472+
private function expressionToString($value)
473473
{
474-
if (is_string($value)) {
474+
if (! $value instanceof Expression) {
475475
return $value;
476476
}
477477

478-
return $value->getValue($this->query->getConnection()->getQueryGrammar());
478+
return $this->query->getGrammar()->getValue($value);
479479
}
480480
}

src/Traits/Buildable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,12 @@ function () use ($arguments, $cacheKey, $method) {
340340
);
341341
}
342342

343-
private function expressionToString(Expression|string $value): string
343+
private function expressionToString($value)
344344
{
345-
if (is_string($value)) {
345+
if (! $value instanceof Expression) {
346346
return $value;
347347
}
348348

349-
return $value->getValue($this->query->getGrammar());
349+
return $this->query->getGrammar()->getValue($value);
350350
}
351351
}

0 commit comments

Comments
 (0)