Passed
Push — master ( ad96cc...dcf026 )
by Caen
03:09 queued 12s
created

PublishConfigsCommand::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 6
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 10
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Hyde\Console\Commands;
6
7
use Hyde\Console\Concerns\Command;
8
use Hyde\Hyde;
9
use Illuminate\Support\Facades\Artisan;
10
11
/**
12
 * Publish the Hyde Config Files.
13
 *
14
 * @see \Hyde\Framework\Testing\Feature\Commands\UpdateConfigsCommandTest
15
 */
16
class PublishConfigsCommand extends Command
17
{
18
    /** @var string */
19
    protected $signature = 'publish:configs';
20
21
    /** @var string */
22
    protected $description = 'Publish the default configuration files';
23
24
    public function handle(): int
25
    {
26
        Artisan::call('vendor:publish', [
27
            '--tag' => 'configs',
28
            '--force' => true,
29
        ], $this->output);
30
31
        $this->infoComment(sprintf('Published config files to [%s]', Hyde::path('config')));
32
33
        return Command::SUCCESS;
34
    }
35
}
36