4
4
5
5
use DateTime ;
6
6
7
- class SmsParams implements ParamsInterface {
7
+ class SmsParams implements ParamsInterface
8
+ {
8
9
protected ?DateTime $ delay = null ;
9
10
protected array $ files = [];
10
11
protected ?bool $ flash = null ;
@@ -20,161 +21,197 @@ class SmsParams implements ParamsInterface {
20
21
protected ?bool $ unicode = null ;
21
22
protected ?bool $ utf8 = null ;
22
23
23
- public function __construct (string $ text , string ...$ to ) {
24
+ public function __construct (string $ text , string ...$ to )
25
+ {
24
26
$ this ->text = $ text ;
25
27
$ this ->to = $ to ;
26
28
}
27
29
28
- public function getDelay (): ?DateTime {
30
+ public function getDelay (): ?DateTime
31
+ {
29
32
return $ this ->delay ;
30
33
}
31
34
32
- public function setDelay (?DateTime $ delay ): self {
35
+ public function setDelay (?DateTime $ delay ): self
36
+ {
33
37
$ this ->delay = $ delay ;
34
38
return $ this ;
35
39
}
36
40
37
- public function addFile (array $ file ): self {
41
+ public function addFile (array $ file ): self
42
+ {
38
43
$ this ->files [] = $ file ;
39
44
return $ this ;
40
45
}
41
46
42
- public function getFiles (): array {
47
+ public function getFiles (): array
48
+ {
43
49
return $ this ->files ;
44
50
}
45
51
46
- public function setFiles (array $ files ): self {
52
+ public function setFiles (array $ files ): self
53
+ {
47
54
$ this ->files = $ files ;
48
55
return $ this ;
49
56
}
50
57
51
- public function removeFile (int $ index ): self {
58
+ public function removeFile (int $ index ): self
59
+ {
52
60
unset($ this ->files [$ index ]);
53
61
return $ this ;
54
62
}
55
63
56
- public function removeFiles (): self {
64
+ public function removeFiles (): self
65
+ {
57
66
$ this ->files = [];
58
67
return $ this ;
59
68
}
60
69
61
- public function getFlash (): ?bool {
70
+ public function getFlash (): ?bool
71
+ {
62
72
return $ this ->flash ;
63
73
}
64
74
65
- public function setFlash (?bool $ flash ): self {
75
+ public function setFlash (?bool $ flash ): self
76
+ {
66
77
$ this ->flash = $ flash ;
67
78
return $ this ;
68
79
}
69
80
70
- public function getForeignId (): ?string {
81
+ public function getForeignId (): ?string
82
+ {
71
83
return $ this ->foreign_id ;
72
84
}
73
85
74
- public function setForeignId (?string $ foreignId ): self {
86
+ public function setForeignId (?string $ foreignId ): self
87
+ {
75
88
$ this ->foreign_id = $ foreignId ;
76
89
return $ this ;
77
90
}
78
91
79
- public function getFrom (): ?string {
92
+ public function getFrom (): ?string
93
+ {
80
94
return $ this ->from ;
81
95
}
82
96
83
- public function setFrom (?string $ from ): self {
97
+ public function setFrom (?string $ from ): self
98
+ {
84
99
$ this ->from = $ from ;
85
100
return $ this ;
86
101
}
87
102
88
- public function getLabel (): ?string {
103
+ public function getLabel (): ?string
104
+ {
89
105
return $ this ->label ;
90
106
}
91
107
92
- public function setLabel (?string $ label ): self {
108
+ public function setLabel (?string $ label ): self
109
+ {
93
110
$ this ->label = $ label ;
94
111
return $ this ;
95
112
}
96
113
97
- public function getNoReload (): ?bool {
114
+ public function getNoReload (): ?bool
115
+ {
98
116
return $ this ->no_reload ;
99
117
}
100
118
101
- public function setNoReload (?bool $ noReload ): self {
119
+ public function setNoReload (?bool $ noReload ): self
120
+ {
102
121
$ this ->no_reload = $ noReload ;
103
122
return $ this ;
104
123
}
105
124
106
- public function getPerformanceTracking (): ?bool {
125
+ public function getPerformanceTracking (): ?bool
126
+ {
107
127
return $ this ->performance_tracking ;
108
128
}
109
129
110
- public function setPerformanceTracking (?bool $ performanceTracking ): self {
130
+ public function setPerformanceTracking (?bool $ performanceTracking ): self
131
+ {
111
132
$ this ->performance_tracking = $ performanceTracking ;
112
133
return $ this ;
113
134
}
114
135
115
- public function getText (): string {
136
+ public function getText (): string
137
+ {
116
138
return $ this ->text ;
117
139
}
118
140
119
- public function setText (string $ text ): self {
141
+ public function setText (string $ text ): self
142
+ {
120
143
$ this ->text = $ text ;
121
144
return $ this ;
122
145
}
123
146
124
- public function addTo (string ...$ to ): self {
147
+ public function addTo (string ...$ to ): self
148
+ {
125
149
$ this ->to = [...$ this ->to , ...$ to ];
126
150
return $ this ;
127
151
}
128
152
129
- public function getTo (): array {
153
+ public function getTo (): array
154
+ {
130
155
return $ this ->to ;
131
156
}
132
157
133
- public function setTo (array $ to ): self {
158
+ public function setTo (array $ to ): self
159
+ {
134
160
$ this ->to = $ to ;
135
161
return $ this ;
136
162
}
137
163
138
- public function getTtl (): ?int {
164
+ public function getTtl (): ?int
165
+ {
139
166
return $ this ->ttl ;
140
167
}
141
168
142
- public function setTtl (?int $ ttl ): self {
169
+ public function setTtl (?int $ ttl ): self
170
+ {
143
171
$ this ->ttl = $ ttl ;
144
172
return $ this ;
145
173
}
146
174
147
- public function getUdh (): ?string {
175
+ public function getUdh (): ?string
176
+ {
148
177
return $ this ->udh ;
149
178
}
150
179
151
- public function setUdh (?string $ udh ): self {
180
+ public function setUdh (?string $ udh ): self
181
+ {
152
182
$ this ->udh = $ udh ;
153
183
return $ this ;
154
184
}
155
185
156
- public function getUnicode (): ?bool {
186
+ public function getUnicode (): ?bool
187
+ {
157
188
return $ this ->unicode ;
158
189
}
159
190
160
- public function setUnicode (?bool $ unicode ): self {
191
+ public function setUnicode (?bool $ unicode ): self
192
+ {
161
193
$ this ->unicode = $ unicode ;
162
194
return $ this ;
163
195
}
164
196
165
- public function getUtf8 (): ?bool {
197
+ public function getUtf8 (): ?bool
198
+ {
166
199
return $ this ->utf8 ;
167
200
}
168
201
169
- public function setUtf8 (?bool $ utf8 ): self {
202
+ public function setUtf8 (?bool $ utf8 ): self
203
+ {
170
204
$ this ->utf8 = $ utf8 ;
171
205
return $ this ;
172
206
}
173
207
174
- public function toArray (): array {
208
+ public function toArray (): array
209
+ {
175
210
$ arr = get_object_vars ($ this );
176
211
$ arr ['to ' ] = implode (', ' , $ this ->to );
177
212
213
+ if ($ this ->delay ) $ arr ['delay ' ] = $ this ->delay ->format ('Y-m-d h:i ' );
214
+
178
215
return $ arr ;
179
216
}
180
217
}
0 commit comments