If I use 7.0.7 it wants to remove unused use statements from multiple of my classes while they are indeed used. It looks like it only happens with specific use statements. All classes that extends Enum are getting removed because it says it's not being used (I use https://github.com/myclabs/php-enum),
An example enum class:
namespace MyTypes;
use MyCLabs\Enum\Enum;
/**
* Action enum
*/
final class Action extends Enum
{
private const VIEW = 'view';
private const EDIT = 'edit';
}
It's then being used as: Action::VIEW(). I do use it in combination with named arguments.
So like:
new SomeClass(
foobar: Action::VIEW(),
);
I could provide more information if needed. Just let me know.
@Ilyes512 What's removed from the code you posted? The line with use MyCLabs\Enum\Enum; ?
It's removed from a file where I try to use Action. So for example:
<?php
use MyTypes\Action;
class Foobar
{
public function foo()
{
return new Acme(
mytype: Action::VIEW(),
);
}
}
So in the above pseodo code it would remove this line use MyTypes\Action;.
Confirming that when I use dev-master it seems to be fixed :) Damm your fast! Thanks and I appreciate your work!
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Fixed in https://github.com/slevomat/coding-standard/commit/1122e79f8bc6851d52b2fe4a57be5394d1da9888