| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 43 | 6 | private function setLevel($level) |
|
| 44 | { |
||
| 45 | 6 | $availableLevels = array_flip(Logger::getLevels()); |
|
| 46 | |||
| 47 | 6 | if (!isset($availableLevels[$level])) { |
|
| 48 | 1 | throw new InvalidLoggerLevelException( |
|
| 49 | 1 | sprintf( |
|
| 50 | 1 | 'The level: "%d" does not exist. The available levels are: "%s"', |
|
| 51 | 1 | $level, |
|
| 52 | 1 | implode(', ', array_keys($availableLevels)) |
|
| 53 | 1 | ), |
|
| 54 | 400 |
||
| 55 | 1 | ); |
|
| 56 | } |
||
| 57 | 5 | $this->level = $level; |
|
| 58 | |||
| 59 | 5 | return $this; |
|
| 60 | } |
||
| 61 | |||
| 78 |