Issues (32)

src/Traits/RefreshesPermissionCache.php (1 issue)

Labels
Severity
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
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