| Conditions | 5 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 3 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 32 | 2 | public static function translateErrorCode($error_code) |
|
| 33 | { |
||
| 34 | 2 | $constants = get_defined_constants(true); |
|
| 35 | 2 | if (array_key_exists('Core' , $constants)) { |
|
| 36 | 2 | foreach ($constants['Core'] as $constant => $value) { |
|
| 37 | 2 | if (substr($constant, 0, 2) == 'E_' && $value == $error_code) { |
|
| 38 | 1 | return $constant; |
|
| 39 | } |
||
| 40 | 2 | } |
|
| 41 | 1 | } |
|
| 42 | 1 | return "E_UNKNOWN"; |
|
| 43 | } |
||
| 44 | } |
||
| 45 |