Passed
Push — main ( 55f929...127e84 )
by Andrey
161:41 queued 158:10
created

Install::run()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 3.0175

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 7
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 14
ccs 7
cts 8
cp 0.875
crap 3.0175
rs 10
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
        if (! $this->force && $this->exists()) {
12
            return Status::SKIPPED;
13
        }
14
15 9
        $source = $this->load($this->source_path);
16 9
        $target = $this->load($this->target_path);
17
18 9
        $result = $this->compare($source, $target);
19
20 9
        $this->store($this->target_path, $result);
21
22 9
        return Status::COPIED;
23
    }
24
}
25