ManualReminder::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\Loan;
6
use App\Mail\ManualReminderEmail;
7
use Illuminate\Bus\Queueable;
8
use Illuminate\Notifications\Notification;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
11
class ManualReminder extends Notification
12
{
13
    use Queueable;
14
15
    public $loan_id;
16
    public $email;
17
18
    /**
19
     * Create a new notification instance.
20
     *
21
     * @param Loan $loan
22
     * @param $subject
23
     * @param $body
24
     */
25
    public function __construct(Loan $loan, $subject, $body)
26
    {
27
        $this->loan_id = $loan->id;
28
        $this->email = new ManualReminderEmail($loan, $subject, $body);
29
    }
30
31
    /**
32
     * Get the notification's delivery channels.
33
     *
34
     * @param  mixed  $notifiable
35
     * @return array
36
     */
37
    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

37
    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...
38
    {
39
        return ['mail', ExtendedDatabaseChannel::class];
40
    }
41
42
    /**
43
     * Get the mail representation of the notification.
44
     *
45
     * @param  mixed $notifiable
46
     * @return ManualReminderEmail
47
     */
48
    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

48
    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...
49
    {
50
        return $this->email;
51
    }
52
53
    /**
54
     * Get the array representation of the notification.
55
     *
56
     * @param  mixed  $notifiable
57
     * @return array
58
     */
59
    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

59
    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...
60
    {
61
        return [
62
            'loan_id' => $this->loan_id,
63
            'email' => $this->email->toArray(),
64
        ];
65
    }
66
}
67