RefreshesPermissionCache   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A bootRefreshesPermissionCache() 0 8 1
1
<?php
2
3
namespace Maklad\Permission\Traits;
4
5
use Maklad\Permission\PermissionRegistrar;
6
7
/**
8
 * Trait RefreshesPermissionCache
9
 * @package Maklad\Permission\Traits
10
 */
11
trait RefreshesPermissionCache
12
{
13
    public static function bootRefreshesPermissionCache()
14
    {
15 123
        static::saved(function () {
16 123
            \app(\config('permission.models.permission'))->forgetCachedPermissions();
0 ignored issues
show
Bug introduced by
The method forgetCachedPermissions() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

16
            \app(\config('permission.models.permission'))->/** @scrutinizer ignore-call */ forgetCachedPermissions();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
17 123
        });
18
19 123
        static::deleted(function () {
20 2
            \app(\config('permission.models.permission'))->forgetCachedPermissions();
21 123
        });
22 123
    }
23
}
24