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

Install   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 20
ccs 8
cts 10
cp 0.8
rs 10
c 1
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 18 3
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