Skip to content

jayzeng/PHPEnum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Enum

Latest Stable Version Total DownloadsBuild Status

Project website: (http://jayzeng.github.com/PHPEnum/)

##Usage:

class StubUtilEnum extends Enum
{
    const ONE   = 1;
    const TWO   = 2;
    const THREE = 3;
    const FOUR  = "four";
}


// Retrieve value mapped to the label
$StubUtilEnum->getValue('ONE');   // returns 1
$StubUtilEnum->getValue('FOUR');   // returns four
$StubUtilEnum->getValues();    //  array

// Determine if a label exists
$StubUtilEnum->hasLabel(1);         // true
$StubUtilEnum->hasLabel('oops');    // false

##Details See https://github.com/jayzeng/PHPEnum/blob/master/Tests/Src/EnumTest.php

##Issues & Development

##How to release new version?

  • RELEASE_VERSION - version number
  • RELEASE_MESSAGE - release message
make release RELEASE_VERSION="0.1" RELEASE_MESSAGE="v0.1 is released"

##Author: Jay Zeng, e-mail: jayzeng@jay-zeng.com