DeleteExpiredActivations   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 39
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
A __construct() 0 4 1
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