GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — master ( e165f3...e86535 )
by Albert
03:50
created

GeneratorCommand   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 63
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getDatabaseName() 0 7 1
A blockMessage() 0 8 1
A sectionMessage() 0 9 1
A getArguments() 0 6 1
A getOptions() 0 6 1
A fireAction() 0 16 3
1
<?php 
2
namespace Elimuswift\DbExporter\Commands;
3
4
use Config;
5
use Illuminate\Console\Command;
6
use Symfony\Component\Console\Input\InputOption;
7
use Symfony\Component\Console\Input\InputArgument;
8
9
class GeneratorCommand extends Command
10
{
11
    /**
12
     * Get the database name from the app/config/database.php file
13
     * @return String
14
     */
15
    protected function getDatabaseName()
16
    {
17
        $connType = Config::get('database.default');
18
        $database = Config::get('database.connections.' .$connType );
19
20
        return $database['database'];
21
    }
22
23
    protected function blockMessage($title, $message, $style = 'info')
24
    {
25
        // Symfony style block messages
26
        $formatter = $this->getHelperSet()->get('formatter');
27
        $errorMessages = array($title, $message);
28
        $formattedBlock = $formatter->formatBlock($errorMessages, $style, true);
29
        $this->line($formattedBlock);
30
    }
31
32
    protected function sectionMessage($title, $message)
33
    {
34
        $formatter = $this->getHelperSet()->get('formatter');
35
        $formattedLine = $formatter->formatSection(
36
            $title,
37
            $message
38
        );
39
        $this->line($formattedLine);
40
    }
41
    protected function getArguments()
42
    {
43
        return array(
44
            array('database', InputArgument::OPTIONAL, 'Override the application database')
45
        );
46
    }
47
48
    protected function getOptions()
49
    {
50
        return array(
51
            array('ignore', 'i', InputOption::VALUE_REQUIRED, 'Ignore tables to export, seperated by a comma', null)
52
        );
53
    }
54
55
    protected function fireAction($action,$database)
56
    {
57
        // Grab the options
58
        $ignore = $this->option('ignore');
59
60
        if (empty($ignore)) {
61
            $this->handler->$action($database);
62
        } else {
63
            $tables = explode(',', str_replace(' ', '', $ignore));
64
65
            $this->handler->ignore($tables)->$action($database);
66
            foreach (DbExporter::$ignore as $table) {
67
                $this->comment("Ignoring the {$table} table");
68
            }
69
        }
70
    }
71
}