Total Complexity | 12 |
Total Lines | 128 |
Duplicated Lines | 0 % |
Coverage | 93.75% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | class SipgateMessage implements Arrayable, JsonSerializable |
||
9 | { |
||
10 | /** @var string */ |
||
11 | protected $message; |
||
12 | |||
13 | /** @var string */ |
||
14 | protected $recipient; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $smsId; |
||
18 | |||
19 | /** @var int */ |
||
20 | protected $sendAt; |
||
21 | |||
22 | /** |
||
23 | * SipgateMessage constructor. |
||
24 | * @param string $message |
||
25 | */ |
||
26 | 19 | public function __construct(string $message = '') |
|
27 | { |
||
28 | 19 | $this->message = $message; |
|
29 | 19 | } |
|
30 | |||
31 | /** |
||
32 | * @param string $message |
||
33 | * @return static |
||
34 | */ |
||
35 | 8 | public static function create(string $message = '') |
|
36 | { |
||
37 | 8 | return new static($message); |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | 7 | public function getSmsId() |
|
44 | { |
||
45 | 7 | return $this->smsId; |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param string $smsId |
||
50 | * |
||
51 | * @return SipgateMessage |
||
52 | */ |
||
53 | 10 | public function smsId(string $smsId) |
|
54 | { |
||
55 | 10 | $this->smsId = $smsId; |
|
56 | |||
57 | 10 | return $this; |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * @return string |
||
62 | */ |
||
63 | 3 | public function getMessage() |
|
64 | { |
||
65 | 3 | return $this->message; |
|
66 | } |
||
67 | |||
68 | /** |
||
69 | * @param string $message |
||
70 | * @return SipgateMessage |
||
71 | */ |
||
72 | 4 | public function message(string $message) |
|
73 | { |
||
74 | 4 | $this->message = $message; |
|
75 | |||
76 | 4 | return $this; |
|
77 | } |
||
78 | |||
79 | /** |
||
80 | * @return string |
||
81 | */ |
||
82 | 8 | public function getRecipient() |
|
83 | { |
||
84 | 8 | return $this->recipient; |
|
85 | } |
||
86 | |||
87 | /** |
||
88 | * @param string $recipient |
||
89 | * @return SipgateMessage |
||
90 | */ |
||
91 | 10 | public function recipient(string $recipient) |
|
92 | { |
||
93 | 10 | $this->recipient = $recipient; |
|
94 | |||
95 | 10 | return $this; |
|
96 | } |
||
97 | |||
98 | /** |
||
99 | * @return int | null |
||
100 | */ |
||
101 | 1 | public function getSendAt() |
|
104 | } |
||
105 | |||
106 | /** |
||
107 | * @param int $sendAt |
||
108 | * @return SipgateMessage |
||
109 | */ |
||
110 | 4 | public function sendAt($sendAt) |
|
111 | { |
||
112 | 4 | $this->sendAt = $sendAt; |
|
113 | |||
114 | 4 | return $this; |
|
115 | } |
||
116 | |||
117 | /** |
||
118 | * @return array |
||
119 | */ |
||
120 | 1 | public function toArray() |
|
127 | ]; |
||
128 | } |
||
129 | |||
130 | /** |
||
131 | * @return array |
||
132 | */ |
||
133 | public function jsonSerialize() |
||
136 | } |
||
137 | } |
||
138 |