Completed
Push — master ( 033792...9fc33c )
by Innocent
01:20
created

S3Upload::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace FaithGen\News\Jobs;
4
5
use FaithGen\News\Models\News;
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
use Illuminate\Support\Facades\Log;
13
14
class S3Upload implements ShouldQueue
15
{
16
    use Dispatchable,
17
        InteractsWithQueue,
18
        Queueable,
19
        SerializesModels,
20
        SavesToAmazonS3;
21
22
    public bool $deleteWhenMissingModels = true;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
23
    protected News $article;
24
25
    /**
26
     * Create a new job instance.
27
     *
28
     * @param News $article
29
     */
30
    public function __construct(News $article)
31
    {
32
        $this->article = $article;
33
    }
34
35
    /**
36
     * Execute the job.
37
     *
38
     * @return void
39
     */
40
    public function handle()
41
    {
42
        try {
43
            $this->saveFiles($this->article);
44
        } catch (\Exception $e) {
45
            Log::error($e->getMessage());
46
        }
47
    }
48
}
49