2017 © Pedro Peláez
 

library phenum

Because PHP needs Enums

image

gerritdrost/phenum

Because PHP needs Enums

  • Tuesday, July 5, 2016
  • by gerritdrost
  • Repository
  • 3 Watchers
  • 12 Stars
  • 12,518 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 3 Versions
  • 14 % Grown

The README.md

Note

PHP has native support for enums since version 8.1. Use those if you have the chance., (*1)

phenum

Enums for PHP, nuff said., (*2)

Description

A lot of people love enums. Unfortunately, PHP does not support them out-of-the-box, it requires SplEnum to be installed. I stumbled across this problems as well and decided to attempt to solve it: say hello to phenum., (*3)

Why phenum?

Because it's easy to use and has some cool features. Enum values are actually are singleton objects, they have their own instance and can have their own variables! Also the library provides utility classes like the EnumMap which can be used to map values to Enums, something not possible with regular PHP arrays., (*4)

Dependencies

PHP 8.1 or newer., (*5)

Setup

Include gerritdrost/phenum using composer., (*6)

Documentation

The Versions

05/07 2016

dev-master

9999999-dev

Because PHP needs Enums

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Gerrit Drost

31/03 2015

v1.0.1

1.0.1.0

Because PHP needs Enums

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Gerrit Drost

30/03 2015

v1.0.0

1.0.0.0

Because PHP needs Enums

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

by Gerrit Drost