Completed
Push — master ( c0d96b...f1fd23 )
by Maxime
07:29
created

ResetPasswordNotification::toMail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace Distilleries\Expendable\Mails;
4
5
use Illuminate\Auth\Notifications\ResetPassword;
6
use Illuminate\Notifications\Messages\MailMessage;
7
8
/**
9
 * Created by PhpStorm.
10
 * User: mfrancois
11
 * Date: 27/02/2017
12
 * Time: 18:01
13
 */
14
class ResetPasswordNotification extends ResetPassword
15
{
16
17
    /**
18
     * Build the mail representation of the notification.
19
     *
20
     * @param  mixed  $notifiable
21
     * @return \Illuminate\Notifications\Messages\MailMessage
22
     */
23
    public function toMail($notifiable)
24
    {
25
        return (new MailMessage)
26
            ->line('You are receiving this email because we received a password reset request for your account.')
27
            ->action('Reset Password', url('login/reset', $this->token))
0 ignored issues
show
Bug introduced by
It seems like url('login/reset', $this->token) targeting url() can also be of type object<Illuminate\Contracts\Routing\UrlGenerator>; however, Illuminate\Notifications...SimpleMessage::action() does only seem to accept string, maybe add an additional type check?

This check looks at variables that are passed out again to other methods.

If the outgoing method call has stricter type requirements than the method itself, an issue is raised.

An additional type check may prevent trouble.

Loading history...
28
            ->line('If you did not request a password reset, no further action is required.');
29
    }
30
31
}