Passed
Pull Request — main (#102)
by mohsen
02:41
created

LogReportNotification::toMail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
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
        return ['mail'];
32
    }
33
34
    /**
35
     * Get the mail representation of the notification.
36
     *
37
     * @param  mixed  $notifiable
38
     * @return \Illuminate\Notifications\Messages\MailMessage
39
     */
40
    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

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

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