Completed
Push — master ( c3e39f...37ed4c )
by Freek
03:52
created

RefreshesPermissionCache::forgetCachedPermissions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Spatie\Permission\Traits;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Spatie\Permission\PermissionRegistrar;
7
8
trait RefreshesPermissionCache
9
{
10
    public static function bootRefreshesPermissionCache()
11
    {
12
        static::created(function (Model $model) {
0 ignored issues
show
Unused Code introduced by
The parameter $model 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...
13
            app(PermissionRegistrar::class)->forgetCachedPermissions();
14
        });
15
16
        static::updated(function (Model $model) {
0 ignored issues
show
Unused Code introduced by
The parameter $model 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
            app(PermissionRegistrar::class)->forgetCachedPermissions();
18
        });
19
20
        static::deleted(function (Model $model) {
0 ignored issues
show
Unused Code introduced by
The parameter $model 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...
21
            app(PermissionRegistrar::class)->forgetCachedPermissions();
22
        });
23
    }
24
}
25