Setting   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 4
Bugs 0 Features 0
Metric Value
wmc 1
c 4
b 0
f 0
lcom 0
cbo 1
dl 0
loc 11
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCacheKeyAttribute() 0 5 1
1
<?php
2
3
namespace Merodiro\Settings\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Setting extends Model
8
{
9
    protected $fillable = ['key', 'value', 'owner_id'];
10
11
12 40
    public function getCacheKeyAttribute()
13
    {
14 40
        $suffix = $this->owner_id ?? 'global';
15 40
        return config('settings.cache_prefix') . $this->key . '_' . $suffix;
16
    }
17
}
18