PlaySmsChannel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A send() 0 7 1
1
<?php
2
3
namespace CoreProc\NotificationChannels\PlaySms;
4
5
use CoreProc\NotificationChannels\PlaySms\Exceptions\CouldNotSendNotification;
6
use Illuminate\Notifications\Notification;
7
8
class PlaySmsChannel
9
{
10
    private $playsms;
11
12
    public function __construct(PlaySmsClient $playsms)
13
    {
14
        $this->playsms = $playsms;
15
    }
16
17
    /**
18
     * Send the given notification.
19
     *
20
     * @param mixed $notifiable
21
     * @param Notification $notification
22
     *
23
     * @throws CouldNotSendNotification
24
     */
25
    public function send($notifiable, Notification $notification)
26
    {
27
        $message = $notification->toPlaySms($notifiable);
0 ignored issues
show
Bug introduced by
The method toPlaySms() 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...
28
        $recipient = $notifiable->routeNotificationForPlaySms($notification);
29
30
        $this->playsms->send($recipient, $message);
31
    }
32
}
33