Lock   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 6

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 6
dl 0
loc 19
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 12 1
1
<?php
2
3
namespace Nikaia\TranslationSheet\Commands;
4
5
use Illuminate\Console\Command;
6
use Nikaia\TranslationSheet\Sheet\TranslationsSheet;
7
use Nikaia\TranslationSheet\Spreadsheet;
8
9
class Lock extends Command
10
{
11
    protected $signature = 'translation_sheet:lock';
12
13
    protected $description = 'Lock the spreadsheet translations area, to prevent changes.';
14
15
    public function handle(Spreadsheet $spreadsheet)
16
    {
17
        $spreadsheet->sheets()->each(function (TranslationsSheet $translationsSheet) {
18
            $this->info("Locking translation sheet [<comment>{$translationsSheet->getTitle()}</comment>] :");
19
20
            $translationsSheet->lockTranslations();
21
            $translationsSheet->api()->reset();
22
23
            $this->output->writeln('<info>Done</info>.');
24
            $this->output->writeln(PHP_EOL);
25
        });
26
    }
27
}
28