Skip to content
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

PhpdocTypesOrderFixer: fix for array shapes #5835

Merged
merged 1 commit into from
Aug 3, 2021
Merged

PhpdocTypesOrderFixer: fix for array shapes #5835

merged 1 commit into from
Aug 3, 2021

Conversation

kubawerlos
Copy link
Contributor

@kubawerlos kubawerlos commented Aug 3, 2021

fixes #5798
closes #5833

As an extra it will "work" for broken types such as array<string} or array{string>.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 92.185% when pulling 5669a31 on kubawerlos:fix_PhpdocTypesOrderFixer_array_shapes into 7c1dff0 on FriendsOfPHP:3.0.

@keradus keradus added this to the 3.0.2 milestone Aug 3, 2021
@keradus
Copy link
Member

keradus commented Aug 3, 2021

Thank you @kubawerlos.

@keradus keradus merged commit a8897f2 into PHP-CS-Fixer:3.0 Aug 3, 2021
@ruudk
Copy link
Contributor

ruudk commented Aug 3, 2021

Thanks for fixing this 👏

@kubawerlos kubawerlos deleted the fix_PhpdocTypesOrderFixer_array_shapes branch August 3, 2021 20:48
@drupol
Copy link
Contributor

drupol commented Aug 4, 2021

I think there's still an issue with 3.0.2:

-                 * @var Closure(Iterator<TKey, T>): Generator<TKey, T> $callback
+                 * @var Closure(Iterator<TKey, <|T>): Generator|TKey, T> $callback

drupol added a commit to drupol/phpcsfixer-configs-php that referenced this pull request Aug 4, 2021
@ruudk
Copy link
Contributor

ruudk commented Aug 5, 2021

Related but slightly different syntax also causes issues:

-     * @param null|callable(array<string>): array<string, T> $computeCallback
+     * @param null|callable(array<string>): array|<|string, T> $computeCallback

@SpacePossum
Copy link
Contributor

Thanks for reporting! Can you guys check there is a new open bug issue for these cases? it is kinda hard keep track with closed issues/PR's

@ruudk
Copy link
Contributor

ruudk commented Aug 5, 2021

I think it's #5850 ... Will post there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[3.0 dev] phpdoc_types_order does not work together with array shapes
7 participants