Download the PHP package codekandis/constants-classes-translator without Composer
On this page you can find all versions of the php package codekandis/constants-classes-translator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download codekandis/constants-classes-translator
More information about codekandis/constants-classes-translator
Files in codekandis/constants-classes-translator
Package constants-classes-translator
Short Description `codekandis/constants-classes-translator` is a library to translate values from constants classes into values of another constants classes.
License MIT
Informations about the package constants-classes-translator
codekandis/constants-classes-translator
codekandis/constants-classes-translator is a library to translate values from constants classes into values of another constants classes.
Index
- Installation
- Testing
- How to use
- Exceptions
Installation
Install the latest version with
Testing
Test the code with
If you want to retrieve a full coverage report run
How to use
This example demonstrates how to simply translate between error codes and error messages.
First create interfaces or classes containing identical named constants representing error codes and error messages.
Next translate error codes into error messages.
Or translate error messages into error codes.
Exceptions
The ConstantsClassesTranslator throws several exceptions.
InterfaceOrClassNotFoundExceptiona passed constants interface or class does not existInterfaceOrClassConstantNotFoundExceptiona constant of a specific interface or class does not existInterfaceOrClassConstantValueNotFoundExceptiona constant with a specific value of a specific interface or class does not exist