Completed
Push — master ( eef921...c5f99d )
by Elf
08:47
created

GenerateIdeHelpers::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
namespace ElfSundae\Laravel\Support\Console\Commands;
4
5
use Illuminate\Console\Command;
6
7
class GenerateIdeHelpers extends Command
8
{
9
    /**
10
     * The name and signature of the console command.
11
     *
12
     * @var string
13
     */
14
    protected $signature = 'support:generate-ide-helpers
15
        {--alone : Do not execute clear-compiled and optimize commands}';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Generate new IDE Helper files.';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return mixed
28
     */
29
    public function handle()
30
    {
31
        if (! $this->option('alone')) {
32
            $this->call('clear-compiled');
33
        }
34
35
        if ($this->laravel->bound('command.ide-helper.generate')) {
36
            $this->call('ide-helper:generate');
37
            $this->call('ide-helper:meta');
38
            $this->call('ide-helper:models', ['-R' => true, '-N' => true]);
39
        }
40
41
        if (! $this->option('alone')) {
42
            $this->call('optimize');
43
        }
44
    }
45
}
46