AvsTelecomChannel   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 17
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A send() 0 8 2
A getPhone() 0 6 2
1
<?php
2
3
namespace Tematech\Avstelecomsms;
4
5
use Illuminate\Notifications\Notification;
6
7
class AvsTelecomChannel
8
{
9
    public function send($notifiable, Notification $notification)
10
    {
11
        if (!$phone = $notifiable->routeNotificationFor('avstelecom', $notification)) {
12
            return;
13
        }
14
        $data = $notification->toAvstelecom($notifiable);
0 ignored issues
show
Bug introduced by
The method toAvstelecom() 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...
15
        AvstelecomsmsFacade::send($this->getPhone($phone), $data['message']);
16
    }
17
    private function getPhone(string $phone)
18
    {
19
        if (strlen($phone) == 9)
20
            return '237' . $phone;
21
        return $phone;
22
    }
23
}
24