Skip to content

Commit ac5354a

Browse files
ewood-acashgibsonEli Wood
authored
Exception2 (#127)
An attempt to fix some issues that are not handled gracefully. It seems as though on occasion there is an issue within the exception handling. This tries to solve that. --------- Co-authored-by: Ash <1744544+ashgibson@users.noreply.github.com> Co-authored-by: Eli Wood <ewood@PC26VM7WKL.local>
1 parent 4192e94 commit ac5354a

8 files changed

Lines changed: 37 additions & 138 deletions

.php-cs-fixer.cache

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/Postmark/Models/PostmarkBounce.php

Lines changed: 18 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -45,328 +45,219 @@ public function __construct(array $values)
4545
$this->Content = !empty($values['Content']) ? $values['Content'] : '';
4646
}
4747

48-
/**
49-
* @return int
50-
*/
5148
public function getID(): int
5249
{
5350
return $this->ID;
5451
}
5552

56-
/**
57-
* @param int $ID
58-
* @return PostmarkBounce
59-
*/
6053
public function setID(int $ID): PostmarkBounce
6154
{
6255
$this->ID = $ID;
56+
6357
return $this;
6458
}
6559

66-
/**
67-
* @return string
68-
*/
6960
public function getType(): string
7061
{
7162
return $this->Type;
7263
}
7364

74-
/**
75-
* @param string $Type
76-
* @return PostmarkBounce
77-
*/
7865
public function setType(string $Type): PostmarkBounce
7966
{
8067
$this->Type = $Type;
68+
8169
return $this;
8270
}
8371

84-
/**
85-
* @return int
86-
*/
8772
public function getTypeCode(): int
8873
{
8974
return $this->TypeCode;
9075
}
9176

92-
/**
93-
* @param int $TypeCode
94-
* @return PostmarkBounce
95-
*/
9677
public function setTypeCode(int $TypeCode): PostmarkBounce
9778
{
9879
$this->TypeCode = $TypeCode;
80+
9981
return $this;
10082
}
10183

102-
/**
103-
* @return string
104-
*/
10584
public function getName(): string
10685
{
10786
return $this->Name;
10887
}
10988

110-
/**
111-
* @param string $Name
112-
* @return PostmarkBounce
113-
*/
11489
public function setName(string $Name): PostmarkBounce
11590
{
11691
$this->Name = $Name;
92+
11793
return $this;
11894
}
11995

120-
/**
121-
* @return string
122-
*/
12396
public function getTag(): string
12497
{
12598
return $this->Tag;
12699
}
127100

128-
/**
129-
* @param string $Tag
130-
* @return PostmarkBounce
131-
*/
132101
public function setTag(string $Tag): PostmarkBounce
133102
{
134103
$this->Tag = $Tag;
104+
135105
return $this;
136106
}
137107

138-
/**
139-
* @return string
140-
*/
141108
public function getMessageID(): string
142109
{
143110
return $this->MessageID;
144111
}
145112

146-
/**
147-
* @param string $MessageID
148-
* @return PostmarkBounce
149-
*/
150113
public function setMessageID(string $MessageID): PostmarkBounce
151114
{
152115
$this->MessageID = $MessageID;
116+
153117
return $this;
154118
}
155119

156-
/**
157-
* @return int
158-
*/
159120
public function getServerID(): int
160121
{
161122
return $this->ServerID;
162123
}
163124

164-
/**
165-
* @param int $ServerID
166-
* @return PostmarkBounce
167-
*/
168125
public function setServerID(int $ServerID): PostmarkBounce
169126
{
170127
$this->ServerID = $ServerID;
128+
171129
return $this;
172130
}
173131

174-
/**
175-
* @return string
176-
*/
177132
public function getMessageStream(): string
178133
{
179134
return $this->MessageStream;
180135
}
181136

182-
/**
183-
* @param string $MessageStream
184-
* @return PostmarkBounce
185-
*/
186137
public function setMessageStream(string $MessageStream): PostmarkBounce
187138
{
188139
$this->MessageStream = $MessageStream;
140+
189141
return $this;
190142
}
191143

192-
/**
193-
* @return string
194-
*/
195144
public function getDescription(): string
196145
{
197146
return $this->Description;
198147
}
199148

200-
/**
201-
* @param string $Description
202-
* @return PostmarkBounce
203-
*/
204149
public function setDescription(string $Description): PostmarkBounce
205150
{
206151
$this->Description = $Description;
152+
207153
return $this;
208154
}
209155

210-
/**
211-
* @return string
212-
*/
213156
public function getDetails(): string
214157
{
215158
return $this->Details;
216159
}
217160

