Passed
Push — 10.x ( 7ef113...ba9d3e )
by Andrey
13:56
created

Remove   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 19
rs 10
c 1
b 0
f 0
ccs 6
cts 6
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A targetLocales() 0 5 1
A getAllLocales() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the "andrey-helldar/laravel-lang-publisher" project.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @author Andrey Helldar <[email protected]>
10
 *
11
 * @copyright 2021 Andrey Helldar
12
 *
13
 * @license MIT
14
 *
15
 * @see https://github.com/andrey-helldar/laravel-lang-publisher
16
 */
17
18 4
declare(strict_types=1);
19
20 4
namespace Helldar\LaravelLangPublisher\Console;
21
22 4
use Helldar\LaravelLangPublisher\Facades\Helpers\Locales;
23 4
use Helldar\LaravelLangPublisher\Processors\Remove as Processor;
24
use Helldar\Support\Facades\Helpers\Arr;
25 4
26
class Remove extends Base
27 4
{
28
    protected $signature = 'lang:rm'
29 4
    . ' {locales?* : Space-separated list of, eg: de tk it}';
30
31 4
    protected $description = 'Remove localizations.';
32
33 4
    protected $processor = Processor::class;
34
35 4
    protected function targetLocales(): array
36
    {
37 4
        $locales = $this->getLocales();
38
39
        return Arr::only($locales, parent::targetLocales());
40
    }
41
42
    protected function getAllLocales(): array
43
    {
44
        return Locales::installed();
45
    }
46
}
47