Country   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 17
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Support\Facades\Cache;
7
8
class Country extends Model
9
{
10
11
    public $timestamps = true;
12
    protected $table = 'countries';
13
14
    public static function getAll()
15
    {
16 4
        return Cache::rememberForever('countries', function () {
17 4
            return static::all();
18 4
        });
19
    }
20
21
    public static function getAllPlucked()
22
    {
23 5
        return Cache::rememberForever('countries_pluck', function () {
24 5
            return static::pluck('name', 'id');
25 5
        });
26
    }
27
28
}