PublishPhp::publish()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 6
ccs 4
cts 4
cp 1
rs 10
c 1
b 0
f 0
cc 2
nc 2
nop 0
crap 2
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
        $this->checkExists($this->sourcePath());
17 12
18
        foreach (File::files($this->sourcePath()) as $file) {
19 12
            $this->publishFile($file);
20
        }
21 12
    }
22
23 12
    protected function excluded(array $array, string $filename): array
24
    {
25 12
        $key  = File::name($filename);
26
        $keys = Config::getExclude($key, []);
27
28
        return Arr::only($array, $keys);
29
    }
30
}
31