From 8f0a7383b952d77f8e15064a4b1ec310a3355d51 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 28 May 2026 17:01:47 +0000 Subject: [PATCH] Type catch-all HookLoader extras as `` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `array{...}` was an awkward stand-in for the widest input tuple type. Since `HookLoader`'s template params are covariant, the catch-all entry in the loaders shape can just use `mixed` for both — semantically the widest possible, and any concrete `HookLoader` still fits. --- src/Generator/DataClassGenerator.php | 2 +- tests/HooksBatched/Generated/Query/Test/Data.php | 2 +- tests/HooksBatched/Generated/Query/Test/Data/Organization.php | 2 +- .../Generated/Query/Test/Data/Organization/Repository.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Generator/DataClassGenerator.php b/src/Generator/DataClassGenerator.php index c850769..0cfca79 100644 --- a/src/Generator/DataClassGenerator.php +++ b/src/Generator/DataClassGenerator.php @@ -183,7 +183,7 @@ private function dumpLoadersShape(array $batchedHooks, array $plansByFqcn, CodeG // which holds every batched hook in the operation, not just the subset a // single nested class consumes. Extras are typed wide; HookLoader's // covariant template params let any specific instantiation fit here. - $entries[] = sprintf('...>', $hookLoader); + $entries[] = sprintf('...>', $hookLoader); return sprintf("array{\n %s,\n}", implode(",\n ", $entries)); } diff --git a/tests/HooksBatched/Generated/Query/Test/Data.php b/tests/HooksBatched/Generated/Query/Test/Data.php index a3db2a5..9d42387 100644 --- a/tests/HooksBatched/Generated/Query/Test/Data.php +++ b/tests/HooksBatched/Generated/Query/Test/Data.php @@ -34,7 +34,7 @@ final class Data * findOrgPlan: HookLoader, * computeAccess: HookLoader, * findUserById: HookLoader, - * ...>, + * ...>, * } */ private readonly array $loaders; diff --git a/tests/HooksBatched/Generated/Query/Test/Data/Organization.php b/tests/HooksBatched/Generated/Query/Test/Data/Organization.php index 662cf2f..aae02fa 100644 --- a/tests/HooksBatched/Generated/Query/Test/Data/Organization.php +++ b/tests/HooksBatched/Generated/Query/Test/Data/Organization.php @@ -50,7 +50,7 @@ final class Organization * findOrgPlan: HookLoader, * computeAccess: HookLoader, * findUserById: HookLoader, - * ...>, + * ...>, * } $loaders */ public function __construct( diff --git a/tests/HooksBatched/Generated/Query/Test/Data/Organization/Repository.php b/tests/HooksBatched/Generated/Query/Test/Data/Organization/Repository.php index 1e898bf..efc889a 100644 --- a/tests/HooksBatched/Generated/Query/Test/Data/Organization/Repository.php +++ b/tests/HooksBatched/Generated/Query/Test/Data/Organization/Repository.php @@ -47,7 +47,7 @@ final class Repository * @param array{ * computeAccess: HookLoader, * findUserById: HookLoader, - * ...>, + * ...>, * } $loaders */ public function __construct(