NotifyLKChannel::send()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 8
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace ApiChef\NotifyLK;
4
5
use Illuminate\Notifications\Notification;
6
7
class NotifyLKChannel
8
{
9
    private $notifyLKClient;
10
11 6
    public function __construct(Client $notifyLKClient)
12
    {
13 6
        $this->notifyLKClient = $notifyLKClient;
14 6
    }
15
16 6
    public function send($notifiable, Notification $notification)
17
    {
18 6
        $to = $notifiable->routeNotificationForNotifyLK($notification);
19
20
        /** @var NotifyLKMessage $message */
21 6
        $message = $notification->toNotifyLK($notifiable)->to($to);
0 ignored issues
show
Bug introduced by
The method toNotifyLK() does not exist on Illuminate\Notifications\Notification. It seems like you code against a sub-type of Illuminate\Notifications\Notification such as ApiChef\NotifyLK\TestNotification or ApiChef\NotifyLK\TestNotificationWithContact. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

21
        $message = $notification->/** @scrutinizer ignore-call */ toNotifyLK($notifiable)->to($to);
Loading history...
22
23 6
        $this->notifyLKClient->send($message);
24 6
    }
25
}
26