Command::frame()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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