Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | class ChangeLogLevel implements Contract |
||
12 | { |
||
13 | /** |
||
14 | * @var int |
||
15 | */ |
||
16 | protected $level; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $levels = [ |
||
22 | Console::DEBUG, |
||
23 | Console::INFO, |
||
24 | Console::NOTICE, |
||
25 | Console::WARNING, |
||
26 | ]; |
||
27 | |||
28 | public function __construct(Request $request) |
||
29 | { |
||
30 | $this->level = is_numeric($request->level) |
||
31 | ? Cast::toInt($request->level) |
||
32 | : -1; // invalid level! |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return void |
||
37 | */ |
||
38 | public function handle() |
||
49 | ); |
||
50 | } |
||
52 |