DeleteTokenAllCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 11
dl 0
loc 52
ccs 0
cts 8
cp 0
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 5 1
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Garbuzivan\Laraveltokens\Commands;
6
7
use Garbuzivan\Laraveltokens\TokenManager;
8
use Illuminate\Console\Command;
9
use Illuminate\Support\Composer;
10
11
class DeleteTokenAllCommand extends Command
12
{
13
    /**
14
     * The console command name.
15
     *
16
     * @var string
17
     */
18
    protected $name = 'tokens:clear';
19
20
    /**
21
     * The console command description.
22
     *
23
     * @var string
24
     */
25
    protected $description = 'Удалить все токены';
26
27
    /**
28
     * The console command signature.
29
     *
30
     * @var string
31
     */
32
    protected $signature = 'tokens:clear';
33
34
    /**
35
     * @var Composer
36
     */
37
    public Composer $composer;
38
39
    /**
40
     * @var TokenManager
41
     */
42
    public TokenManager $TokenManager;
43
44
    /**
45
     * Create a new command instance.
46
     */
47
    public function __construct(TokenManager $TokenManager)
48
    {
49
        parent::__construct();
50
        $this->TokenManager = $TokenManager;
51
    }
52
53
    /**
54
     * Execute the command.
55
     *
56
     * @return mixed
57
     */
58
    public function handle()
59
    {
60
        $this->TokenManager->deleteAllTokens();
61
        $this->line('Таблица токенов очищена');
62
        return 1;
63
    }
64
}
65