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

SeedGeneratorCommand::fire()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 23
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 9.0856
c 0
b 0
f 0
cc 2
eloc 12
nc 2
nop 0
1
<?php 
2
namespace Elimuswift\DbExporter\Commands;
3
4
5
use Elimuswift\DbExporter\DbExporter;
6
use Elimuswift\DbExporter\DbExportHandler;
7
use Symfony\Component\Console\Input\InputOption;
8
use Config;
9
use Illuminate\Support\Str;
10
11
class SeedGeneratorCommand extends GeneratorCommand
12
{
13
    protected $name = 'db-exporter:seeds';
14
15
    protected $description = 'Export your database table data to a seed class.';
16
17
    /**
18
     * @var \Elimuswift\DbExporter\DbExportHandler
19
     */
20
    protected $handler;
21
22
    public function __construct(DbExportHandler $handler)
23
    {
24
        parent::__construct();
25
26
        $this->handler = $handler;
27
    }
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('Success!', "Database seed class generated in: {$filename}");
48
49
        $formattedBlock = $formatter->formatBlock($errorMessages, 'info', true);
50
        $this->line($formattedBlock);
51
    }
52
53
    private function getFilename()
54
    {
55
        $filename = Str::camel($this->getDatabaseName()) . "TableSeeder";
56
        return Config::get('db-exporter.export_path.seeds')."/{$filename}.php";
57
    }
58
59
    
60
}