|Info||View files (3)||Download .zip||Reputation||Support forum (1)||Blog|
|Last Updated||Ratings||Unique User Downloads||Download Rankings|
|2014-03-13 (4 months ago)||Not enough user ratings||Total: 197 This week: 2||All time: 7,176 This week: 863|
|php-enum-const 1.0||Freely Distributable||5.3||PHP 5, Data types|
It provides a base class that should be extended by a class that defines the enumerated values as class constants.
The class can set or get the complete list of supported enumerated constants, return the enumerated name as an object string value, as well the respective value using the getValue function.
Prize: One book of choice by Packt
|Enumerated types are often used to pass values that must be set to a certain set of values.
This class implements enumerated types by using reflection to get the constants of a class and use their values to define the set of accepted values of an enumerated type.
This way developers only need to define the class constants to determine which are the values accepted in the enumerated type.
Using classes as enumerated values also makes it easy to benefit from type hinting to validate the types of values passed to functions that takes enumerated types as parameters.
|Version Control||Unique User Downloads||Download Rankings|
|This week:||2||This week:||863|