Passed
Push — 9.x ( 025072...127945 )
by Andrey
15:06
created

Add::processor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
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
    protected function processor(): ProcessorContract
21
    {
22
        $this->log('Getting the processor: ' . Processor::class);
23
24
        return Processor::make()->force($this->hasForce());
25
    }
26
27
    protected function targetLocales(): array
28
    {
29
        $this->log('Getting a list of installed localizations...');
30
31
        return Locales::available();
32
    }
33
}
34