From aae0e5a2d83291b61f0d3cb29756d1483b3ebe24 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 23 Nov 2026 12:35:56 +0100 Subject: [PATCH 1/2] ci: add ClickHouse 26.8 to the PHPUnit matrix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7efc5de..94c06c1b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,6 +73,7 @@ jobs: - "25.3" - "25.8" - "26.3" + - "26.8" dependency-versions: - "highest" env: From bd0060ee4ae49798d33baf1b6bd24e56ebbf4c98 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 23 Nov 2026 12:39:53 +0100 Subject: [PATCH 2/2] fix(params): bind ClickHouse MultiPoint values --- src/Param/ParamValueConverterRegistry.php | 17 ++++++++--------- tests/Param/ParamValueConverterRegistryTest.php | 6 ++++++ 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Param/ParamValueConverterRegistry.php b/src/Param/ParamValueConverterRegistry.php index 9496c740..c574b2a5 100644 --- a/src/Param/ParamValueConverterRegistry.php +++ b/src/Param/ParamValueConverterRegistry.php @@ -65,7 +65,7 @@ public function __construct(array $registry = []) return sprintf('(%s)', implode(',', $point)); }; // phpcs:ignore SlevomatCodingStandard.Functions.RequireArrowFunction.RequiredArrowFunction - $formatRingOrLineString = static function (array $v) use ($formatPoint) { + $formatPoints = static function (array $v) use ($formatPoint) { /** @phpstan-var array> $v */ return sprintf('[%s]', implode( ',', @@ -73,14 +73,16 @@ public function __construct(array $registry = []) )); }; // phpcs:ignore SlevomatCodingStandard.Functions.RequireArrowFunction.RequiredArrowFunction - $formatPolygonOrMultiLineString = static function (array $v) use ($formatRingOrLineString) { + $formatPolygonOrMultiLineString = static function (array $v) use ($formatPoints) { /** @phpstan-var array> $v */ return sprintf('[%s]', implode( ',', - array_map($formatRingOrLineString, $v), + array_map($formatPoints, $v), )); }; + $convertPoints = static fn (string|array $v) => is_string($v) ? $v : $formatPoints($v); + /** @phpstan-var ConverterRegistry $defaultRegistry */ $defaultRegistry = [ 'String' => self::stringConverter(), @@ -194,12 +196,9 @@ public function __construct(array $registry = []) 'Point' => static fn (string|array $v) => is_string($v) ? $v : $formatPoint($v), - 'Ring' => static fn (string|array $v) => is_string($v) - ? $v - : $formatRingOrLineString($v), - 'LineString' => static fn (string|array $v) => is_string($v) - ? $v - : $formatRingOrLineString($v), + 'MultiPoint' => $convertPoints, + 'Ring' => $convertPoints, + 'LineString' => $convertPoints, 'MultiLineString' => static fn (string|array $v) => is_string($v) ? $v : $formatPolygonOrMultiLineString($v), diff --git a/tests/Param/ParamValueConverterRegistryTest.php b/tests/Param/ParamValueConverterRegistryTest.php index ff2ed6bc..aad152c7 100644 --- a/tests/Param/ParamValueConverterRegistryTest.php +++ b/tests/Param/ParamValueConverterRegistryTest.php @@ -35,6 +35,7 @@ final class ParamValueConverterRegistryTest extends TestCaseBase private const int VersionIntervalJson = 2301; private const int VersionLineString = 2408; + private const int VersionMultiPoint = 2608; private const int VersionVariant = 2403; /** @var array */ @@ -291,6 +292,11 @@ public static function providerConvert(): Generator yield 'Point' => ['Point', '(1,2)', '(1,2)']; yield 'Point (array)' => ['Point', [1, 2], '(1,2)']; + + if (ClickHouseVersion::get() >= self::VersionMultiPoint) { + yield 'MultiPoint (array)' => ['MultiPoint', [[1.5, -2], [3, 4]], '[(1.5,-2),(3,4)]']; + } + yield 'Ring' => ['Ring', '[(1,2),(3,4)]', '[(1,2),(3,4)]']; yield 'Ring (array)' => ['Ring', [[1, 2], [3, 4]], '[(1,2),(3,4)]'];