Skip to content

Commit 17f38cb

Browse files
authored
feat: remove support for deprecated Object type (#274)
1 parent 83f60d6 commit 17f38cb

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/Param/ParamValueConverterRegistry.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ final class ParamValueConverterRegistry
4141
'decimal128',
4242
'decimal256',
4343
'enum',
44-
'object',
4544
'json',
4645
];
4746

@@ -104,7 +103,6 @@ public function __construct()
104103
'Enum64' => self::noopConverter(),
105104

106105
'json' => static fn (array|string $value) => is_string($value) ? $value : json_encode($value),
107-
'object' => fn (mixed $v, Type $type) => $this->get(trim($type->params, "'"))($v, $type, true),
108106
'Map' => self::noopConverter(),
109107
'Nested' => function (array|string $v, Type $type) {
110108
if (is_string($v)) {

tests/Param/ParamValueConverterRegistryTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class ParamValueConverterRegistryTest extends TestCaseBase
3030
{
3131
use WithClient;
3232

33-
private const VersionIntervalJsonObject = 2211;
33+
private const VersionIntervalJson = 2301;
3434

3535
/** @var array<string> */
3636
private static array $types = [];
@@ -72,6 +72,7 @@ public function testAllTypesAreCovered(): void
7272
'AggregateFunction',
7373
'SimpleAggregateFunction',
7474
'Nothing',
75+
'Object',
7576
];
7677

7778
$registry = new ParamValueConverterRegistry();
@@ -127,11 +128,9 @@ public static function providerConvert(): Generator
127128
"((1,'k'),1,2)",
128129
];
129130

130-
if (ClickHouseVersion::get() >= self::VersionIntervalJsonObject) {
131+
if (ClickHouseVersion::get() >= self::VersionIntervalJson) {
131132
yield 'JSON' => ['JSON', '{"k":"v"}', '{"k":"v"}'];
132133
yield 'JSON (array)' => ['JSON', ['k' => 'v'], '{"k":"v"}'];
133-
yield 'Object' => ["Object('JSON')", '{"k":"v"}', '{"k":"v"}'];
134-
yield 'Object (array)' => ["Object('JSON')", ['k' => 'v'], '{"k":"v"}'];
135134
}
136135

137136
yield 'Map' => ['Map(String, UInt64)', "{'k1':1}", "{'k1':1}"];
@@ -219,7 +218,7 @@ public static function providerConvert(): Generator
219218
yield 'Decimal256' => ['Decimal256(2)', 3.33, '3.33'];
220219
}
221220

222-
if (ClickHouseVersion::get() >= self::VersionIntervalJsonObject) {
221+
if (ClickHouseVersion::get() >= self::VersionIntervalJson) {
223222
yield 'IntervalNanosecond' => ['IntervalNanosecond', 1, '1'];
224223
yield 'IntervalMicrosecond' => ['IntervalMicrosecond', 1, '1'];
225224
yield 'IntervalMillisecond' => ['IntervalMillisecond', 1, '1'];

0 commit comments

Comments
 (0)