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.

SeedGeneratorCommand   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 1
cbo 2
dl 0
loc 54
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A handle() 0 22 2
A getFilename() 0 6 1
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 handle()
30
    {
31
        $database = $this->argument('database');
32
        // Display some helpfull info
33
        if (empty($database)) {
34
            $this->comment("Preparing the seeder class for database {$this->getDatabaseName()}");
35
        } else {
36
            $this->comment("Preparing the seeder class for database {$database}");
37
        }
38
39
        // Grab the options
40
        $this->fireAction('seed', $database);
41
        // Symfony style block messages
42
        $formatter = $this->getHelperSet()->get('formatter');
43
        $filename = $this->getFilename();
44
        $errorMessages = [
45
                                'Success!',
46
                                "Database seed class generated in: {$filename}",
47
                                ];
48
        $formattedBlock = $formatter->formatBlock($errorMessages, 'info', true);
49
        $this->line($formattedBlock);
50
    }
51
52
    //end fire()
53
54
    private function getFilename()
55
    {
56
        $filename = ucfirst(Str::camel($this->database)).'DatabaseSeeder';
57
58
        return Config::get('db-exporter.export_path.seeds')."/{$filename}.php";
59
    }
60
61
    //end getFilename()
62
}//end class
63