DeleteExpiredActivations::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Console\Commands;
4
5
use App\Logic\Activation\ActivationRepository;
6
use Illuminate\Console\Command;
7
8
class DeleteExpiredActivations extends Command
9
{
10
    protected $activationRepository;
11
12
    /**
13
     * The name and signature of the console command.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'activations:clean';
18
19
    /**
20
     * The console command description.
21
     *
22
     * @var string
23
     */
24
    protected $description = 'Delete activation records older than 72 hours.';
25
26
    /**
27
     * Create a new command instance.
28
     *
29
     * DeleteExpiredActivations constructor.
30
     *
31
     * @param ActivationRepository $activationRepository
32
     */
33
    public function __construct(ActivationRepository $activationRepository)
34
    {
35
        parent::__construct();
36
        $this->activationRepository = $activationRepository;
37
    }
38
39
    /**
40
     * Execute the console command.
41
     *
42
     * @return mixed
43
     */
44
    public function handle()
45
    {
46
        $this->activationRepository->deleteExpiredActivations();
47
    }
48
}
49