Execute   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 60
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 18
c 1
b 0
f 0
dl 0
loc 60
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 18 1
A __construct() 0 5 1
1
<?php
2
namespace Prateekkarki\Laragen\Commands;
3
4
use Illuminate\Console\Command;
5
use Illuminate\Support\Composer;
6
use Artisan;
7
8
class Execute extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'laragen:exec';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Generate/Migrate/Seed your project';
23
24
    /**
25
     * The composer instance
26
     *
27
     * @var Composer
28
     */
29
    protected $composer = 'Generate/Migrate/Seed your project';
30
31
32
    /**
33
     * Create a new command instance.
34
     *
35
     * @param Composer $composer
36
     * @return void
37
     */
38
    public function __construct(Composer $composer)
39
    {
40
        parent::__construct();
41
42
        $this->composer = $composer;
43
    }
44
45
    /**
46
     * Execute the console command.
47
     *
48
     * @return mixed
49
     */
50
    public function handle()
51
    {
52
        $bar = $this->output->createProgressBar(3);
53
        $bar->setOverwrite(true);
54
        $bar->start();
55
56
        Artisan::call('laragen:make');
57
58
        $this->composer->dumpOptimized();
59
60
        $bar->advance();
61
        Artisan::call('laragen:migrate');
62
63
        $bar->advance();
64
        Artisan::call('laragen:seed');
65
        $bar->finish();
66
        $this->line("\n");
67
        $this->line('Code generation, migration, seeding successfull.');
68
    }
69
}
70