From 4b556bdda73a8b0d7e3995e0b8dbc138a0d72897 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Mon, 23 Nov 2026 11:46:07 +0100 Subject: [PATCH] fix: declare JSONEachRow output rows covariant PHPStan 2.3.7 rejects a JSONEachRow format passed to selectWithParams because the output row type is invariant. The read-only output exposes rows but does not accept them, so make the row type covariant on the output and its interface. --- src/Output/JsonEachRow.php | 2 +- src/Output/Output.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Output/JsonEachRow.php b/src/Output/JsonEachRow.php index 1c1d20e9..f4c185af 100644 --- a/src/Output/JsonEachRow.php +++ b/src/Output/JsonEachRow.php @@ -19,7 +19,7 @@ use const JSON_THROW_ON_ERROR; /** - * @template T + * @template-covariant T * @implements Output */ final readonly class JsonEachRow implements Output diff --git a/src/Output/Output.php b/src/Output/Output.php index 9e0739c0..408371a5 100644 --- a/src/Output/Output.php +++ b/src/Output/Output.php @@ -4,7 +4,7 @@ namespace SimPod\ClickHouseClient\Output; -/** @template T */ +/** @template-covariant T */ interface Output { public function __construct(string $contents);