2017 © Pedro Peláez
 

library enum

A simple PHP Enum implementation

image

bbrothers/enum

A simple PHP Enum implementation

  • Monday, April 24, 2017
  • by bbrothers
  • Repository
  • 1 Watchers
  • 1 Stars
  • 151 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

enum

Latest Version on Packagist ![Software License][ico-license] Build Status ![Coverage Status][ico-scrutinizer] Quality Score ![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)

The Versions

24/04 2017

dev-master

9999999-dev https://github.com/bbrothers/enum

A simple PHP Enum implementation

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

enum

24/04 2017

v1.0.0

1.0.0.0 https://github.com/bbrothers/enum

A simple PHP Enum implementation

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

enum