enum
![Software License][ico-license]
![Coverage Status][ico-scrutinizer]
![Total Downloads][ico-downloads], (*1)
A very simple PHP Enum implementation., (*2)
Install
Via Composer, (*3)
``` bash
$ composer require bbrothers/enum, (*4)
## Usage
``` php
class Weekdays extends Enum
{
const MONDAY = 'monday';
const TUESDAY = 'tuesday';
const WEDNESDAY = 'wednesday';
const THURSDAY = 'thursday';
const FRIDAY = 'friday';
}
// ...
$day = Weekdays::TUESDAY();
$day->equals(Weekdays::MONDAY()); // false
$day->isSelected(Weekdays::TUESDAY); // true
(string) $day; // tuesday
Weekdays::values(); // monday, tuesday, wednesday, thursday, friday
Weekdays::keys(); // MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY
Change log
Please see CHANGELOG for more information on what has changed recently., (*5)
Testing
bash
$ composer test
, (*6)
Contributing
Please see CONTRIBUTING and CONDUCT for details., (*7)
Credits
License
The MIT License (MIT). Please see License File for more information., (*8)