enumFactory = $enumFactory;
}
public function provideMinPhpVersion() : int
{
return PhpVersionFeature::ENUM;
}
public function getRuleDefinition() : RuleDefinition
{
return new RuleDefinition('Refactor Spatie enum class to native Enum', [new ConfiguredCodeSample(<<<'CODE_SAMPLE'
use \Spatie\Enum\Enum;
/**
* @method static self draft()
* @method static self published()
* @method static self archived()
*/
class StatusEnum extends Enum
{
}
CODE_SAMPLE
, <<<'CODE_SAMPLE'
enum StatusEnum : string
{
case DRAFT = 'draft';
case PUBLISHED = 'published';
case ARCHIVED = 'archived';
}
CODE_SAMPLE
, [self::TO_UPPER_SNAKE_CASE => \false])]);
}
/**
* @return array