Refactor MyCLabs enum class to native Enum
-use MyCLabs\Enum\Enum;
-
-final class Action extends Enum
+enum Action : string
{
- private const VIEW = 'view';
- private const EDIT = 'edit';
+ case VIEW = 'view';
+ case EDIT = 'edit';
}
Configure your rector.php
:
<?php
use Rector\Config\RectorConfig;
use Rector\Php81\Rector\Class_\MyCLabsClassToEnumRector;
return RectorConfig::configure()
->withRules([
MyCLabsClassToEnumRector::class,
]);