SendAccountChangedEmail::__construct()   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
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Jobs;
4
5
use App\Mail\AccountChange;
6
use App\Models\User;
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\Mail;
13
14
class SendAccountChangedEmail implements ShouldQueue
15
{
16
    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\SendAccountChangedEmail: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
introduced by
The trait Illuminate\Queue\InteractsWithQueue requires some properties which are not provided by App\Jobs\SendAccountChangedEmail: $failedWith, $releaseDelay
Loading history...
17
18
    private User $user;
19
20
    /**
21
     * Create a new job instance.
22
     */
23
    public function __construct(User $user)
24
    {
25
        $this->user = $user;
26
    }
27
28
    /**
29
     * Execute the job.
30
     */
31
    public function handle(): void
32
    {
33
        Mail::to($this->user->email)->send(new AccountChange($this->user));
34
    }
35
}
36