MeasurementRun   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 11 2
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