Passed
Push — master ( 68f9e3...36b0af )
by Andrey
02:57 queued 39s
created

LangInstall::install()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
ccs 3
cts 4
cp 0.75
rs 10
cc 2
nc 2
nop 3
crap 2.0625
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Console;
4
5
use Helldar\LaravelLangPublisher\Facades\Locale;
6
use Helldar\LaravelLangPublisher\Services\Processors\PublishJson;
7
use Helldar\LaravelLangPublisher\Services\Processors\PublishPhp;
8
9
final class LangInstall extends BaseCommand
10
{
11
    protected $signature = 'lang:install'
12
    . ' {locales* : Space-separated list of, eg: de tk it}'
13
    . ' {--f|force : Override exiting files}'
14
    . ' {--j|json : Install JSON files}';
15
16
    protected $description = 'Install new localizations.';
17
18 12
    public function handle()
19
    {
20 12
        $this->setProcessor(PublishPhp::class, PublishJson::class);
21
22 12
        $this->exec(
23 12
            Locale::available()
24
        );
25
26
        $this->result
27
            ->setMessage('Files were not copied.')
28
            ->show();
29
    }
30
}
31