jedi58 / PHPErrorLevelCalculator

Code for converting between strings and integers for PHP error levels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHPErrorLevelCalculator

Class for converting PHP constants for error levels from integers to strings and vice-versa.

Build Status Code Climate Coverage Status

Examples

ErrorLevelCalculator::toString(32767);

This will return the string E_ALL. It is also possible to construct more complicated examples such as:

ErrorLevelCalculator::toString(32765);

This will return E_ALL & ~E_WARNING. In addition to this, they can be built as:

ErrorLevelCalculator::toString(3);

This would return E_ERROR | E_WARNING.

The opposite of this is also true, the following:

ErrorLevelCalculator::toCode('E_ERROR | E_WARNING');

Would return 3.

About

Code for converting between strings and integers for PHP error levels

License:MIT License


Languages

Language:PHP 100.0%