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.

MigrationsGeneratorCommand::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 17
rs 9.7
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Elimuswift\DbExporter\Commands;
4
5
use Elimuswift\DbExporter\DbExportHandler;
6
7
class MigrationsGeneratorCommand extends GeneratorCommand
8
{
9
    protected $name = 'db-exporter:migrations';
10
11
    protected $description = 'Export your database to migrations.';
12
    /**
13
     * @var \Elimuswift\DbExporter\DbExportHandler
14
     */
15
    protected $handler;
16
17
    public function __construct(DbExportHandler $handler)
18
    {
19
        parent::__construct();
20
21
        $this->handler = $handler;
22
    }
23
24
    //end __construct()
25
26
    public function handle()
27
    {
28
        $database = $this->argument('database');
29
30
        // Display some helpfull info
31
        if (empty($database)) {
32
            $this->comment("Preparing the migrations for database: {$this->getDatabaseName()}");
33
            $database = $this->getDatabaseName();
34
        } else {
35
            $this->comment("Preparing the migrations for database {$database}");
36
        }
37
38
        $this->fireAction('migrate', $database);
39
40
        // Symfony style block messages
41
        $this->blockMessage('Success!', 'Database migrations generated in: '.$this->handler->getMigrationsFilePath());
42
    }
43
44
    //end fire()
45
}//end class
46