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

Command::tableSeparator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
nc 1
dl 0
loc 4
ccs 0
cts 4
cp 0
c 0
b 0
f 0
cc 1
nop 0
crap 2
rs 10
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