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

PermissionObserver   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 17
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A saved() 0 4 1
A deleted() 0 4 1
A clearCache() 0 4 1
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