2017 © Pedro Peláez
 

library consthelpers

image

rickselby/consthelpers

  • Tuesday, December 22, 2015
  • by rickselby
  • Repository
  • 1 Watchers
  • 0 Stars
  • 11 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Build Status Coverage Status, (*1)

Helper traits to use when using a class with many constants., (*2)

Also a place for me to test CI stuff., (*3)

Example

class DataRef
{
    use \ConstHelpers\Validating;

    const POINT_NORTH = 0;
    const POINT_SOUTH = 1;
    const POINT_EAST = 2;
    const POINT_WEST = 3;
    const POINT_UP = 4;
    const POINT_DOWN = 5;

    const ORIENT_NORMAL = 6;
    const ORIENT_INVERSE = 7;
}

// Get the list of constants that start with 'POINT_'
$consts = DataRef::startsWith('POINT_'));

// Validate a value against the constants starting with 'POINT_'
if (DataRef::isValidStartsWith($value, 'POINT_')) {
...

// Validate against constants matching a regular expression
if (DataRef::isValid($value, '/T.*E/')) {
...

The Versions

22/12 2015

dev-master

9999999-dev https://github.com/rickselby/consthelpers

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

constants

22/12 2015

1.2

1.2.0.0 https://github.com/rickselby/consthelpers

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

constants

21/12 2015

1.1

1.1.0.0 https://github.com/rickselby/consthelpers

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

constants

17/10 2015

1.0

1.0.0.0 https://github.com/rickselby/consthelpers

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

constants