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

Multiple sub generics split up in wrong way #6157

Closed
gisostallenberg opened this issue Dec 9, 2021 · 2 comments
Closed

Multiple sub generics split up in wrong way #6157

gisostallenberg opened this issue Dec 9, 2021 · 2 comments
Labels

Comments

@gisostallenberg
Copy link

Bug report

  • PHP version: 8.0
  • PHP CS Fixer version: PHP CS Fixer 3.3.3-DEV
  • the configuration used: return (new PhpCsFixer\Config())->setRules(['@Symfony' => true]);

Code snippet that reproduces the problem

/**
 * @return array<int, array<string, mixed>|Collection<string, mixed>>
 */
function example(): array
{
    // ...
}

image

I would expect PHP CS Fixer to do no changes.

@julienfalque
Copy link
Member

Closing because I think this is a duplicate of #5921. If not, please let me know.
Also, can you please give #6063 a try and tell us whether it fixes the issue for you?

@gisostallenberg
Copy link
Author

Yes #6063 fixes the issue. I fixed it in my code base for now by defining all parts separately, as in array<int, array<string, mixed>>|array<int, Collection<string, mixed>>.

Thanks for your response.

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

No branches or pull requests

2 participants