DatabaseMigration::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 2
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 4
rs 10
1
<?php
2
3
namespace App\Console\Commands;
4
5
use App\Console\Commands\Migrations\ArticleMigration;
6
use App\Console\Commands\Migrations\ContestMigration;
7
use App\Console\Commands\Migrations\LoginLogMigration;
8
use App\Console\Commands\Migrations\OptionMigration;
9
use App\Console\Commands\Migrations\ProblemMigration;
10
use App\Console\Commands\Migrations\SolutionMigration;
11
use App\Console\Commands\Migrations\TopicMigration;
12
use App\Console\Commands\Migrations\UserMigration;
13
use Illuminate\Console\Command;
14
15
class DatabaseMigration extends Command
16
{
17
    /**
18
     * The name and signature of the console command.
19
     *
20
     * @var string
21
     */
22
    protected $signature = 'database:migrate';
23
24
    /**
25
     * The console command description.
26
     *
27
     * @var string
28
     */
29
    protected $description = 'migrate from old hustoj';
30
31
    private $commands = [
32
        UserMigration::class,
33
        ProblemMigration::class,
34
        ContestMigration::class,
35
        SolutionMigration::class,
36
        TopicMigration::class,
37
        ArticleMigration::class,
38
        LoginLogMigration::class,
39
        OptionMigration::class,
40
    ];
41
42
    /**
43
     * Execute the console command.
44
     */
45
    public function handle()
46
    {
47
        foreach ($this->commands as $clz) {
48
            app($clz)->handle($this);
0 ignored issues
show
Bug introduced by
$this of type App\Console\Commands\DatabaseMigration is incompatible with the type Symfony\Component\HttpFoundation\Request expected by parameter $request of Illuminate\Foundation\Application::handle(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

48
            app($clz)->handle(/** @scrutinizer ignore-type */ $this);
Loading history...
49
        }
50
    }
51
}
52