UploadImage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 12
c 2
b 1
f 0
dl 0
loc 35
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
A __construct() 0 4 1
1
<?php
2
3
namespace Innoflash\Events\Jobs\Saved;
4
5
use FaithGen\SDK\Traits\UploadsImages;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Foundation\Bus\Dispatchable;
9
use Illuminate\Queue\InteractsWithQueue;
10
use Illuminate\Queue\SerializesModels;
11
use Innoflash\Events\Models\Event;
12
use Intervention\Image\ImageManager;
13
14
class UploadImage implements ShouldQueue
15
{
16
    use Dispatchable,
0 ignored issues
show
Bug introduced by
The trait FaithGen\SDK\Traits\UploadsImages requires the property $id which is not provided by Innoflash\Events\Jobs\Saved\UploadImage.
Loading history...
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by Innoflash\Events\Jobs\Saved\UploadImage: $id, $relations, $class, $keyBy
Loading history...
17
        InteractsWithQueue,
18
        Queueable,
19
        SerializesModels,
20
        UploadsImages;
21
22
    public bool $deleteWhenMissingModels = true;
23
    protected Event $event;
24
25
    protected string $image;
26
27
    /**
28
     * Create a new job instance.
29
     *
30
     * @param Event $event
31
     * @param string $image
32
     */
33
    public function __construct(Event $event, string $image)
34
    {
35
        $this->event = $event;
36
        $this->image = $image;
37
    }
38
39
    /**
40
     * Execute the job.
41
     *
42
     * @param ImageManager $imageManager
43
     *
44
     * @return void
45
     */
46
    public function handle(ImageManager $imageManager)
47
    {
48
        $this->uploadImages($this->event, [$this->image], $imageManager);
49
    }
50
}
51