Passed
Pull Request — main (#123)
by Andrey
29:01 queued 13:53
created

Base   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 24
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A load() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Helldar\LaravelLangPublisher\Comparators;
6
7
use Helldar\Contracts\LangPublisher\Comparator;
8
use Helldar\LaravelLangPublisher\Concerns\Paths;
9
use Helldar\LaravelLangPublisher\Facades\Support\Filesystem;
10
11
abstract class Base implements Comparator
12
{
13
    use Paths;
14
15
    protected $keys = [];
16
17
    protected $translations = [];
18
19
    protected $force;
20
21
    public function __construct(array $keys, array $translations, bool $force)
22
    {
23
        $this->keys = $keys;
24
25
        $this->translations = $translations;
26
27
        $this->force = $force;
28
    }
29
30
    protected function load(string $filename): array
31
    {
32
        $path = $this->resourcesPath($filename);
33
34
        return Filesystem::load($path);
35
    }
36
}
37