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

False positive for PhpdocTypesOrderFixer on complex PHPDoc types #6195

Closed
gnutix opened this issue Dec 19, 2021 · 2 comments
Closed

False positive for PhpdocTypesOrderFixer on complex PHPDoc types #6195

gnutix opened this issue Dec 19, 2021 · 2 comments
Labels

Comments

@gnutix
Copy link

gnutix commented Dec 19, 2021

Bug report

PhpdocTypesOrderFixer breaks a PHPDoc containing a quite complex type.

Code snippet that reproduces the problem

final class ConfigKey
{
    public const ACTIVITY__EXPORT__TYPE = '...';
}
final class Module
{
    public const FOO = 'foo';
}
interface ConfigValueProcessorInterface
{
}
interface ConfigRepositoryInterface
{
   /**
    * @var array<ConfigKey::*, array{default: mixed, acl: string[], linked_module?: Module::*, value_processors?: array<class-string<ConfigValueProcessorInterface>, mixed>}>
    */
   public const CONFIGURATIONS = [
       // ...
   ];
}

Current behavior

@@ -15,7 +15,7 @@
 interface ConfigRepositoryInterface
 {
     /**
-     * @var array<ConfigKey::*, array{default: mixed, acl: string[], linked_module?: Module::*, value_processors?: array<class-string<ConfigValueProcessorInterface>, mixed>}>
+     * @var array<ConfigKey::*, array{default: mixed, acl: string[], linked_module?: Module::*, value_processors?: array<class-string|<|ConfigValueProcessorInterface>, mixed>}>
      */
     public const CONFIGURATIONS = [
         ConfigKey::ACTIVITY__EXPORT__TYPE => [

Expected

No changes.

@julienfalque
Copy link
Member

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

@gnutix
Copy link
Author

gnutix commented Dec 21, 2021

It does look a lot alike, sorry for the duplicate. I cannot really test it as I'm using PHP-CS-Fixer through ECS, but maybe you could add this line as a test scenario in your PR ?

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