Passed
Push — dev6 ( 77ef26...6e2ff7 )
by Ron
16:42
created

SendWelcomeEmail::toMail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
rs 10
ccs 7
cts 7
cp 1
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
namespace App\Notifications;
4
5
use App\Models\User;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Notifications\Messages\MailMessage;
9
use Illuminate\Notifications\Notification;
10
11
class SendWelcomeEmail extends Notification
12
{
13
    use Queueable;
14
15
    protected $user;
16
    protected $token;
17
18
    /**
19
     * Create a new notification instance
20
     */
21 1
    public function __construct(User $user, $token)
22
    {
23 1
        $this->user  = $user;
24 1
        $this->token = $token;
25 1
    }
26
27
    /**
28
     * Get the notification's delivery channels
29
     */
30 1
    public function via($notifiable)
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

30
    public function via(/** @scrutinizer ignore-unused */ $notifiable)

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...
31
    {
32 1
        return ['mail'];
33
    }
34
35
    /**
36
     * Get the mail representation of the notification
37
     */
38 1
    public function toMail($notifiable)
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

38
    public function toMail(/** @scrutinizer ignore-unused */ $notifiable)

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...
39
    {
40 1
        return (new MailMessage)
41 1
                    ->greeting('Hello '.$this->user->full_name)
42 1
                    ->line('A new '.config('app.name').' account has been created for you.')
43 1
                    ->line('Your new username is:  **'.$this->user->username.'**')
44 1
                    ->line('You can click the link below to finish setting up your account.')
45 1
                    ->action('Setup Account', url(route('initialize', $this->token)));
46
    }
47
}
48