Passed
Pull Request — 2.x (#597)
by Antonio Carlos
05:31
created

Update::handle()   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 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace A17\Twill\Commands;
4
5
class Update extends Command
6
{
7
    protected $signature = 'twill:update';
8
9
    protected $description = 'Publish new updated Twill assets';
10
11
    /**
12
     * Executes the console command.
13
     *
14
     * @return mixed
15
     */
16
    public function handle()
17
    {
18
        $this->publishAssets();
19
        $this->call('cache:clear');
20
    }
21
22
    /**
23
     * Publishes the package frontend assets.
24
     *
25
     * @return void
26
     */
27
    private function publishAssets()
28
    {
29
        $this->call('vendor:publish', [
30
            '--provider' => 'A17\Twill\TwillServiceProvider',
31
            '--tag' => 'assets',
32
            '--force' => true,
33
        ]);
34
    }
35
}
36