Language   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 10
dl 0
loc 20
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A scopeWithoutCurrentLanguage() 0 3 1
A scopeWithTranslationElement() 0 3 1
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
}