Completed
Push — master ( 6072da...7e59dd )
by Elf
05:18
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
     * Create a new command instance.
26
     *
27
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
28
     */
29
    public function __construct()
30
    {
31
        parent::__construct();
32
    }
33
34
    /**
35
     * Execute the console command.
36
     *
37
     * @return mixed
38
     */
39
    public function handle()
40
    {
41
        if (! $this->option('alone')) {
42
            $this->call('clear-compiled');
43
        }
44
45
        if ($this->laravel->bound('command.ide-helper.generate')) {
46
            $this->call('ide-helper:generate');
47
            $this->call('ide-helper:meta');
48
            $this->call('ide-helper:models', ['-R' => true, '-N' => true]);
49
        }
50
51
        if (! $this->option('alone')) {
52
            $this->call('optimize');
53
        }
54
    }
55
}
56