ProcessImage   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

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

2 Methods

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