Status::handle()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 0
cts 6
cp 0
rs 9.9666
c 0
b 0
f 0
cc 3
nc 4
nop 1
crap 12
1
<?php
2
3
namespace Nikaia\TranslationSheet\Commands;
4
5
use Illuminate\Console\Command;
6
use Nikaia\TranslationSheet\Sheet\TranslationsSheet;
7
8
class Status extends Command
9
{
10
    protected $signature = 'translation_sheet:status';
11
12
    protected $description = 'Display the status of translations : Locked / Unlocked.';
13
14
    public function handle(TranslationsSheet $translationsSheet)
15
    {
16
        $locked = $translationsSheet->isTranslationsLocked();
17
18
        $label = $locked ? 'LOCKED' : 'UNLOCKED';
19
        $style = $locked ? 'error' : 'info';
20
21
        $this->line("Translations area is <$style>$label</$style>");
22
    }
23
}
24