Skip to content

Commit 4ffdaa1

Browse files
authored
feat: add ratelimit to response (#72)
1 parent 1377507 commit 4ffdaa1

File tree

5 files changed

+321
-172
lines changed

5 files changed

+321
-172
lines changed

lib/GetStream/StreamChat/Channel.php

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private static function addUser($payload, $userId)
7474
/**
7575
* @param array $message
7676
* @param string $userId
77-
* @return mixed
77+
* @return StreamResponse
7878
* @throws StreamException
7979
*/
8080
public function sendMessage($message, $userId, $parentId=null)
@@ -90,7 +90,7 @@ public function sendMessage($message, $userId, $parentId=null)
9090

9191
/** Returns multiple messages.
9292
* @param array $messageIds
93-
* @return mixed
93+
* @return StreamResponse
9494
* @throws StreamException
9595
*/
9696
public function getManyMessages($messageIds)
@@ -101,7 +101,7 @@ public function getManyMessages($messageIds)
101101
/**
102102
* @param array $event
103103
* @param string $userId
104-
* @return mixed
104+
* @return StreamResponse
105105
* @throws StreamException
106106
*/
107107
public function sendEvent($event, $userId)
@@ -116,7 +116,7 @@ public function sendEvent($event, $userId)
116116
* @param string $messageId
117117
* @param array $reaction
118118
* @param string $userId
119-
* @return mixed
119+
* @return StreamResponse
120120
* @throws StreamException
121121
*/
122122
public function sendReaction($messageId, $reaction, $userId)
@@ -134,7 +134,7 @@ public function sendReaction($messageId, $reaction, $userId)
134134
* @param string $messageId
135135
* @param string $reactionType
136136
* @param string $userId
137-
* @return mixed
137+
* @return StreamResponse
138138
* @throws StreamException
139139
*/
140140
public function deleteReaction($messageId, $reactionType, $userId)
@@ -150,7 +150,7 @@ public function deleteReaction($messageId, $reactionType, $userId)
150150

151151
/**
152152
* @param string $userId
153-
* @return mixed
153+
* @return StreamResponse
154154
* @throws StreamException
155155
*/
156156
public function create($userId, $members=null)
@@ -169,7 +169,7 @@ public function create($userId, $members=null)
169169

170170
/**
171171
* @param array $options
172-
* @return mixed
172+
* @return StreamResponse
173173
* @throws StreamException
174174
*/
175175
public function query($options)
@@ -200,7 +200,7 @@ public function query($options)
200200
* @param array $filterConditions
201201
* @param array $sort
202202
* @param array $options
203-
* @return mixed
203+
* @return StreamResponse
204204
* @throws StreamException
205205
*/
206206
public function queryMembers($filterConditions = null, $sort = null, $options = null)
@@ -233,7 +233,7 @@ public function queryMembers($filterConditions = null, $sort = null, $options =
233233
/**
234234
* @param array $channelData
235235
* @param string $updateMessage
236-
* @return mixed
236+
* @return StreamResponse
237237
* @throws StreamException
238238
*/
239239
public function update($channelData, $updateMessage=null)
@@ -248,7 +248,7 @@ public function update($channelData, $updateMessage=null)
248248
/**
249249
* @param array $set
250250
* @param array $unset
251-
* @return mixed
251+
* @return StreamResponse
252252
* @throws StreamException
253253
*/
254254
public function updatePartial($set = null, $unset = null)
@@ -265,7 +265,7 @@ public function updatePartial($set = null, $unset = null)
265265
}
266266

267267
/**
268-
* @return mixed
268+
* @return StreamResponse
269269
* @throws StreamException
270270
*/
271271
public function delete()
@@ -275,7 +275,7 @@ public function delete()
275275

276276
/**
277277
* @param array $options
278-
* @return mixed
278+
* @return StreamResponse
279279
* @throws StreamException
280280
*/
281281
public function truncate($options=null)
@@ -289,7 +289,7 @@ public function truncate($options=null)
289289
/**
290290
* @param array $userIds
291291
* @param array $options
292-
* @return mixed
292+
* @return StreamResponse
293293
* @throws StreamException
294294
*/
295295
public function addMembers($userIds, $options=null)
@@ -305,7 +305,7 @@ public function addMembers($userIds, $options=null)
305305

306306
/**
307307
* @param array $userIds
308-
* @return mixed
308+
* @return StreamResponse
309309
* @throws StreamException
310310
*/
311311
public function addModerators($userIds)
@@ -318,7 +318,7 @@ public function addModerators($userIds)
318318

319319
/**
320320
* @param array $userIds
321-
* @return mixed
321+
* @return StreamResponse
322322
* @throws StreamException
323323
*/
324324
public function removeMembers($userIds)
@@ -331,7 +331,7 @@ public function removeMembers($userIds)
331331

332332
/**
333333
* @param array $userIds
334-
* @return mixed
334+
* @return StreamResponse
335335
* @throws StreamException
336336
*/
337337
public function demoteModerators($userIds)
@@ -345,7 +345,7 @@ public function demoteModerators($userIds)
345345
/**
346346
* @param string $userId
347347
* @param array $data
348-
* @return mixed
348+
* @return StreamResponse
349349
* @throws StreamException
350350
*/
351351
public function markRead($userId, $data=null)
@@ -360,7 +360,7 @@ public function markRead($userId, $data=null)
360360
/**
361361
* @param string $parentId
362362
* @param array $options
363-
* @return mixed
363+
* @return StreamResponse
364364
* @throws StreamException
365365
*/
366366
public function getReplies($parentId, $options=null)
@@ -371,7 +371,7 @@ public function getReplies($parentId, $options=null)
371371
/**
372372
* @param string $messageId
373373
* @param array $options
374-
* @return mixed
374+
* @return StreamResponse
375375
* @throws StreamException
376376
*/
377377
public function getReactions($messageId, $options=null)
@@ -382,7 +382,7 @@ public function getReactions($messageId, $options=null)
382382
/**
383383
* @param string $targetId
384384
* @param array $options
385-
* @return mixed
385+
* @return StreamResponse
386386
* @throws StreamException
387387
*/
388388
public function banUser($targetId, $options=null)
@@ -398,7 +398,7 @@ public function banUser($targetId, $options=null)
398398
/**
399399
* @param string $targetId
400400
* @param array $options
401-
* @return mixed
401+
* @return StreamResponse
402402
* @throws StreamException
403403
*/
404404
public function unbanUser($targetId, $options=null)
@@ -413,7 +413,7 @@ public function unbanUser($targetId, $options=null)
413413

414414
/**
415415
* @param array $options
416-
* @return mixed
416+
* @return StreamResponse
417417
* @throws StreamException
418418
*/
419419
public function acceptInvite($options=null)
@@ -429,7 +429,7 @@ public function acceptInvite($options=null)
429429

430430
/**
431431
* @param array $options
432-
* @return mixed
432+
* @return StreamResponse
433433
* @throws StreamException
434434
*/
435435
public function rejectInvite($options=null)
@@ -448,7 +448,7 @@ public function rejectInvite($options=null)
448448
* @param string $name
449449
* @param string|array $user
450450
* @param string $contentType
451-
* @return mixed
451+
* @return StreamResponse
452452
* @throws StreamException
453453
*/
454454
public function sendFile($url, $name, $user, $contentType=null)
@@ -461,7 +461,7 @@ public function sendFile($url, $name, $user, $contentType=null)
461461
* @param string $name
462462
* @param string|array $user
463463
* @param string $contentType
464-
* @return mixed
464+
* @return StreamResponse
465465
* @throws StreamException
466466
*/
467467
public function sendImage($url, $name, $user, $contentType=null)
@@ -471,7 +471,7 @@ public function sendImage($url, $name, $user, $contentType=null)
471471

472472
/**
473473
* @param string $url
474-
* @return mixed
474+
* @return StreamResponse
475475
* @throws StreamException
476476
*/
477477
public function deleteFile($url)
@@ -481,7 +481,7 @@ public function deleteFile($url)
481481

482482
/**
483483
* @param string $url
484-
* @return mixed
484+
* @return StreamResponse
485485
* @throws StreamException
486486
*/
487487
public function deleteImage($url)
@@ -491,7 +491,7 @@ public function deleteImage($url)
491491

492492
/**
493493
* @param array $event
494-
* @return mixed
494+
* @return StreamResponse
495495
* @throws StreamException
496496
*/
497497
public function sendCustomEvent($event)
@@ -503,7 +503,7 @@ public function sendCustomEvent($event)
503503
* hides the channel from queryChannels for the user until a message is added
504504
*
505505
* @param string $userId
506-
* @return mixed
506+
* @return StreamResponse
507507
* @throws StreamException
508508
*/
509509
public function hide($userId, $clearHistory=false)
@@ -521,7 +521,7 @@ public function hide($userId, $clearHistory=false)
521521
* removes the hidden status for a channel
522522
*
523523
* @param string $userId
524-
* @return mixed
524+
* @return StreamResponse
525525
* @throws StreamException
526526
*/
527527
public function show($userId)
@@ -534,7 +534,7 @@ public function show($userId)
534534
*
535535
* @param string $userId
536536
* @param int $expirationInMilliSeconds
537-
* @return mixed
537+
* @return StreamResponse
538538
* @throws StreamException
539539
*/
540540
public function mute($userId, $expirationInMilliSeconds = null)
@@ -553,7 +553,7 @@ public function mute($userId, $expirationInMilliSeconds = null)
553553
* unmutes the channel for the given user
554554
*
555555
* @param string $userId
556-
* @return mixed
556+
* @return StreamResponse
557557
* @throws StreamException
558558
*/
559559
public function unmute($userId)

0 commit comments

Comments
 (0)