Skip to content

fix: 7119 parameter array shape uses invalid syntax #7151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/Metadata/Parameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
abstract class Parameter
{
/**
* @param (array<string, mixed>&array{type?: string, default?: string})|null $schema
* @param array<string, mixed> $extraProperties
* @param ParameterProviderInterface|callable|string|null $provider
* @param list<string> $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, ...array<string, mixed>}|null $schema
* @param array<string, mixed> $extraProperties
* @param ParameterProviderInterface|callable|string|null $provider
* @param list<string> $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(

Check failure on line 37 in src/Metadata/Parameter.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.4)

PHPDoc tag @param has invalid value (array{type?: string, default?: string, ...array<string, mixed>}|null $schema): Unexpected token "array", expected '}' at offset 60
protected ?string $key = null,
protected ?array $schema = null,
protected OpenApiParameter|array|false|null $openApi = null,
Expand Down Expand Up @@ -64,9 +64,9 @@
}

/**
* @return (array<string, mixed>&array{type?: string, default?: string})|null $schema
* @return array{type?: string, default?: string, ...array<string, mixed>}|null $schema
*/
public function getSchema(): ?array

Check failure on line 69 in src/Metadata/Parameter.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.4)

PHPDoc tag @return has invalid value (array{type?: string, default?: string, ...array<string, mixed>}|null $schema): Unexpected token "array", expected '}' at offset 61
{
return $this->schema;
}
Expand Down Expand Up @@ -180,9 +180,9 @@
}

/**
* @param array{type?: string} $schema
* @param array{type?: string, default?: string, ...array<string, mixed>}|null $schema
*/
public function withSchema(array $schema): static

Check failure on line 185 in src/Metadata/Parameter.php

View workflow job for this annotation

GitHub Actions / PHPStan (PHP 8.4)

PHPDoc tag @param has invalid value (array{type?: string, default?: string, ...array<string, mixed>}|null $schema): Unexpected token "array", expected '}' at offset 60
{
$self = clone $this;
$self->schema = $schema;
Expand Down
Loading