1 | <?php |
||
2 | |||
3 | namespace PhpCollective\MenuMaker\Observers; |
||
4 | |||
5 | use PhpCollective\MenuMaker\Storage\Role; |
||
6 | use PhpCollective\MenuMaker\Jobs\RemoveUserMenuCache; |
||
7 | |||
8 | class RoleObserver |
||
9 | { |
||
10 | /** |
||
11 | * Handle the Role "updated" event. |
||
12 | * |
||
13 | * @param \App\Role $group |
||
0 ignored issues
–
show
|
|||
14 | * @return void |
||
15 | */ |
||
16 | public function updated(Role $group) |
||
17 | { |
||
18 | $this->removeCache($group); |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * Handle the Role "deleting" event. |
||
23 | * |
||
24 | * @param \App\Role $group |
||
25 | * @return void |
||
26 | */ |
||
27 | public function deleting(Role $group) |
||
28 | { |
||
29 | $this->removeCache($group); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Handle the Cache delete. |
||
34 | * |
||
35 | * @param \App\Role $group |
||
36 | * @return void |
||
37 | */ |
||
38 | private function removeCache(Role $group) |
||
39 | { |
||
40 | $group->users->each(function ($user) { |
||
0 ignored issues
–
show
|
|||
41 | RemoveUserMenuCache::dispatch($user); |
||
42 | }); |
||
43 | } |
||
44 | } |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths