Passed
Push — master ( 051f8c...0effca )
by Daniel
02:41
created

PruneCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
dl 0
loc 25
rs 10
c 1
b 0
f 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
1
<?php
2
3
namespace DanielRobert\Otp\Console;
4
5
use Illuminate\Console\Command;
6
use DanielRobert\Otp\Contracts\PrunableRepository;
7
8
class PruneCommand extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'otp:prune {--minutes=30 : The number of minutes to retain Otp expired data}';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Prune expired entries from the otp database';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @param  \DanielRobert\Otp\Contracts\PrunableRepository  $repository
28
     * @return void
29
     */
30
    public function handle(PrunableRepository $repository)
31
    {
32
        $this->info($repository->prune(now()->subMinutes($this->option('minutes'))).' entries pruned.');
33
    }
34
}