An open API service indexing awesome lists of open source software.

https://github.com/jameshalsall/constant-resolver

PHP Class that resolves class constant values back to their semantic names.
https://github.com/jameshalsall/constant-resolver

constants php resolver

Last synced: about 1 month ago
JSON representation

PHP Class that resolves class constant values back to their semantic names.

Awesome Lists containing this project

README

          

# constant-resolver

PHP Class that resolves class constant values back to their semantic names.

## Installation

### Composer

Add "jameshalsall/constant-resolver" to your composer.json require section.

## Usage

Example class:

```` php
resolve(1);
````

## Example

```` php
resolve(404);
````

Same example with array return:

```` php
setReturnType(ConstantResolver::RETURN_ARRAY);

/**
* returns array(
* 'NOT_FOUND' => 'HttpErrorCodes::NOT_FOUND'
* );
*/
````