LangInstall::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1.1865

Importance

Changes 4
Bugs 0 Features 0
Metric Value
eloc 6
c 4
b 0
f 0
dl 0
loc 11
ccs 3
cts 7
cp 0.4286
rs 10
cc 1
nc 1
nop 0
crap 1.1865
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
    . ' {--jet : Install Jetstream JSON files. This is an alias for "--json" key. }'
16
    . ' {--fortify : Install Fortify JSON files. This is an alias for "--json" key. }';
17
18 12
    protected $description = 'Install new localizations.';
19
20 12
    public function handle()
21
    {
22 12
        $this->setProcessor(PublishPhp::class, PublishJson::class);
23 12
24
        $this->exec(
25
            Locale::available()
26
        );
27
28
        $this->result
29
            ->setMessage('Files were not copied.')
30
            ->show();
31
    }
32
}
33