SMSDRCheckCallbackRequest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Test Coverage

Coverage 90.91%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 51
ccs 10
cts 11
cp 0.9091
rs 10
wmc 5

4 Methods

Rating   Name   Duplication   Size   Complexity  
A method() 0 3 1
A __construct() 0 7 2
A options() 0 4 1
A uri() 0 4 1
1
<?php
2
3
namespace Mediumart\Orange\SMS\Http\Requests;
4
5
use Exception;
6
use Mediumart\Orange\SMS\Http\SMSClientRequest;
7
8
class SMSDRCheckCallbackRequest extends SMSClientRequest
9
{
10
    /**
11
     * @var string
12
     */
13
    private $id;
14
15
    /**
16
     * CheckSMSDRCallbackRequest constructor.
17
     * @param $id
18
     * @throws \Exception
19
     */
20 1
    public function __construct($id)
21
    {
22 1
        if (! $id) {
23
            throw new Exception('Missing subscription id');
24
        }
25
26 1
        $this->id = $id;
27 1
    }
28
29
    /**
30
     * Http request method.
31
     *
32
     * @return string
33
     */
34 1
    public function method()
35
    {
36 1
        return 'GET';
37
    }
38
39
    /**
40
     * The uri for the current request.
41
     *
42
     * @return string
43
     */
44 1
    public function uri()
45
    {
46
        // '.urlencode($this->sender).'/
47 1
        return static::BASE_URI.'/smsmessaging/v1/outbound/subscriptions/'.$this->id;
48
    }
49
50
    /**
51
     * Http request options.
52
     *
53
     * @return array
54
     */
55 1
    public function options()
56
    {
57
        return [
58 1
            'headers' => ['Content-Type' => 'application/json']
59
        ];
60
    }
61
}
62