Completed
Push — master ( 8a4f85...f304b0 )
by Sherif
02:40
created

ConfirmEmail::via()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Modules\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 View Code Duplication
class ConfirmEmail extends Notification implements ShouldQueue
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
12
{
13
    use Queueable;
14
15
    /**
16
     * Create a new notification instance.
17
     *
18
     * @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...
19
     */
20
    public function __construct()
21
    {
22
        //
23
    }
24
25
    /**
26
     * Get the notification's delivery channels.
27
     *
28
     * @param  mixed  $notifiable
29
     * @return array
30
     */
31
    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...
32
    {
33
        return ['mail'];
34
    }
35
36
    /**
37
     * Get the mail representation of the notification.
38
     *
39
     * @param  mixed  $notifiable
40
     * @return \Illuminate\Notifications\Messages\MailMessage
41
     */
42
    public function toMail($notifiable)
43
    {
44
        return (new MailMessage)
45
            ->subject('Email verification')
46
            ->line('Email verification')
47
            ->line('To validate your email click on the button below')
48
            ->action('Verify your email', config('confrim_email_url') . '/' . $notifiable->confirmation_code);
49
    }
50
}