Completed
Push — master ( 184560...9805df )
by ARCANEDEV
21s queued 18s
created

Command   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 52
ccs 0
cts 15
cp 0
c 0
b 0
f 0
rs 10
wmc 3
lcom 0
cbo 2

4 Methods

Rating   Name   Duplication   Size   Complexity  
handle() 0 1 ?
A tableSeparator() 0 4 1
A header() 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
 * @package  Arcanedev\Support\Console
14
 * @author   ARCANEDEV <[email protected]>
15
 */
16
abstract class Command extends IlluminateCommand
17
{
18
    /* -----------------------------------------------------------------
19
     |  Main Methods
20
     | -----------------------------------------------------------------
21
     */
22
23
    /**
24
     * Execute the console command.
25
     */
26
    abstract public function handle();
27
28
    /* -----------------------------------------------------------------
29
     |  Other Methods
30
     | -----------------------------------------------------------------
31
     */
32
33
    /**
34
     * Create table separator
35
     *
36
     * @return \Symfony\Component\Console\Helper\TableSeparator
37
     */
38
    protected function tableSeparator()
39
    {
40
        return new TableSeparator;
41
    }
42
43
    /**
44
     * Display header.
45
     *
46
     * @param  string  $text
47
     *
48
     * @deprecated Use the frame($text) method instead.
49
     */
50
    protected function header($text)
51
    {
52
        $this->frame($text);
53
    }
54
55
    /**
56
     * Display frame the text info.
57
     *
58
     * @param  string  $text
59
     */
60
    protected function frame($text)
61
    {
62
        $line   = '+'.str_repeat('-', strlen($text) + 4).'+';
63
        $this->info($line);
64
        $this->info("|  $text  |");
65
        $this->info($line);
66
    }
67
}
68