Download the PHP package sammakescode/enums-extended without Composer
On this page you can find all versions of the php package sammakescode/enums-extended. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sammakescode/enums-extended
More information about sammakescode/enums-extended
Files in sammakescode/enums-extended
Download sammakescode/enums-extended
More information about sammakescode/enums-extended
Files in sammakescode/enums-extended
Vendor sammakescode
Package enums-extended
Short Description Extended functionality for PHP's enums. Add labels, pick random, associative arrays and more.
License MIT
Package enums-extended
Short Description Extended functionality for PHP's enums. Add labels, pick random, associative arrays and more.
License MIT
Please rate this library. Is it a good library?
Informations about the package enums-extended
Enums extended
The introduction of enums in PHP 8.1 allowed developers to define a closed set of values for classes, configuration, etc. Very helpful!
This library attempts to build on that a little by adding functionality for common use cases.
Usage
List
Here are a list of the current helpers.
| Name | Description | Method usage | Docs |
|---|---|---|---|
| AsOptions | Returns an associative array of cases | SomeTrait::asOptions() |
Reference |
| GetValues | Returns an array of case values | SomeTrait::getValues() |
Reference |
| Labels | Allow user-defined labels and descriptions | SomeTrait::SomeCase->label() or SomeTrait::SomeCase->describe() |
Reference |
| PickRandom | Returns a randomly selected case from an enum | SomeTrait::pickRandom() |
Reference |
Requirements
- PHP >= 8.1
Installation
To install this library, simply require them using composer.
All versions of enums-extended with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package sammakescode/enums-extended contains the following files
Loading the files please wait ...