Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Nov 26, 2023
1 parent e93b5c6 commit 1cccb5f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Command/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1cccb5f

Please sign in to comment.