ResetCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 39
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 7 1
1
<?php
2
3
namespace Ben182\AbTesting\Commands;
4
5
use Illuminate\Console\Command;
6
use Ben182\AbTesting\Models\Goal;
7
use Ben182\AbTesting\Models\Experiment;
8
9
class ResetCommand extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'ab:reset';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Deletes all experiment visitors and goal completions';
24
25
    /**
26
     * Create a new command instance.
27
     *
28
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
29
     */
30 51
    public function __construct()
31
    {
32 51
        parent::__construct();
33 51
    }
34
35
    /**
36
     * Execute the console command.
37
     *
38
     * @return mixed
39
     */
40 3
    public function handle()
41
    {
42 3
        Goal::truncate();
43 3
        Experiment::truncate();
44
45 3
        $this->info('Successfully deleted all experiment visitors and goal completions.');
46 3
    }
47
}
48