Issues (54)

src/Jobs/RemoveUserMenuCache.php (2 issues)

1
<?php
2
3
namespace PhpCollective\MenuMaker\Jobs;
4
5
use Cache;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Queue\SerializesModels;
8
use Illuminate\Queue\InteractsWithQueue;
9
use PhpCollective\MenuMaker\Storage\Menu;
10
use Illuminate\Foundation\Bus\Dispatchable;
11
use Illuminate\Contracts\Queue\ShouldQueue;
12
13
class RemoveUserMenuCache implements ShouldQueue
14
{
15
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
0 ignored issues
show
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by PhpCollective\MenuMaker\Jobs\RemoveUserMenuCache: $id, $relations, $class, $keyBy
Loading history...
16
17
    protected $user;
18
19
    /**
20
     * Create a new job instance.
21
     *
22
     * @param  MenuUser  $user
0 ignored issues
show
The type PhpCollective\MenuMaker\Jobs\MenuUser was not found. Maybe you did not declare it correctly or list all dependencies?

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:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
23
     * @return void
24
     */
25
    public function __construct($user)
26
    {
27
        $this->user = $user;
28
    }
29
30
    /**
31
     * Execute the job.
32
     *
33
     * @return void
34
     */
35
    public function handle()
36
    {
37
        Menu::sections()->get()->each(function ($section) {
38
            Cache::forget('menus.section.' . $section->id . '.user.' . $this->user->id);
39
        });
40
    }
41
}
42