SMSClass   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 37
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B SMSSend() 0 25 1
1
<?php
2
3
namespace Spitoglou\SMS;
4
5
use GuzzleHttp\Client as HttpClient;
6
7
/**
8
 * Class SMSClass
9
 * Main Package Class
10
 * @package Spitoglou\SMS
11
 */
12
class SMSClass
13
{
14
15
    /**
16
     * Sends a SMS message utilizing the DOLUNA API
17
     * @param SMSRecipient $recipient
18
     * @param string $message
19
     * @return string
20
     */
21
    public static function SMSSend(SMSRecipient $recipient, $message = 'Test Message')
22
    {
23
        $client = new HttpClient();
24
25
        $send = urldecode($message);
26
        $response = $client->request(
27
            'GET',
28
            'https://api.doluna.net/sms/send',
29
            [
30
                'query' => [
31
                    'api_service_key' => config('sms.dolunaAPIKey'),
32
                    'msg_senderid' => config('sms.senderId'),
33
                    'msg_to' => "{$recipient}",
34
                    'msg_text' => $send,
35
                    'msg_clientref' => config('sms.clientref'),
36
                    'msg_dr' => config('sms.dr'),
37
                    'output' => config('sms.output'),
38
                    'type' => config('sms.type'),
39
                ],
40
                'verify' => false
41
            ]
42
        );
43
44
        return $response->getBody()->getContents();
45
    }
46
47
48
}
49