Passed
Push — master ( a7279d...feb425 )
by Andrey
11:45
created

BaseProcess::locale()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Services\Processing;
4
5
use Helldar\LaravelLangPublisher\Contracts\Process;
6
use Helldar\LaravelLangPublisher\Facades\File;
7
8
use function compact;
9
10
abstract class BaseProcess implements Process
11
{
12
    /** @var string */
13
    protected $locale;
14
15
    /** @var bool */
16
    protected $force;
17
18
    protected $result = [];
19
20
    public function locale(string $locale): self
21
    {
22
        $this->locale = $locale;
23
24
        return $this;
25
    }
26
27
    public function force(bool $force = false): self
28
    {
29
        $this->force = $force;
30
31
        return $this;
32
    }
33
34
    public function result(): array
35
    {
36
        return $this->result;
37
    }
38
39
    protected function push(string $filename, string $status): void
40
    {
41
        $locale = $this->locale;
42
43
        $this->result[] = compact('locale', 'filename', 'status');
44
    }
45
46
    protected function checkExists(string $path): void
47
    {
48
        File::directoryExists($path, $this->locale);
49
    }
50
}
51