ClearLockCommands   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 12
dl 0
loc 43
rs 10
c 1
b 0
f 1
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A handle() 0 12 2
1
<?php
2
3
namespace Irfa\Lockout\Console\Commands;
4
5
use Illuminate\Console\Command;
6
use Irfa\Lockout\Func\Core;
7
use Symfony\Component\Console\Helper\Table;
8
9
class ClearLockCommands extends Command
10
{
11
    /**
12
     * The name and signature of the console command.
13
     *
14
     * @var string
15
     */
16
    protected $signature = 'lockout:clear';
17
18
    /**
19
     * The console command description.
20
     *
21
     * @var string
22
     */
23
    protected $description = 'Lock Account';
24
25
    /**
26
     * Create a new command instance.
27
     *
28
     * @return void
29
     */
30
    public function __construct()
31
    {
32
        parent::__construct();
33
    }
34
35
    /**
36
     * Execute the console command.
37
     *
38
     * @return mixed
39
     */
40
    public function handle(Core $core)
41
    {
42
        $this->line('Cleaning locked user...');
43
        if($core->clear_all()){
44
            $table = new Table($this->output);
45
            $table->setRows([
46
                        ['<fg=green>Locked Account(s) Cleared.'],
47
                       
48
                    ]);
49
                        $table->render();
50
        } else{
51
                $this->line('<fg=red> Clearing failed.');
52
        }
53
    }
54
    
55
}
56