Completed
Push — dev ( 2d3105...cb6296 )
by Amr
02:54
created

SettingObserver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A deleted() 0 8 2
1
<?php
2
3
namespace Merodiro\Settings\Observers;
4
5
use Illuminate\Support\Facades\Cache;
6
use Merodiro\Settings\Models\Setting;
7
8
class SettingObserver
9
{
10 8
    public function deleted(Setting $setting)
11
    {
12 8
        $suffix = $setting->owner_id ? $setting->owner_id: 'global';
13
14 8
        $cache_key = config('settings.cache_prefix') . $setting->key . '_' . $suffix;
15
16 8
        Cache::forget($cache_key);
17 8
    }
18
}
19