| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | public static function translateLevel($name) |
||
| 15 | { |
||
| 16 | if (is_int($name)) { |
||
| 17 | return $name; |
||
| 18 | } |
||
| 19 | |||
| 20 | $levels = self::getLevels(); |
||
| 21 | $upper = strtoupper($name); |
||
| 22 | |||
| 23 | if (!isset($levels[$upper])) { |
||
| 24 | throw new \InvalidArgumentException("Provided logging level '$name' does not exist. Must be a valid monolog logging level."); |
||
| 25 | } |
||
| 26 | |||
| 27 | return $levels[$upper]; |
||
| 28 | } |
||
| 29 | } |
||
| 30 |