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

PublishPhp   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 16
ccs 7
cts 7
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A publish() 0 4 2
A excluded() 0 5 1
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Services\Processors;
4
5
use Helldar\LaravelLangPublisher\Facades\Config;
6
use Helldar\LaravelLangPublisher\Facades\File;
7
use Helldar\LaravelLangPublisher\Traits\Processors\Publishable;
8
use Illuminate\Support\Arr;
9
10
final class PublishPhp extends BaseProcessor
11
{
12
    use Publishable;
13
14 12
    protected function publish(): void
15
    {
16 12
        foreach (File::files($this->sourcePath()) as $file) {
17 12
            $this->publishFile($file);
18
        }
19 12
    }
20
21 12
    protected function excluded(array $array, string $key): array
22
    {
23 12
        $keys = Config::getExclude($key, []);
24
25 12
        return Arr::only($array, $keys);
26
    }
27
}
28