generated from archtechx/template
-
Notifications
You must be signed in to change notification settings - Fork 23
Closed
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
That way, users can create a trait such as:
/**
* @method string description()
*/
#[Meta(Description::class)
trait HasDescription
{}And use this across their enums as:
enum Status
{
+ use HasDescription;
+ #[Description('Completed Task')]
case COMPLETED;
}
enum Role
{
+ use HasDescription;
+ #[Description('Administrator')]
case ADMIN;
+ #[Description('Read-only user')]
case GUEST;
}Implementation
Edit ArchTech\Enums\Meta\Reflection::metaProperties() to also recursively walk through the enum's traits, and extract the enabled meta properties in their #[Meta] attributes, if they're defined.
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed