Command   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 40
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
handle() 0 1 ?
A tableSeparator() 0 4 1
A frame() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Arcanedev\Support\Console;
6
7
use Illuminate\Console\Command as IlluminateCommand;
8
use Symfony\Component\Console\Helper\TableSeparator;
9
10
/**
11
 * Class     Command
12
 *
13
 * @author   ARCANEDEV <[email protected]>
14
 */
15
abstract class Command extends IlluminateCommand
16
{
17
    /* -----------------------------------------------------------------
18
     |  Main Methods
19
     | -----------------------------------------------------------------
20
     */
21
22
    /**
23
     * Execute the console command.
24
     */
25
    abstract public function handle();
26
27
    /* -----------------------------------------------------------------
28
     |  Other Methods
29
     | -----------------------------------------------------------------
30
     */
31
32
    /**
33
     * Create table separator
34
     *
35
     * @return \Symfony\Component\Console\Helper\TableSeparator
36
     */
37
    protected function tableSeparator()
38
    {
39
        return new TableSeparator;
40
    }
41
42
    /**
43
     * Display frame the text info.
44
     *
45
     * @param  string  $text
46
     */
47
    protected function frame(string $text)
48
    {
49
        $line   = '+'.str_repeat('-', strlen($text) + 4).'+';
50
        $this->info($line);
51
        $this->info("|  $text  |");
52
        $this->info($line);
53
    }
54
}
55