Download the PHP package kongulov/interact-with-enum without Composer
On this page you can find all versions of the php package kongulov/interact-with-enum. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kongulov/interact-with-enum
More information about kongulov/interact-with-enum
Files in kongulov/interact-with-enum
Download kongulov/interact-with-enum
More information about kongulov/interact-with-enum
Files in kongulov/interact-with-enum
Vendor kongulov
Package interact-with-enum
Short Description Trait for convenient use of ENUM in PHP
License MIT
Homepage https://github.com/kongulov/interact-with-enum
Package interact-with-enum
Short Description Trait for convenient use of ENUM in PHP
License MIT
Homepage https://github.com/kongulov/interact-with-enum
Please rate this library. Is it a good library?
Informations about the package interact-with-enum
Interact With Enum in PHP
This package contains the InteractWithEnum.php
trait, which you can use to conveniently work with ENUMs.
Requirements
php: >=8.1
Installation
Install the package via Composer:
Usage
Imagine you have ENUM StatusEnum.php
where we already use the InteractWithEnum
trait:
After using the trait, you can call methods:
- names()
Return:
array:3 [ 0 => "Pending" 1 => "Active" 2 => "Inactive" ]
- values()
Return:
array:3 [ 0 => "pending" 1 => "active" 2 => "inactive" ]
- array()
Return:
array:3 [ "pending" => "Pending" "active" => "Active" "inactive" => "Inactive" ]
- find($needle)
Return:
App\Enums\StatusEnum { name: "Active" value: "active" }
All versions of interact-with-enum with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package kongulov/interact-with-enum contains the following files
Loading the files please wait ....