ExpiringEventMailNotification::via()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

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
rs 10
1
<?php
2
3
namespace App\Notifications;
4
5
use App\Models\Event;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Notifications\Messages\MailMessage;
9
use Illuminate\Notifications\Notification;
10
11
class ExpiringEventMailNotification extends Notification
12
{
13
    use Queueable;
14
15
    protected array $senderData;
16
    protected Event $event;
17
18
    /**
19
     * Create a new notification instance.
20
     *
21
     * @param array $senderData
22
     * @param \App\Models\Event $event
23
     */
24
    public function __construct(array $senderData, Event $event)
25
    {
26
        $this->senderData = $senderData;
27
        $this->event = $event;
28
    }
29
30
    /**
31
     * Get the notification's delivery channels.
32
     *
33
     * @param  mixed  $notifiable
34
     * @return array
35
     */
36
    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

36
    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...
37
    {
38
        return ['mail'];
39
    }
40
41
    /**
42
     * Get the mail representation of the notification.
43
     *
44
     * @param  mixed  $notifiable
45
     * @return \Illuminate\Notifications\Messages\MailMessage
46
     */
47
    public function toMail($notifiable): MailMessage
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

47
    public function toMail(/** @scrutinizer ignore-unused */ $notifiable): MailMessage

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...
48
    {
49
        return (new MailMessage())
50
            ->subject('Expiring Event - CI Global Calendar')
51
            ->markdown('mail.expiringEvent', [
52
                'event' => $this->event,
53
                'senderData' => $this->senderData
54
            ]);
55
    }
56
57
    /**
58
     * Get the array representation of the notification.
59
     *
60
     * @param  mixed  $notifiable
61
     * @return array
62
     */
63
    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

63
    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...
64
    {
65
        return [
66
            //
67
        ];
68
    }
69
}
70