Passed
Push — main ( 55f929...127e84 )
by Andrey
161:41 queued 158:10
created

Add::targetLocales()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Console;
4
5
use Helldar\LaravelLangPublisher\Contracts\Processor as ProcessorContract;
6
use Helldar\LaravelLangPublisher\Facades\Locales;
7
use Helldar\LaravelLangPublisher\Services\Processors\Install as Processor;
8
use Helldar\LaravelLangPublisher\Support\Actions\Add as Action;
9
10
final class Add extends BaseCommand
11
{
12
    protected $signature = 'lang:add'
13
    . ' {locales?* : Space-separated list of, eg: de tk it}'
14
    . ' {--f|force : Override exiting files}';
15
16
    protected $description = 'Install new localizations.';
17
18
    protected $action = Action::class;
19
20 8
    protected function processor(): ProcessorContract
21
    {
22 8
        $this->log('Getting the processor: ' . Processor::class);
23
24 8
        return Processor::make()->force($this->hasForce());
25
    }
26
27 9
    protected function targetLocales(): array
28
    {
29 9
        $this->log('Getting a list of installed localizations...');
30
31 9
        return Locales::available();
32
    }
33
}
34