MeasurementRun::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace JildertMiedema\SystemMonitor\Console;
6
7
use Illuminate\Console\Command;
8
use JildertMiedema\SystemMonitor\Store\ConsoleStore;
9
10
final class MeasurementRun extends Command
11
{
12
    /**
13
     * The name and signature of the console command.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'measurement:run {--debug}';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Run all measurements';
25
26
    /**
27
     * Execute the console command.
28
     *
29
     * @return mixed
30
     */
31
    public function handle()
32
    {
33
        if ($this->option('debug')) {
34
            app()->bind('measurement.store', function () {
35
                return new ConsoleStore($this->output);
36
            });
37
        }
38
39
        $manager = app('measurement');
40
        $manager->run();
41
    }
42
}
43