Completed
Push — master ( f8ccd7...a2ea8b )
by Sherif
13:39
created

ResetPassword   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 42
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A via() 0 4 1
A toMail() 0 8 1
1
<?php
2
3
namespace App\Modules\V1\Notifications\Notifications;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Notifications\Notification;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Notifications\Messages\MailMessage;
9
use Illuminate\Notifications\Messages\BroadcastMessage;
10
11
class ResetPassword extends Notification implements ShouldQueue
12
{
13
    use Queueable;
14
15
    protected $token;
16
17
    /**
18
     * Create a new notification instance.
19
     *
20
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
21
     */
22
    public function __construct($token)
23
    {
24
        $this->$token = $token;
25
    }
26
27
    /**
28
     * Get the notification's delivery channels.
29
     *
30
     * @param  mixed  $notifiable
31
     * @return array
32
     */
33
    public function via($notifiable)
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed.

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

Loading history...
34
    {
35
        return ['mail'];
36
    }
37
38
    /**
39
     * Get the mail representation of the notification.
40
     *
41
     * @param  mixed  $notifiable
42
     * @return \Illuminate\Notifications\Messages\MailMessage
43
     */
44
    public function toMail($notifiable)
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed.

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

Loading history...
45
    {
46
        return (new MailMessage)
47
            ->subject('Reset passowrd')
48
            ->line('Reset passowrd')
49
            ->line('To reset your password click on the button below')
50
            ->action('Reset password', env('RESET_PASSWORD_URL') . '/' . $this->token);
51
    }
52
}