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