SendInviteEmail::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Jobs;
4
5
use App\Mail\SendInvite;
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 SendInviteEmail 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\SendInviteEmail: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
introduced by
The trait Illuminate\Queue\InteractsWithQueue requires some properties which are not provided by App\Jobs\SendInviteEmail: $failedWith, $releaseDelay
Loading history...
16
17
    private $email;
18
19
    private $userId;
0 ignored issues
show
introduced by
The private property $userId is not used, and could be removed.
Loading history...
20
21
    private $url;
22
23
    /**
24
     * @var \App\Models\User
25
     */
26
    private $user;
27
28
    /**
29
     * SendInviteEmail constructor.
30
     */
31
    public function __construct($email, $user, $url)
32
    {
33
        $this->email = $email;
34
        $this->user = $user;
35
        $this->url = $url;
36
    }
37
38
    /**
39
     * Execute the job.
40
     */
41
    public function handle(): void
42
    {
43
        Mail::to($this->email)->send(new SendInvite($this->user, $this->url));
44
    }
45
}
46