218-
/**
219-
* @param string $Details
220-
* @return PostmarkBounce
221-
*/
222161
public function setDetails(string $Details): PostmarkBounce
223162
{
224163
$this->Details = $Details;
164+
225165
return $this;
226166
}
227167

228-
/**
229-
* @return string
230-
*/
231168
public function getEmail(): string
232169
{
233170
return $this->Email;
234171
}
235172

236-
/**
237-
* @param string $Email
238-
* @return PostmarkBounce
239-
*/
240173
public function setEmail(string $Email): PostmarkBounce
241174
{
242175
$this->Email = $Email;
176+
243177
return $this;
244178
}
245179

246-
/**
247-
* @return string
248-
*/
249180
public function getFrom(): string
250181
{
251182
return $this->From;
252183
}
253184

254-
/**
255-
* @param string $From
256-
* @return PostmarkBounce
257-
*/
258185
public function setFrom(string $From): PostmarkBounce
259186
{
260187
$this->From = $From;
188+
261189
return $this;
262190
}
263191

264-
/**
265-
* @return string
266-
*/
267192
public function getBouncedAt(): string
268193
{
269194
return $this->BouncedAt;
270195
}
271196

272-
/**
273-
* @param string $BouncedAt
274-
* @return PostmarkBounce
275-
*/
276197
public function setBouncedAt(string $BouncedAt): PostmarkBounce
277198
{
278199
$this->BouncedAt = $BouncedAt;
200+
279201
return $this;
280202
}
281203

282-
/**
283-
* @return bool
284-
*/
285204
public function getDumpAvailable(): bool
286205
{
287206
return $this->DumpAvailable;
288207
}
289208

290-
/**
291-
* @param bool $DumpAvailable
292-
* @return PostmarkBounce
293-
*/
294209
public function setDumpAvailable(bool $DumpAvailable): PostmarkBounce
295210
{
296211
$this->DumpAvailable = $DumpAvailable;
212+
297213
return $this;
298214
}
299215

300-
/**
301-
* @return bool
302-
*/
303216
public function getInactive(): bool
304217
{
305218
return $this->Inactive;
306219
}
307220

308-
/**
309-
* @param bool $Inactive
310-
* @return PostmarkBounce
311-
*/
312221
public function setInactive(bool $Inactive): PostmarkBounce
313222
{
314223
$this->Inactive = $Inactive;
224+
315225
return $this;
316226
}
317227

318-
/**
319-
* @return bool
320-
*/
321228
public function getCanActivate(): bool
322229
{
323230
return $this->CanActivate;
324231
}
325232

326-
/**
327-
* @param bool $CanActivate
328-
* @return PostmarkBounce
329-
*/
330233
public function setCanActivate(bool $CanActivate): PostmarkBounce
331234
{
332235
$this->CanActivate = $CanActivate;
236+
333237
return $this;
334238
}
335239

336-
/**
337-
* @return string
338-
*/
339240
public function getSubject(): string
340241
{
341242
return $this->Subject;
342243
}
343244

344-
/**
345-
* @param string $Subject
346-
* @return PostmarkBounce
347-
*/
348245
public function setSubject(string $Subject): PostmarkBounce
349246
{
350247
$this->Subject = $Subject;
248+
351249
return $this;
352250
}
353251

354-
/**
355-
* @return string
356-
*/
357252
public function getContent(): string
358253
{
359254
return $this->Content;
360255
}
361256

362-
/**
363-
* @param string $Content
364-
* @return PostmarkBounce
365-
*/
366257
public function setContent(string $Content): PostmarkBounce
367258
{
368259
$this->Content = $Content;
260+
369261
return $this;
370262
}
371-
372263
}

src/Postmark/Models/PostmarkMessageDump.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ public function setBody(string $Body): PostmarkMessageDump
2222

2323
return $this;
2424
}
25-
}
25+
}

src/Postmark/Models/PostmarkMessageEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function __construct(array $values = [])
1515
$this->Type = !empty($values['Type']) ? $values['Type'] : '';
1616
$this->ReceivedAt = !empty($values['ReceivedAt']) ? $values['ReceivedAt'] : '';
1717

18-
$arrayType = !empty($values['Details']) ? (array)$values['Details'] : [];
18+
$arrayType = !empty($values['Details']) ? (array) $values['Details'] : [];
1919
$this->Details = !empty($values['Details']) ? new PostmarkMessageEventDetails(
2020
$arrayType
2121
) : new PostmarkMessageEventDetails();
@@ -68,4 +68,4 @@ public function setDetails(PostmarkMessageEventDetails $Details): PostmarkMessag
6868

6969
return $this;
7070
}
71-
}
71+
}

0 commit comments

Comments
 (0)