Passed
Push — main ( 9ad958...bccbba )
by Andrey
72:16 queued 69:33
created

Install::run()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 18
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 3.072

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 9
nc 2
nop 0
dl 0
loc 18
ccs 8
cts 10
cp 0.8
crap 3.072
rs 9.9666
c 1
b 0
f 0
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Services\Processors;
4
5
use Helldar\LaravelLangPublisher\Constants\Status;
6
7
final class Install extends Processor
8
{
9 9
    public function run(): string
10
    {
11 9
        $this->log('Start the handler for execution:', self::class);
12
13 9
        if (! $this->force && $this->exists()) {
14
            $this->log('Skip processing:', self::class);
15
16
            return Status::SKIPPED;
17
        }
18
19 9
        $source = $this->load($this->source_path);
20 9
        $target = $this->load($this->target_path);
21
22 9
        $result = $this->compare($source, $target);
23
24 9
        $this->store($this->target_path, $result);
25
26 9
        return Status::COPIED;
27
    }
28
}
29