Closed Arkemlar closed 10 months ago
And IDE shows me reasonable error
Hi @Arkemlar,
PHP CS Fixer works on a per-file basis and cannot determine what are the relations between interfaces outside of the file it is currently fixing, thus it is not possible to discover the situation you have described.
Moreover, this is not a bug, it is a false positive of PHPStorm: https://youtrack.jetbrains.com/issue/WI-50862
As it was reported 4 years ago and is still not fixed I've actually have an idea, take a look at https://github.com/kubawerlos/php-cs-fixer-custom-fixers/pull/926
@kubawerlos Thank you for fix, could you please explain how it works?
Well, since there is actually no bug, there is not really a fix for it.
The improvement is exactly what the title of https://github.com/kubawerlos/php-cs-fixer-custom-fixers/pull/926 says.
I have Interface A:
and class that implements it:
and php-cs-fixer with config:
Now when I run
php-cs-fixer fix
it changes my class to this:This is wrong behaivor, it must not add Stringable to the class since interface it implements already extends from Stringable.