Download the PHP package oskarstark/enum-helper without Composer
On this page you can find all versions of the php package oskarstark/enum-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download oskarstark/enum-helper
More information about oskarstark/enum-helper
Files in oskarstark/enum-helper
Download oskarstark/enum-helper
More information about oskarstark/enum-helper
Files in oskarstark/enum-helper
Vendor oskarstark
Package enum-helper
Short Description This library provides helpers for several enum operations
License MIT
Package enum-helper
Short Description This library provides helpers for several enum operations
License MIT
Keywords enum
Please rate this library. Is it a good library?
Informations about the package enum-helper
enum-helper
This library provides helpers for several enum operations:
- compare
- to array
It also provides an abstract EnumTestCase
.
Installation
Usage
For example, you have the following Enum:
You can use the following trait,
Comparable
Trait
This trait
gives you the possibility to compare you enum
with another one or a collection of enums like the
following:
For example, you want to check if a color is a nice color:
ToArray
Trait
This trait
gives you the possibility to get an enum as array like the following:
For Backed Enum
For Non-Backed Enum
All versions of enum-helper with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.2
The package oskarstark/enum-helper contains the following files
Loading the files please wait ....