SendAccountWillExpireEmail   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 7
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 3 1
1
<?php
2
3
namespace App\Jobs;
4
5
use App\Mail\AccountWillExpire;
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 Illuminate\Support\Facades\Mail;
12
13
class SendAccountWillExpireEmail implements ShouldQueue
14
{
15
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Jobs\SendAccountWillExpireEmail: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
introduced by
The trait Illuminate\Queue\InteractsWithQueue requires some properties which are not provided by App\Jobs\SendAccountWillExpireEmail: $failedWith, $releaseDelay
Loading history...
16
17
    private $days;
18
19
    private $user;
20
21
    /**
22
     * Create a new job instance.
23
     *
24
     * @return void
25
     */
26
    public function __construct($user, $days)
27
    {
28
        $this->user = $user;
29
        $this->days = $days;
30
    }
31
32
    /**
33
     * Execute the job.
34
     */
35
    public function handle(): void
36
    {
37
        Mail::to($this->user->email)->send(new AccountWillExpire($this->user, $this->days));
38
    }
39
}
40