Passed
Push — master ( 68f9e3...36b0af )
by Andrey
02:57 queued 39s
created

Localization   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A run() 0 6 1
A setPath() 0 5 1
A setProcessor() 0 5 1
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Services;
4
5
use Helldar\LaravelLangPublisher\Contracts\Localizationable;
6
use Helldar\LaravelLangPublisher\Contracts\Pathable;
7
use Helldar\LaravelLangPublisher\Contracts\Processor;
8
use Helldar\LaravelLangPublisher\Traits\Containable;
9
10
final class Localization implements Localizationable
11
{
12
    use Containable;
13
14
    /** @var \Helldar\LaravelLangPublisher\Contracts\Pathable */
15
    protected $path;
16
17
    /** @var \Helldar\LaravelLangPublisher\Contracts\Processor */
18
    protected $processor;
19
20
    /** @var array */
21
    protected $result = [];
22
23 78
    public function setPath(Pathable $path): Localizationable
24
    {
25 78
        $this->path = $path;
26
27 78
        return $this;
28
    }
29
30 78
    public function setProcessor(Processor $processor): Localizationable
31
    {
32 78
        $this->processor = $processor;
33
34 78
        return $this;
35
    }
36
37 78
    public function run(string $locale, bool $force = false): array
38
    {
39 78
        return $this->processor
40 78
            ->locale($locale)
41 78
            ->force($force)
42 78
            ->run();
43
    }
44
}
45