Convert usages of BenSampo\Enum\Enum
to native PHP enums
🔧 configure it!
-/**
- * @method static static ADMIN()
- * @method static static MEMBER()
- *
- * @extends Enum<int>
- */
-class UserType extends Enum
+enum UserType : int
{
- const ADMIN = 1;
- const MEMBER = 2;
+ case ADMIN = 1;
+ case MEMBER = 2;
}
Convert usages of BenSampo\Enum\Enum
to native PHP enums
🔧 configure it!
-$user = UserType::ADMIN();
-$user->is(UserType::ADMIN);
+$user = UserType::ADMIN;
+$user === UserType::ADMIN;