Passed
Push — master ( c97482...68f9e3 )
by Andrey
07:00 queued 04:30
created

BaseCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
eloc 9
c 3
b 0
f 0
dl 0
loc 30
ccs 11
cts 11
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A locales() 0 3 1
A __construct() 0 7 1
A isJson() 0 3 1
A isForce() 0 3 1
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Console;
4
5
use Helldar\LaravelLangPublisher\Services\Localization;
6
use Helldar\LaravelLangPublisher\Support\Result;
7
use Illuminate\Console\Command;
8
9
abstract class BaseCommand extends Command
10
{
11
    /** @var \Helldar\LaravelLangPublisher\Services\Localization */
12
    protected $localization;
13
14
    /** @var \Helldar\LaravelLangPublisher\Support\Result */
15
    protected $result;
16
17 36
    public function __construct(Localization $localization, Result $result)
18
    {
19 36
        parent::__construct();
20
21 36
        $this->localization = $localization;
22
23 36
        $this->result = $result->setOutput($this);
24 36
    }
25
26 12
    protected function locales(): array
27
    {
28 12
        return (array) $this->argument('locales');
29
    }
30
31 12
    protected function isForce(): bool
32
    {
33 12
        return (bool) $this->option('force');
34
    }
35
36 12
    protected function isJson(): bool
37
    {
38 12
        return (bool) $this->option('json');
39
    }
40
}
41