Passed
Push — master ( d8cc68...c5f99b )
by Andrey
21:06 queued 05:59
created

ResetPhp   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A excluded() 0 6 1
A publish() 0 4 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 ResetPhp extends BaseProcessor
11
{
12
    use Publishable;
13
14
    protected function publish(): void
15
    {
16
        foreach (File::files($this->sourcePath()) as $file) {
17
            $this->resetFile($file);
18
        }
19
    }
20
21
    protected function excluded(array $array, string $filename): array
22
    {
23
        $key  = File::name($filename);
24
        $keys = Config::getExclude($key, []);
25
26
        return Arr::only($array, $keys);
27
    }
28
}
29