enums
enums copied to clipboard
Helpers for making PHP enums more lovable.
For enum fields, I like to keep a comment in the database that has all the enum values and text. It might be useful to have a Trait with a...
This includes a PHPStan extension to add support for `InvokableCases` so that static analysis tools can understand the callable methods and their return types. The extension has been added in...
Filterable options, values or names
That way, users can create a trait such as: ```php /** * @method string description() */ #[Meta(Description::class) trait HasDescription {} ``` And use this across their enums as: ```diff enum...
There is a high likelihood that cases will be invoked many-many times per-request. Currently, it loops over all cases to find the one it needs on each invocation. In cases...
See https://github.com/archtechx/enums/pull/28#discussion_r1899183810
I'm using `InvokableCases` trait on my enum, when I use it like: `MyEnum::MyCase()`, I get a red wavy line under MyCase saying method is undefined, though it works well in...