Passed
Push — dev6 ( 50a53d...e5f62e )
by Ron
15:45
created

EmailAdminForFlaggedComment::via()   A

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
eloc 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Notifications;
4
5
use App\Models\TechTip;
6
use App\Models\TechTipComment;
7
use App\Models\User;
8
use Illuminate\Bus\Queueable;
9
use Illuminate\Contracts\Queue\ShouldQueue;
10
use Illuminate\Notifications\Messages\MailMessage;
11
use Illuminate\Notifications\Notification;
12
13
class EmailAdminForFlaggedComment extends Notification
14
{
15
    use Queueable;
16
17
    public $comment;
18
    public $techTip;
19
    public $flaggedBy;
20
21
    /**
22
     * Create a new notification instance.
23
     *
24
     * @return void
25
     */
26
    public function __construct(TechTipComment $comment, User $flaggedBy)
27
    {
28
        $this->comment   = $comment;
29
        $this->techTip   = TechTip::find($comment->tip_id);
30
        $this->flaggedBy = $flaggedBy;
31
    }
32
33
    /**
34
     * Get the notification's delivery channels.
35
     *
36
     * @param  mixed  $notifiable
37
     * @return array
38
     */
39
    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

39
    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...
40
    {
41
        return ['mail'];
42
    }
43
44
    /**
45
     * Get the mail representation of the notification.
46
     *
47
     * @param  mixed  $notifiable
48
     * @return \Illuminate\Notifications\Messages\MailMessage
49
     */
50
    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

50
    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...
51
    {
52
        return (new MailMessage)
53
                    ->subject('A Tech Tip Comment has been flagged as inappropriate')
54
                    ->line('A comment on Tech Tip - '.$this->techTip->subject.' - has been flagged by '.$this->flaggedBy->full_name)
55
                    ->line('Comment - '.$this->comment->comment)
56
                    ->action('Click to view Tech Tip and all Comments', url(route('tech-tips.show', $this->techTip->slug)));
57
    }
58
59
    /**
60
     * Get the array representation of the notification.
61
     *
62
     * @param  mixed  $notifiable
63
     * @return array
64
     */
65
    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

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