From 1cccb5faafc6cfc32b40486d0b24f5c373ea3e99 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sun, 26 Nov 2023 19:51:33 +0700 Subject: [PATCH] Improve --- src/Command/AbstractCommand.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Command/AbstractCommand.php b/src/Command/AbstractCommand.php index b5dc9d3d7..b64803bea 100644 --- a/src/Command/AbstractCommand.php +++ b/src/Command/AbstractCommand.php @@ -21,6 +21,7 @@ use function is_scalar; use function is_string; use function preg_replace_callback; +use function str_starts_with; use function stream_get_contents; /** @@ -349,14 +350,13 @@ public function getRawSql(): string $value = $param->getValue(); - if ($value instanceof Expression) { - $params[$name] = (string)$value; - continue; - } - $params[$name] = match ($param->getType()) { DataType::INTEGER => (string)$value, - DataType::STRING, DataType::LOB => is_resource($value) ? $name : $quoter->quoteValue((string)$value), + DataType::STRING, DataType::LOB => match (true) { + $value instanceof Expression => (string)$value, + is_resource($value) => $name, + default => $quoter->quoteValue((string)$value), + }, DataType::BOOLEAN => $value ? 'TRUE' : 'FALSE', DataType::NULL => 'NULL', default => $name,