From e72ff4aba4a7956310394768dc98a9e40c7aed7c Mon Sep 17 00:00:00 2001 From: Alexander Kim Date: Thu, 15 May 2025 10:20:40 -0400 Subject: [PATCH 1/3] fix: 7119 parameter array shape uses invalid syntax Closes #7119 --- src/Metadata/Parameter.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Metadata/Parameter.php b/src/Metadata/Parameter.php index 1acef3d8bce..ab7017359f8 100644 --- a/src/Metadata/Parameter.php +++ b/src/Metadata/Parameter.php @@ -23,12 +23,12 @@ abstract class Parameter { /** - * @param (array&array{type?: string, default?: string})|null $schema - * @param array $extraProperties - * @param ParameterProviderInterface|callable|string|null $provider - * @param list $properties a list of properties this parameter applies to (works with the :property placeholder) - * @param FilterInterface|string|null $filter - * @param mixed $constraints an array of Symfony constraints, or an array of Laravel rules + * @param array{type?: string, default?: string, ...array}|null $schema + * @param array $extraProperties + * @param ParameterProviderInterface|callable|string|null $provider + * @param list $properties a list of properties this parameter applies to (works with the :property placeholder) + * @param FilterInterface|string|null $filter + * @param mixed $constraints an array of Symfony constraints, or an array of Laravel rules */ public function __construct( protected ?string $key = null, From 0da010d8dd3b3b547651d793bd9608f8afceb96b Mon Sep 17 00:00:00 2001 From: Alexander Kim Date: Mon, 18 Aug 2025 18:27:02 -0400 Subject: [PATCH 2/3] fix: remove extraneous array --- src/Metadata/Parameter.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Metadata/Parameter.php b/src/Metadata/Parameter.php index d51467b72e6..6a7b465693c 100644 --- a/src/Metadata/Parameter.php +++ b/src/Metadata/Parameter.php @@ -24,15 +24,15 @@ abstract class Parameter { /** - * @param array{type?: string, default?: string, ...array}|null $schema - * @param array $extraProperties - * @param ParameterProviderInterface|callable|string|null $provider - * @param list $properties a list of properties this parameter applies to (works with the :property placeholder) - * @param FilterInterface|string|null $filter - * @param mixed $constraints an array of Symfony constraints, or an array of Laravel rules - * @param Type $nativeType the PHP native type, we cast values to an array if its a CollectionType, if not and it's an array with a single value we use it (eg: HTTP Header) - * @param ?bool $castToNativeType whether API Platform should cast your parameter to the nativeType declared - * @param ?callable(mixed): mixed $castFn the closure used to cast your parameter, this gets called only when $castToNativeType is set + * @param array{type?: string, default?: string, ...}|null $schema + * @param array $extraProperties + * @param ParameterProviderInterface|callable|string|null $provider + * @param list $properties a list of properties this parameter applies to (works with the :property placeholder) + * @param FilterInterface|string|null $filter + * @param mixed $constraints an array of Symfony constraints, or an array of Laravel rules + * @param Type $nativeType the PHP native type, we cast values to an array if its a CollectionType, if not and it's an array with a single value we use it (eg: HTTP Header) + * @param ?bool $castToNativeType whether API Platform should cast your parameter to the nativeType declared + * @param ?callable(mixed): mixed $castFn the closure used to cast your parameter, this gets called only when $castToNativeType is set */ public function __construct( protected ?string $key = null, From 9ae494956ac444eebe56942ef0b321b58a0b3212 Mon Sep 17 00:00:00 2001 From: Alexander Kim Date: Mon, 18 Aug 2025 22:38:40 -0400 Subject: [PATCH 3/3] fix: other lines Doing this on the phone sucks :( --- src/Metadata/Parameter.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Metadata/Parameter.php b/src/Metadata/Parameter.php index 6a7b465693c..3999298129f 100644 --- a/src/Metadata/Parameter.php +++ b/src/Metadata/Parameter.php @@ -64,7 +64,7 @@ public function getKey(): ?string } /** - * @return array{type?: string, default?: string, ...array}|null $schema + * @return array{type?: string, default?: string, ...}|null $schema */ public function getSchema(): ?array { @@ -180,7 +180,7 @@ public function withPriority(int $priority): static } /** - * @param array{type?: string, default?: string, ...array}|null $schema + * @param array{type?: string, default?: string, ...}|null $schema */ public function withSchema(array $schema): static {