Language::scopeWithoutCurrentLanguage()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php namespace Distilleries\Expendable\Models;
2
3
class Language extends BaseModel {
4
5
    use \Distilleries\Expendable\Models\StatusTrait;
6
7
    protected $fillable = [
8
        'libelle',
9
        'iso',
10
        'not_visible',
11
        'is_default',
12
        'status',
13
    ];
14
15
    public function scopeWithoutCurrentLanguage($query)
16
    {
17
        return $query->where($this->getTable().'.iso', '<>', app()->getLocale());
0 ignored issues
show
introduced by
The method getLocale() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

17
        return $query->where($this->getTable().'.iso', '<>', app()->/** @scrutinizer ignore-call */ getLocale());
Loading history...
18
    }
19
20
    public function scopeWithTranslationElement($query)
21
    {
22
        return $query->where($this->getTable().'.iso', '<>', app()->getLocale());
23
    }
24
}