Completed
Push — master ( 8c9c54...6d4889 )
by Elf
44:15
created

IdeHelperGenerateCommand::handle()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 11
cp 0
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 7
nc 4
nop 0
crap 12
1
<?php
2
3
namespace ElfSundae\Support\Console;
4
5
use Illuminate\Console\Command;
6
7
class IdeHelperGenerateCommand extends Command
8
{
9
    /**
10
     * The name and signature of the console command.
11
     *
12
     * @var string
13
     */
14
    protected $signature = 'support:ide-helper-generate
15
        {--p|pure : Do not call "clear-compiled" command}';
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('pure')) {
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:models', ['--nowrite' => true]);
38
            $this->call('ide-helper:meta');
39
        }
40
    }
41
}
42