SmsUpResponseMessage   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 74
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 16
c 1
b 0
f 0
dl 0
loc 74
rs 10
wmc 9

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getCustom() 0 3 1
A getSmsId() 0 3 1
A getStatus() 0 3 1
A getErrorMsg() 0 3 1
A __construct() 0 7 4
A getErrorId() 0 3 1
1
<?php
2
3
namespace SquareetLabs\LaravelSmsUp;
4
5
/**
6
 * Class SmsUpResponseMessage
7
 * @package SquareetLabs\LaravelSmsUp
8
 */
9
class SmsUpResponseMessage
10
{
11
    /**
12
     * @var string
13
     */
14
    private $status;
15
16
    /**
17
     * @var string
18
     */
19
    private $smsId;
20
21
    /**
22
     * @var string
23
     */
24
    private $custom;
25
26
    /**
27
     * @var string
28
     */
29
    private $errorId;
30
31
    /**
32
     * @var string
33
     */
34
    private $errorMsg;
35
36
    public function __construct(array $response)
37
    {
38
        $this->status = $response['status'];
39
        $this->smsId = $response['sms_id'];
40
        $this->custom = isset($response['custom']) ? $response['custom'] : '';
41
        $this->errorId = isset($response['error_id']) ? $response['error_id'] : '';
42
        $this->errorMsg = isset($response['error_msg']) ? $response['error_msg'] : '';
43
    }
44
45
    /**
46
     * @return string|null
47
     */
48
    public function getStatus()
49
    {
50
        return $this->status;
51
    }
52
53
    /**
54
     * @return string|null
55
     */
56
    public function getSmsId()
57
    {
58
        return $this->smsId;
59
    }
60
61
    /**
62
     * @return string|null
63
     */
64
    public function getCustom()
65
    {
66
        return $this->custom;
67
    }
68
69
    /**
70
     * @return string|null
71
     */
72
    public function getErrorId()
73
    {
74
        return $this->errorId;
75
    }
76
77
    /**
78
     * @return string|null
79
     */
80
    public function getErrorMsg()
81
    {
82
        return $this->errorMsg;
83
    }
84
}