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

BaseCommand::isJson()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 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