TextClient   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A send() 0 4 1
1
<?php
2
3
namespace Nopolabs\Yabot\Plugins\Sms;
4
5
6
use Twilio\Rest\Client;
7
8
class TextClient
9
{
10
    private $client;
11
12
    public function __construct(array $config)
13
    {
14
        $username = $config['twilio']['sid'];
15
        $password = $config['twilio']['token'];
16
        $this->client = new Client($username, $password);
17
    }
18
19
    public function send($to, $from, $message)
20
    {
21
        $this->client->messages->create($to, ['from' => $from, 'body' => $message]);
22
    }
23
}