EnumType
final class EnumType extends ClassLike
Definition of an enum with cases, methods, constants and traits.
Methods
string|null
getType()
Returns the backing type ('int' or 'string'), or null for a pure enum.
setImplements(array $names)
No description
array
getImplements()
No description
addImplement(string $name)
No description
removeImplement(string $name)
No description
array
getCases()
No description
addCase(string $name, Literal|null $value = null, bool $overwrite = false)
Adds a case to the enum.
removeCase(string $name)
No description
void
__clone()
No description
Details
at line 33
EnumType
setType(string|null $type)
Sets the backing type of a backed enum ('int' or 'string').
at line 43
string|null
getType()
Returns the backing type ('int' or 'string'), or null for a pure enum.
at line 50
EnumType
setImplements(array $names)
No description
at line 59
array
getImplements()
No description
at line 65
EnumType
addImplement(string $name)
No description
at line 73
EnumType
removeImplement(string $name)
No description
at line 84
EnumType
setCases(array $cases)
Replaces all cases.
at line 97
array
getCases()
No description
at line 107
EnumCase
addCase(string $name, Literal|null $value = null, bool $overwrite = false)
Adds a case to the enum.
at line 117
EnumType
removeCase(string $name)
No description
at line 128
EnumType
addMember(TraitUse $member, bool $overwrite = false)
Adds a member to the enum.
at line 145
void
__clone()
No description