S3Upload::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace FaithGen\SDK\Jobs\Users;
4
5
use FaithGen\SDK\Models\User;
6
use FaithGen\SDK\Traits\SavesToAmazonS3;
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 FaithGen\SDK\Traits\SavesToAmazonS3 requires some properties which are not provided by FaithGen\SDK\Jobs\Users\S3Upload: $name, $images
Loading history...
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by FaithGen\SDK\Jobs\Users\S3Upload: $id, $relations, $class, $keyBy
Loading history...
16
        InteractsWithQueue,
17
        Queueable,
18
        SerializesModels,
19
        SavesToAmazonS3;
20
21
    public bool $deleteWhenMissingModels = true;
22
    /**
23
     * @var User
24
     */
25
    private User $user;
26
27
    /**
28
     * Create a new job instance.
29
     *
30
     * @param User $user
31
     */
32
    public function __construct(User $user)
33
    {
34
        $this->user = $user;
35
    }
36
37
    /**
38
     * Execute the job.
39
     *
40
     * @return void
41
     */
42
    public function handle()
43
    {
44
        $this->saveFiles($this->user);
45
    }
46
}
47