|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace NotificationChannels\Smsapi; |
|
4
|
|
|
|
|
5
|
|
|
use NotificationChannels\Smsapi\Exceptions\ExceptionFactory; |
|
6
|
|
|
|
|
7
|
|
|
class SmsapiSmsMessage extends SmsapiMessage |
|
8
|
|
|
{ |
|
9
|
|
|
/** |
|
10
|
|
|
* @param string|null $content |
|
11
|
|
|
*/ |
|
12
|
83 |
|
public function __construct($content = null) |
|
13
|
|
|
{ |
|
14
|
83 |
|
ExceptionFactory::assertArgumentTypes(1, __METHOD__, ['string', 'NULL'], $content); |
|
15
|
83 |
|
if ($content !== null) { |
|
16
|
2 |
|
$this->data['content'] = $content; |
|
17
|
|
|
} |
|
18
|
83 |
|
} |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @param string $content |
|
22
|
|
|
* @return self |
|
23
|
|
|
*/ |
|
24
|
5 |
|
public function content($content) |
|
25
|
|
|
{ |
|
26
|
5 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'string', $content); |
|
27
|
1 |
|
$this->data['content'] = $content; |
|
28
|
|
|
|
|
29
|
1 |
|
return $this; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @param string $template |
|
34
|
|
|
* @return self |
|
35
|
|
|
*/ |
|
36
|
5 |
|
public function template($template) |
|
37
|
|
|
{ |
|
38
|
5 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'string', $template); |
|
39
|
1 |
|
$this->data['template'] = $template; |
|
40
|
|
|
|
|
41
|
1 |
|
return $this; |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @param string $from |
|
46
|
|
|
* @return self |
|
47
|
|
|
*/ |
|
48
|
5 |
|
public function from($from) |
|
49
|
|
|
{ |
|
50
|
5 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'string', $from); |
|
51
|
1 |
|
$this->data['from'] = $from; |
|
52
|
|
|
|
|
53
|
1 |
|
return $this; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* @param bool $fast |
|
58
|
|
|
* @return self |
|
59
|
|
|
*/ |
|
60
|
6 |
|
public function fast($fast) |
|
61
|
|
|
{ |
|
62
|
6 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'boolean', $fast); |
|
63
|
2 |
|
$this->data['fast'] = $fast; |
|
64
|
|
|
|
|
65
|
2 |
|
return $this; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* @param bool $flash |
|
70
|
|
|
* @return self |
|
71
|
|
|
*/ |
|
72
|
6 |
|
public function flash($flash) |
|
73
|
|
|
{ |
|
74
|
6 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'boolean', $flash); |
|
75
|
2 |
|
$this->data['flash'] = $flash; |
|
76
|
|
|
|
|
77
|
2 |
|
return $this; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @param string $encoding |
|
82
|
|
|
* @return self |
|
83
|
|
|
*/ |
|
84
|
5 |
|
public function encoding($encoding) |
|
85
|
|
|
{ |
|
86
|
5 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'string', $encoding); |
|
87
|
1 |
|
$this->data['encoding'] = $encoding; |
|
88
|
|
|
|
|
89
|
1 |
|
return $this; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @param bool $normalize |
|
94
|
|
|
* @return self |
|
95
|
|
|
*/ |
|
96
|
6 |
|
public function normalize($normalize) |
|
97
|
|
|
{ |
|
98
|
6 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'boolean', $normalize); |
|
99
|
2 |
|
$this->data['normalize'] = $normalize; |
|
100
|
|
|
|
|
101
|
2 |
|
return $this; |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* @param bool $nounicode |
|
106
|
|
|
* @return self |
|
107
|
|
|
*/ |
|
108
|
6 |
|
public function nounicode($nounicode) |
|
109
|
|
|
{ |
|
110
|
6 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'boolean', $nounicode); |
|
111
|
2 |
|
$this->data['nounicode'] = $nounicode; |
|
112
|
|
|
|
|
113
|
2 |
|
return $this; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @param bool $single |
|
118
|
|
|
* @return self |
|
119
|
|
|
*/ |
|
120
|
6 |
|
public function single($single) |
|
121
|
|
|
{ |
|
122
|
6 |
|
ExceptionFactory::assertArgumentType(1, __METHOD__, 'boolean', $single); |
|
123
|
2 |
|
$this->data['single'] = $single; |
|
124
|
|
|
|
|
125
|
2 |
|
return $this; |
|
126
|
|
|
} |
|
127
|
|
|
} |
|
128
|
|
|
|