Passed
Push — dev5a ( c41270...352680 )
by Ron
07:09
created

GenericDatabaseNotification::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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

31
    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...
32
    {
33 24
        return ['database'];
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
    //                 ->line('The introduction to the notification.')
46
    //                 ->action('Notification Action', url('/'))
47
    //                 ->line('Thank you for using our application!');
48
    // }
49
50
    /**
51
     * Get the array representation of the notification.
52
     *
53
     * @param  mixed  $notifiable
54
     * @return array
55
     */
56 24
    public function toArray($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

56
    public function toArray(/** @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...
57
    {
58
        return [
59 24
            'type'    => 'notification',
60 24
            'message' => $this->message,
61
            'link'    => null,
62
        ];
63
    }
64
}
65