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

Base::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 0
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