Passed
Push — 9.x ( d63f62...9358ea )
by Andrey
20:32 queued 05:32
created

Install::run()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 5
nc 2
nop 0
dl 0
loc 11
rs 10
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
    public function run(): string
10
    {
11
        $this->log('Start the handler for execution:', self::class);
12
13
        if ($this->force || $this->doesntExists()) {
14
            $this->process();
15
16
            return Status::COPIED;
17
        }
18
19
        return Status::SKIPPED;
20
    }
21
22
    protected function process(): void
23
    {
24
        $source = $this->load($this->source_path);
25
        $target = $this->load($this->target_path);
26
27
        $result = $this->compare($source, $target);
28
29
        $this->store($this->target_path, $result);
30
    }
31
}
32