NotifyLKChannel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 17
ccs 7
cts 7
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A send() 0 8 1
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