Passed
Pull Request — main (#123)
by Andrey
58:10 queued 43:14
created

Has::hasJson()   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\Concerns;
4
5
use Helldar\LaravelLangPublisher\Facades\Path;
6
use Helldar\Support\Facades\Helpers\Str;
7
8
trait Has
9
{
10
    protected function hasJson(string $filename): bool
11
    {
12
        $extension = Path::extension($filename);
13
14
        return Str::lower($extension) === 'json';
15
    }
16
}
17