Passed
Push — main ( 3f2cb1...ed2a6d )
by Andrey
86:25 queued 84:06
created

Install   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 23
ccs 11
cts 11
cp 1
rs 10
c 1
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 1
A run() 0 11 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 12
    public function run(): string
10
    {
11 12
        $this->log('Start the handler for execution:', self::class);
12
13 12
        if ($this->force || $this->doesntExists()) {
14 12
            $this->process();
15
16 12
            return Status::COPIED;
17
        }
18
19 1
        return Status::SKIPPED;
20
    }
21
22 12
    protected function process(): void
23
    {
24 12
        $source = $this->load($this->source_path);
25 12
        $target = $this->load($this->target_path);
26
27 12
        $result = $this->compare($source, $target);
28
29 12
        $this->store($this->target_path, $result);
30 12
    }
31
}
32