Login   Register  
PHP Classes
elePHPant
Icontem

Typesafe Enum

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

  Author  
Picture of Fabian Schmengler
Name: Fabian Schmengler is available for providing paid consulting. Contact Fabian Schmengler .
Packages: 5 Browse all classes by Fabian Schmengler Browse all classes by
Country: Germany Germany - PHP jobs in Germany
Age: 30
All time rank: 116478 in Germany Germany
Week rank: 1491 Down80 in Germany Germany Down
Innovation award
Innovation award
Nominee: 4x


  Detailed description   Download .zip .tar.gz  
This class can be used to implement enumerated values as class functions.

It takes the name of a class and the list of names for enumerated values to define and generates code for a new class that defines the enumerated values.

The enumerated values can be retrieved using static function calls to the generated class.

  Classes of Fabian Schmengler  >  Typesafe Enum  >  Download .zip .tar.gz  >  Support forum Support forum (2)  >  Blog Blog  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Typesafe Enum
Base name: typesafe-enum
Description: Implement enumerated values as class functions
Version: 1.1
PHP version: 5.2.5
License: BSD License
All time users: 359 users
All time rank: 5753
Week users: 0 users
Week rank: 2072 Equal
 
  Groups   Rate classes User ratings   Dependents   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Data types Modeling and manipulating data types View top rated classes
Group folder image Code Generation Compilers and tools that generate code automatically View top rated classes


  Innovation Award  
PHP Programming Innovation award nominee
March 2010
Number 5

Prize: One book of choice by Packt
Enumerated values can be used to assign meaningful values to variables that only accept a limited number of values.

An alternative way to implement enumerated value types by using class functions to represent each enumerated value.

Manuel Lemos

  User ratings  
Not yet rated by the users

  Packages that need this class  
Class Dependency Why it is needed
Output Filter
Required
Enumeration data type

  Applications that use this class  
No application links were specified for this class.
Add link image If you know an application of this package, send a message to the author to add a link here.
  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagetest (3 files)
Files folder imagecache (1 file)
Accessible without login Plain text file readme.txt Doc. Full documentation
Plain text file license.txt Lic. BSD License
Plain text file typesafeenum.lib.php Aux. Include this file to use the package
Plain text file Enum.php Class Enum base class and generator

  Files  /  Files folder image example  
File Role Description
  Accessible without login Plain text file example.php Example Simple example usage

  Files  /  Files folder image test  
File Role Description
  Plain text file EnumBenchmark.php Class Benchmark class
  Plain text file EnumTest.php Test PHPUnit test class
  Plain text file run_benchmark.php Aux. The script that I used for benchmarking

  Files  /  Files folder image cache  
File Role Description
  Plain text file EMPTY Data make this directory writable for PHP

Download all files: typesafe-enum.tar.gz typesafe-enum.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.