Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
54 | 2 | public static function getErrorNameByCode($code) |
|
55 | { |
||
56 | 2 | $currentClass = new \ReflectionClass('\Drone\Error\Errno'); |
|
57 | 2 | $constants = $currentClass->getConstants(); |
|
58 | |||
59 | 2 | $constName = null; |
|
60 | |||
61 | 2 | foreach ($constants as $name => $value) { |
|
62 | 2 | if ($value == $code) { |
|
63 | 2 | $constName = $name; |
|
64 | 2 | break; |
|
65 | } |
||
66 | } |
||
67 | |||
68 | 2 | return $constName; |
|
69 | } |
||
71 |