Completed
Push — master ( 8667c0...414083 )
by Hilmi Erdem
07:00
created

JetSmsChannel   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 23
ccs 0
cts 9
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 12 2
1
<?php
2
3
namespace NotificationChannels\JetSms;
4
5
use Illuminate\Notifications\Notification;
6
use NotificationChannels\JetSms\Exceptions\CouldNotSendNotification;
7
8
/**
9
 * Class JetSmsChannel.
10
 */
11
final class JetSmsChannel
12
{
13
    /**
14
     * Send the given notification.
15
     *
16
     * @param  mixed                                  $notifiable
17
     * @param  \Illuminate\Notifications\Notification $notification
18
     * @throws \NotificationChannels\JetSms\Exceptions\CouldNotSendNotification
19
     * @return void
20
     */
21
    public function send($notifiable, Notification $notification)
22
    {
23
        $to = $notifiable->routeNotificationFor('JetSms');
24
25
        if (empty($to)) {
26
            throw CouldNotSendNotification::missingRecipient();
27
        }
28
29
        $message = $notification->toJetSms($notifiable);
1 ignored issue
show
Bug introduced by
The method toJetSms() 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...
30
31
        JetSms::sendShortMessage($to, $message);
32
    }
33
}
34