HasSuffixOption   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A getSuffix() 0 8 2
1
<?php
2
3
namespace LaraGeoData\Console\Commands;
4
5
use Illuminate\Support\Str;
6
7
trait HasSuffixOption
8
{
9
    /**
10
     * Get formatted suffix.
11
     *
12
     * @return string|null
13
     */
14 13
    protected function getSuffix(): ?string
15
    {
16 13
        $suffix = $this->option('suffix');
0 ignored issues
show
Bug introduced by
It seems like option() 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

16
        /** @scrutinizer ignore-call */ 
17
        $suffix = $this->option('suffix');
Loading history...
17 13
        if ($suffix) {
18 9
            $suffix = Str::snake($suffix);
19
        }
20
21 13
        return $suffix;
22
    }
23
}
24