DeleteExpiredBans   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 1
1
<?php
2
3
/*
4
 * This file is part of Laravel Ban.
5
 *
6
 * (c) Anton Komarev <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Cog\Laravel\Ban\Console\Commands;
15
16
use Cog\Laravel\Ban\Services\BanService;
17
use Illuminate\Console\Command;
18
19
class DeleteExpiredBans extends Command
20
{
21
    /**
22
     * The name and signature of the console command.
23
     *
24
     * @var string
25
     */
26
    protected $signature = 'ban:delete-expired';
27
28
    /**
29
     * The console command description.
30
     *
31
     * @var string
32
     */
33
    protected $description = 'Delete expired ban models.';
34
35
    /**
36
     * Ban service.
37
     *
38
     * @var \Cog\Contracts\Ban\BanService
39
     */
40
    protected $service;
41
42
    /**
43
     * Execute the console command.
44
     *
45
     * @return void
46
     */
47
    public function handle(): void
48
    {
49
        $this->service = app(BanService::class);
50
51
        $this->service->deleteExpiredBans();
52
    }
53
}
54