Passed
Branch master (cd4548)
by Fèvre
19:36
created

ResetPassword::toMail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

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

37
    public function via(/** @scrutinizer ignore-unused */ $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...
38
    {
39
        return ['mail'];
40
    }
41
42
    /**
43
     * Build the mail representation of the notification.
44
     *
45
     * @param mixed $notifiable
46
     *
47
     * @return \Illuminate\Notifications\Messages\MailMessage
48
     */
49
    public function toMail($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

49
    public function toMail(/** @scrutinizer ignore-unused */ $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...
50
    {
51
        return (new MailMessage)
52
            ->line('You received this email because we received a password reset request for your account.')
53
            ->line('If you have not requested a password reset, no further action is required ' .
54
                        'and you can ignore this email.')
55
            ->action(
56
                'Reset my Password',
57
                url(config('app.url') . route('users.auth.password.reset', $this->token, false))
58
            )
59
            ->level('primary')
60
            ->subject('Password Reset - ' . config('app.name'))
61
            ->from(config('xetaravel.site.contact_email'), config('app.name'));
62
    }
63
}
64