Passed
Pull Request — main (#123)
by Andrey
29:01 queued 13:53
created

Has::hasJson()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 2
c 2
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/*
4
 * This file is part of the "andrey-helldar/laravel-lang-publisher" project.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @author Andrey Helldar <[email protected]>
10
 *
11
 * @copyright 2021 Andrey Helldar
12
 *
13
 * @license MIT
14
 *
15
 * @see https://github.com/andrey-helldar/laravel-lang-publisher
16
 */
17
18
declare(strict_types=1);
19
20
namespace Helldar\LaravelLangPublisher\Concerns;
21
22
use Helldar\Support\Facades\Helpers\Str;
23
24
/**
25
 * @mixin \Helldar\LaravelLangPublisher\Concerns\Paths
26
 */
27
trait Has
28
{
29
    protected function hasJson(string $filename): bool
30
    {
31
        $extension = $this->extension($filename);
0 ignored issues
show
Bug introduced by
It seems like extension() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

31
        /** @scrutinizer ignore-call */ 
32
        $extension = $this->extension($filename);
Loading history...
32
33
        return Str::lower($extension) === 'json';
34
    }
35
}
36