Download the PHP package sunnyphp/enum without Composer
On this page you can find all versions of the php package sunnyphp/enum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sunnyphp/enum
More information about sunnyphp/enum
Files in sunnyphp/enum
Download sunnyphp/enum
More information about sunnyphp/enum
Files in sunnyphp/enum
Vendor sunnyphp
Package enum
Short Description Simple AbstractEnum class
License WTFPL
Homepage https://github.com/sunnyphp/enum
Package enum
Short Description Simple AbstractEnum class
License WTFPL
Homepage https://github.com/sunnyphp/enum
Please rate this library. Is it a good library?
Informations about the package enum
Simple AbstractEnum class
Installation
Usage
Methods
Method name | Description | Example | Returns |
---|---|---|---|
get |
Returns constant value if exists or default value (42) if not exists | MyEnum::get('HELLO', 42) |
1 |
getValues |
Returns all constant values | MyEnum::getValues() |
[1, 2, ] |
getKeys |
Returns all keys (constant names) | MyEnum::getKeys() |
['HELLO', 'WORLD', ] |
getAll |
Returns all constants, key-value pairs | MyEnum::getAll() |
['HELLO' => 1, 'WORLD' => 2, ] |
hasValue |
Returns True if constant value is exists | MyEnum::hasValue(1) |
true |
hasKey |
Returns True if constant is exists | MyEnum::hasKey('HELLO') |
true |
hasAnyKey |
Returns True if one or more constants is exists | MyEnum::hasAnyKey('FOO', 'HELLO', 'BAR') |
true |
All versions of enum with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.4 || ^8
The package sunnyphp/enum contains the following files
Loading the files please wait ....