PHP Classes

Div PHP Enum Class: Implement enumerated values using classes

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 75 All time: 10,189 This week: 455Up
Version License PHP version Categories
divengine-enum 1.0GNU General Publi...7PHP 5, Data types, Language
Description 

Author

This package can implement enumerated values using classes.

It provides an abstract class that can be be extended by concrete classes that can be used as enumerated values.

Since the enumerated values are actual classes, function declarations can use enumerated values this way to allow PHP to verify that the correct type of enumerated value can be passed to a function as parameter using PHP type hinting support.

Picture of Rafa Rodriguez
  Performance   Level  
Name: Rafa Rodriguez <contact>
Classes: 7 packages by
Country: Suriname Suriname
Age: 38
All time rank: 17201 in Suriname Suriname
Week rank: 192 Up1 in Suriname Suriname Equal
Innovation award
Innovation award
Nominee: 4x

  Files folder image Files (5)  
File Role Description
Files folder imagesrc (1 file)
Accessible without login Plain text file CHANGELOG.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files (5)  /  src  
File Role Description
  Plain text file enum.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:75
This week:0
All time:10,189
This week:455Up
User Comments (1)
Thats a very good class for enums ;-)
5 years ago (José Filipe Lopes Santos)
70%StarStarStarStar