Passed
Push — main ( 66bbba...4d6295 )
by mohsen
03:38 queued 55s
created

LogReportNotification::toMail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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

29
    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...
30
    {
31
        $notificationChannels = config('stethoscope.notifications.notifications.' . static::class);
32
33
        return array_filter($notificationChannels);
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)
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

42
    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...
43
    {
44
        return (new MailMessage)
45
            ->subject('Stethoscope Alert')
46
            ->view('mohsenabrishami::emails.ResourceLog', [
47
                'resourceLogs' => $this->resourceLogs
48
            ]);
49
    }
50
51
    /**
52
     * Get the array representation of the notification.
53
     *
54
     * @param  mixed  $notifiable
55
     * @return array
56
     */
57
    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

57
    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...
58
    {
59
        return [
60
            //
61
        ];
62
    }
63
}
64