Skip to content

Commit bc4e26a

Browse files
authored
Merge pull request #92 from ITMobilityControl/master
Fix some of the return types
2 parents c34d9fc + 10d10d0 commit bc4e26a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/AdminResources/Emails.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function get(array $params = []): array
145145
/**
146146
* @throws Exception
147147
*/
148-
public function find(string $id): MsGraphAdmin
148+
public function find(string $id): array
149149
{
150150
if ($this->userId == null) {
151151
throw new Exception('userid is required.');
@@ -154,7 +154,7 @@ public function find(string $id): MsGraphAdmin
154154
return MsGraphAdmin::get('users/'.$this->userId.'/messages/'.$id);
155155
}
156156

157-
public function findAttachments(string $id): MsGraphAdmin
157+
public function findAttachments(string $id): array
158158
{
159159
return MsGraphAdmin::get('users/'.$this->userId.'/messages/'.$id.'/attachments');
160160
}
@@ -193,7 +193,7 @@ function (array $m) use ($attachments) {
193193
/**
194194
* @throws Exception
195195
*/
196-
public function send(): MsGraphAdmin
196+
public function send(): void
197197
{
198198
if (strlen($this->userId) === 0) {
199199
throw new Exception('userId is required.');
@@ -211,13 +211,13 @@ public function send(): MsGraphAdmin
211211
throw new Exception('Comment is only used for replies and forwarding, please use body instead.');
212212
}
213213

214-
return MsGraphAdmin::post('users/'.$this->userId.'/sendMail', self::prepareEmail());
214+
MsGraphAdmin::post('users/'.$this->userId.'/sendMail', self::prepareEmail());
215215
}
216216

217217
/**
218218
* @throws Exception
219219
*/
220-
public function reply(): MsGraphAdmin
220+
public function reply()
221221
{
222222
if (strlen($this->userId) === 0) {
223223
throw new Exception('userId is required.');
@@ -231,13 +231,13 @@ public function reply(): MsGraphAdmin
231231
throw new Exception('Body is only used for sending new emails, please use comment instead.');
232232
}
233233

234-
return MsGraphAdmin::post('users/'.$this->userId.'/messages/'.$this->id.'/replyAll', self::prepareEmail());
234+
MsGraphAdmin::post('users/'.$this->userId.'/messages/'.$this->id.'/replyAll', self::prepareEmail());
235235
}
236236

237237
/**
238238
* @throws Exception
239239
*/
240-
public function forward(): MsGraphAdmin
240+
public function forward()
241241
{
242242
if (strlen($this->userId) === 0) {
243243
throw new Exception('userId is required.');
@@ -251,19 +251,19 @@ public function forward(): MsGraphAdmin
251251
throw new Exception('Body is only used for sending new emails, please use comment instead.');
252252
}
253253

254-
return MsGraphAdmin::post('users/'.$this->userId.'/messages/'.$this->id.'/forward', self::prepareEmail());
254+
MsGraphAdmin::post('users/'.$this->userId.'/messages/'.$this->id.'/forward', self::prepareEmail());
255255
}
256256

257257
/**
258258
* @throws Exception
259259
*/
260-
public function delete(string $id): MsGraphAdmin
260+
public function delete(string $id)
261261
{
262262
if ($this->userId == null) {
263263
throw new Exception('userId is required.');
264264
}
265265

266-
return MsGraphAdmin::delete('users/'.$this->userId.'/messages/'.$id);
266+
MsGraphAdmin::delete('users/'.$this->userId.'/messages/'.$id);
267267
}
268268

269269
protected function prepareEmail(): array

0 commit comments

Comments
 (0)