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.
- Host: GitHub
- URL: https://github.com/jameshalsall/constant-resolver
- Owner: jameshalsall
- Created: 2013-03-28T16:55:42.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2013-07-31T17:19:33.000Z (over 12 years ago)
- Last Synced: 2025-06-21T18:41:30.764Z (7 months ago)
- Topics: constants, php, resolver
- Language: PHP
- Size: 91.8 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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'
* );
*/
````