ResetPassword::via()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Xetaravel\Notifications\Auth;
6
7
use Illuminate\Bus\Queueable;
8
use Illuminate\Contracts\Queue\ShouldQueue;
9
use Illuminate\Notifications\Notification;
10
use Illuminate\Notifications\Messages\MailMessage;
11
12
class ResetPassword extends Notification implements ShouldQueue
13
{
14
    use Queueable;
15
16
    /**
17
     * The password reset token.
18
     *
19
     * @var string
20
     */
21
    public string $token;
22
23
    /**
24
     * Create a notification instance.
25
     *
26
     * @param string $token
27
     */
28
    public function __construct(string $token)
29
    {
30
        $this->token = $token;
31
    }
32
33
    /**
34
     * Get the notification's channels.
35
     *
36
     * @param mixed $notifiable
37
     *
38
     * @return array
39
     */
40
    public function via(mixed $notifiable): array
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

40
    public function via(/** @scrutinizer ignore-unused */ mixed $notifiable): array

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    {
42
        return ['mail'];
43
    }
44
45
    /**
46
     * Build the mail representation of the notification.
47
     *
48
     * @param mixed $notifiable
49
     *
50
     * @return MailMessage
51
     */
52
    public function toMail(mixed $notifiable): MailMessage
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

52
    public function toMail(/** @scrutinizer ignore-unused */ mixed $notifiable): MailMessage

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
    {
54
        return (new MailMessage())
55
            ->line('You received this email because we received a password reset request for your account.')
56
            ->line('If you have not requested a password reset, no further action is required ' .
57
                        'and you can ignore this email.')
58
            ->action(
59
                'Reset my Password',
60
                url(config('app.url') . route('auth.password.reset', $this->token, false))
61
            )
62
            ->level('primary')
63
            ->subject('Password Reset - ' . config('app.name'))
64
            ->from(config('xetaravel.site.contact_email'), config('app.name'));
65
    }
66
}
67