GeneratorCommand::blockMessage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 3
1
<?php namespace Nwidart\DbExporter\Commands;
2
3
use Illuminate\Console\Command;
4
use Config;
5
6
class GeneratorCommand extends Command
7
{
8
    /**
9
     * Get the database name from the app/config/database.php file
10
     * @return String
11
     */
12
    protected function getDatabaseName()
13
    {
14
        $connType = config('database.default');
15
        $database = config('database.connections.' .$connType );
16
17
        return $database['database'];
18
    }
19
20
    protected function blockMessage($title, $message, $style = 'info')
21
    {
22
        // Symfony style block messages
23
        $formatter = $this->getHelperSet()->get('formatter');
24
        $errorMessages = array($title, $message);
25
        $formattedBlock = $formatter->formatBlock($errorMessages, $style, true);
26
        $this->line($formattedBlock);
27
    }
28
29
    protected function sectionMessage($title, $message)
30
    {
31
        $formatter = $this->getHelperSet()->get('formatter');
32
        $formattedLine = $formatter->formatSection(
33
            $title,
34
            $message
35
        );
36
        $this->line($formattedLine);
37
    }
38
}