Passed
Pull Request — main (#84)
by Andrey
49:37 queued 34:36
created

Filesystem   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A correctValues() 0 7 1
A doesntExists() 0 5 1
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Services\Filesystem;
4
5
use Helldar\LaravelLangPublisher\Concerns\Logger;
6
use Helldar\LaravelLangPublisher\Contracts\Filesystem as Contract;
7
use Helldar\Support\Facades\Helpers\Arr;
8
use Helldar\Support\Facades\Helpers\Filesystem\File;
9
10
abstract class Filesystem implements Contract
11
{
12
    use Logger;
13
14
    protected function correctValues(array $items): array
15
    {
16
        $this->log('Correcting array values...');
17
18
        return Arr::map($items, static function ($value) {
19
            return str_replace('\"', '"', $value);
20
        }, true);
21
    }
22
23
    protected function doesntExists(string $path): bool
24
    {
25
        $this->log('Checking for the existence of a path: ' . $path);
26
27
        return ! File::exists($path);
28
    }
29
}
30