S3Upload   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

2 Methods

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