Skip to content

Commit 727f767

Browse files
committed
refactor(param-value-converter-registry): wider date converters input type and throw exception
1 parent cbbc2d7 commit 727f767

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Param/ParamValueConverterRegistry.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66

77
use Closure;
88
use DateTimeInterface;
9-
use DateTimeZone;
109
use Psr\Http\Message\StreamInterface;
1110
use SimPod\ClickHouseClient\Exception\UnsupportedParamType;
12-
use SimPod\ClickHouseClient\Sql\Escaper;
1311
use SimPod\ClickHouseClient\Exception\UnsupportedParamValue;
12+
use SimPod\ClickHouseClient\Sql\Escaper;
1413
use SimPod\ClickHouseClient\Sql\Type;
1514

1615
use function array_keys;
@@ -93,10 +92,10 @@ public function __construct(array $registry = [])
9392

9493
'bool' => static fn (bool $value) => $value,
9594

96-
'date' => self::dateConverter($this->clickHouseTimeZone),
97-
'date32' => self::dateConverter($this->clickHouseTimeZone),
98-
'datetime' => self::dateTimeConverter($this->clickHouseTimeZone),
99-
'datetime32' => self::dateTimeConverter($this->clickHouseTimeZone),
95+
'date' => self::dateConverter(),
96+
'date32' => self::dateConverter(),
97+
'datetime' => self::dateTimeConverter(),
98+
'datetime32' => self::dateTimeConverter(),
10099
'datetime64' => static fn (DateTimeInterface|string|int|float $value) => $value instanceof DateTimeInterface
101100
? $value->format('U.u')
102101
: $value,

0 commit comments

Comments
 (0)