EmailVerification   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 3
dl 0
loc 56
ccs 0
cts 13
cp 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A via() 0 4 1
A toMail() 0 9 1
A toArray() 0 6 1
1
<?php
2
3
namespace App\Notifications;
4
5
use App\User;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Notifications\Messages\MailMessage;
8
use Illuminate\Notifications\Notification;
9
10
class EmailVerification extends Notification
11
{
12
    use Queueable;
13
14
    protected $user;
15
16
    /**
17
     * Create a new notification instance.
18
     *
19
     * @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...
20
     */
21
    public function __construct(User $user)
22
    {
23
        $this->user = $user;
24
    }
25
26
    /**
27
     * Get the notification's delivery channels.
28
     *
29
     * @param  mixed  $notifiable
30
     * @return string[]
31
     */
32
    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...
33
    {
34
        return ['mail'];
35
    }
36
37
    /**
38
     * Get the mail representation of the notification.
39
     *
40
     * @param  mixed  $notifiable
41
     * @return \Illuminate\Notifications\Messages\MailMessage
42
     */
43
    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...
44
    {
45
        $url = url('/email/verify/{token}');
0 ignored issues
show
Unused Code introduced by
$url is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
46
47
        return (new MailMessage)->view(
48
            'emails.verify',
49
            ['user' => $this->user]
50
        );
51
    }
52
53
    /**
54
     * Get the array representation of the notification.
55
     *
56
     * @param  mixed  $notifiable
57
     * @return array
58
     */
59
    public function toArray($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...
60
    {
61
        return [
62
            //
63
        ];
64
    }
65
}
66