PasswordReset   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 1 Features 0
Metric Value
eloc 5
c 3
b 1
f 0
dl 0
loc 17
rs 10
ccs 5
cts 5
cp 1
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A toMail() 0 3 1
A via() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace App\Notifications\User;
6
7
use App\Mail\User\PasswordReset as PasswordResetMail;
8
use App\Models\User;
9
use Illuminate\Notifications\Notification;
10
11
final class PasswordReset extends Notification
12
{
13
    public string $token;
14
15
    public function __construct(string $token)
16
    {
17
        $this->token = $token;
18
    }
19 3
20
    public function via(): array
21 3
    {
22 3
        return ['mail'];
23
    }
24 2
25
    public function toMail(User $user): PasswordResetMail
26 2
    {
27
        return new PasswordResetMail($user, $this->token);
28
    }
29
}
30