| 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 |
||
| 49 | 4 | private function setLevel($level) |
|
| 50 | { |
||
| 51 | 4 | $availableLevels = array_flip(Logger::getLevels()); |
|
| 52 | |||
| 53 | 4 | if (!isset($availableLevels[$level])) { |
|
| 54 | 1 | throw new InvalidLoggerLevelException( |
|
| 55 | 1 | sprintf( |
|
| 56 | 1 | 'The level: "%d" does not exist. The available levels are: "%s"', |
|
| 57 | 1 | $level, |
|
| 58 | 1 | implode(', ', array_keys($availableLevels)) |
|
| 59 | 1 | ), |
|
| 60 | 400 |
||
| 61 | 1 | ); |
|
| 62 | } |
||
| 63 | 3 | $this->level = $level; |
|
| 64 | |||
| 65 | 3 | return $this; |
|
| 66 | } |
||
| 67 | |||
| 84 |