Completed
Push — master ( 80411a...1281a7 )
by wen
03:35
created

PermissionObserver::clearCache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
4
namespace Sco\Admin\Observers;
5
6
use Cache;
7
use Sco\Admin\Models\Permission;
8
9
class PermissionObserver
10
{
11
    public function saved(Permission $permission)
0 ignored issues
show
Unused Code introduced by
The parameter $permission is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
12
    {
13
        $this->clearCache();
14
    }
15
16
    public function deleted(Permission $permission)
0 ignored issues
show
Unused Code introduced by
The parameter $permission is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
17
    {
18
        $this->clearCache();
19
    }
20
21
    private function clearCache()
22
    {
23
        Cache::forget('permission_all');
24
    }
25
}
26