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.
Passed
Push — master ( fa6a42...a007ee )
by Albert
04:34
created

SeedGeneratorCommand::fire()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 26
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 8.8571
c 0
b 0
f 0
cc 2
eloc 14
nc 2
nop 0
1
<?php
2
3
namespace Elimuswift\DbExporter\Commands;
4
5
use Elimuswift\DbExporter\DbExportHandler;
6
use Config;
7
use Illuminate\Support\Str;
8
9
class SeedGeneratorCommand extends GeneratorCommand
10
{
11
    protected $name = 'db-exporter:seeds';
12
13
    protected $description = 'Export your database table data to a seed class.';
14
15
    /**
16
     * @var \Elimuswift\DbExporter\DbExportHandler
17
     */
18
    protected $handler;
19
20
    public function __construct(DbExportHandler $handler)
21
    {
22
        parent::__construct();
23
24
        $this->handler = $handler;
25
    }
26
27
//end __construct()
28
29
    public function fire()
30
    {
31
        $database = $this->argument('database');
32
33
        // Display some helpfull info
34
        if (empty($database)) {
35
            $this->comment("Preparing the seeder class for database {$this->getDatabaseName()}");
36
        } else {
37
            $this->comment("Preparing the seeder class for database {$database}");
38
        }
39
40
        // Grab the options
41
        $this->fireAction('seed', $database);
42
43
        // Symfony style block messages
44
        $formatter = $this->getHelperSet()->get('formatter');
45
        $filename = $this->getFilename();
46
47
        $errorMessages = array(
48
                          'Success!',
49
                          "Database seed class generated in: {$filename}",
50
                         );
51
52
        $formattedBlock = $formatter->formatBlock($errorMessages, 'info', true);
53
        $this->line($formattedBlock);
54
    }
55
56
//end fire()
57
58
    private function getFilename()
59
    {
60
        $filename = ucfirst(Str::camel($this->database)).'DatabaseSeeder';
61
62
        return Config::get('db-exporter.export_path.seeds')."/{$filename}.php";
63
    }
64
65
//end getFilename()
66
}//end class
67