WhatsappChannel::send()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
3
4
namespace Artisanpay\WhatsappNotify;
5
6
7
use Illuminate\Notifications\Notification;
8
9
class WhatsappChannel
10
{
11
    /**
12
     * @param $notifiable
13
     * @param Notification $notification
14
     */
15
    public function send($notifiable, Notification $notification)
16
    {
17
18
        if (!$phone = $notifiable->routeNotificationFor('whatsapp', $notification)) {
19
            return;
20
        }
21
        $data = $notification->toWhatsapp($notifiable);
0 ignored issues
show
Bug introduced by
The method toWhatsapp() does not seem to exist on object<Illuminate\Notifications\Notification>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
22
        WhatsappNotifyFacade::send($phone , $data['message']);
23
    }
24
}
25