Locale   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 31
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A current() 0 3 1
1
<?php
2
3
namespace Locale\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\Pivot;
7
use Illuminate\Database\Query\Builder;
8
9
/**
10
 * Class Locale
11
 *
12
 * @since 1.0.0
13
 * @package Locale\Models
14
 *
15
 * @method static Builder create(array $attributes)
16
 * @method static Locale find(string $id)
17
 * @method static Builder whereKey(string $id)
18
 *
19
 * @property integer id
20
 * @property string name
21
 * @property Pivot translation
22
 */
23
class Locale extends Model
24
{
25
    /**
26
     * The "type" of the auto-incrementing ID.
27
     *
28
     * @var string
29
     */
30
    protected $keyType = 'string';
31
32
    /**
33
     * Indicates if the IDs are auto-incrementing.
34
     *
35
     * @var bool
36
     */
37
    public $incrementing = false;
38
39
    /**
40
     * The attributes that aren't mass assignable.
41
     *
42
     * @since 1.0.0
43
     * @var array
44
     */
45
    protected $guarded = [];
46
47
    /**
48
     * @since 1.0.0
49
     * @return Locale
50
     */
51
    public static function current()
52
    {
53
        return Locale::find(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

53
        return Locale::find(app()->/** @scrutinizer ignore-call */ getLocale());
Loading history...
54
    }
55
}
56