Passed
Pull Request — main (#84)
by Andrey
59:33 queued 44:34
created

Filesystem::doesntExists()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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