WhatsappChannel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 9 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