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

DeleteJson   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 8
c 1
b 0
f 0
dl 0
loc 15
ccs 5
cts 6
cp 0.8333
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A delete() 0 9 3
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Services\Processors;
4
5
use Helldar\LaravelLangPublisher\Traits\Processors\Deletable;
6
use Illuminate\Support\Facades\File as IlluminateFile;
7
8
final class DeleteJson extends BaseProcessor
9
{
10
    use Deletable;
11
12
    protected $extension = 'json';
13
14 12
    protected function delete(): bool
15
    {
16 12
        if (! IlluminateFile::exists($this->targetPath())) {
17 6
            return true;
18
        }
19
20 6
        return ! $this->isProtected()
21
            ? IlluminateFile::delete($this->targetPath())
22 6
            : false;
23
    }
24
}
25