CompileCommand::handle()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 6
nc 2
nop 0
dl 0
loc 9
ccs 0
cts 9
cp 0
crap 6
rs 9.6666
c 1
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the Laravel Platfourm package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Longman\Platfourm\Foundation\Console;
12
13
use Longman\Platfourm\Console\Command;
14
15
class CompileCommand extends Command
16
{
17
    /**
18
     * The name and signature of the console command.
19
     *
20
     * @var string
21
     */
22
    protected $signature = 'compile';
23
24
    /**
25
     * The console command description.
26
     *
27
     * @var string
28
     */
29
    protected $description = 'Caches and optimizes everything';
30
31
    /**
32
     * Execute the console command.
33
     *
34
     * @return mixed
35
     */
36
    public function handle()
37
    {
38
        $this->call('clear-compiled');
39
        if (!$this->laravel['config']['app.debug']) {
40
            $this->call('optimize', ['--force' => true]);
41
            $this->call('config:cache');
42
            $this->call('route:cache');
43
        }
44
    }
45
}
46