8000 Simplify _callApiCurl rate-limit assignment · mkhader88/codebird-php@a6b2b04 · GitHub
[go: up one dir, main page]

Skip to content

Commit a6b2b04

Browse files
committed
Simplify _callApiCurl rate-limit assignment
1 parent 5d0735b commit a6b2b04

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/codebird.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,12 +1285,15 @@ protected function _callApiCurl($httpmethod, $method, $params = array(), $multip
12851285
$headers = $this->_parseApiReply($result, true);
12861286
$rate = $this->_getRateLimitInfo($headers);
12871287

1288-
if ($this->_return_format === CODEBIRD_RETURNFORMAT_OBJECT) {
1289-
$reply->httpstatus = $httpstatus;
1290-
$reply->rate = $rate;
1291-
} elseif ($this->_return_format === CODEBIRD_RETURNFORMAT_ARRAY) {
1292-
$reply['httpstatus'] = $httpstatus;
1293-
$reply['rate'] = $rate;
1288+
switch ($this->_return_format) {
1289+
case CODEBIRD_RETURNFORMAT_ARRAY:
1290+
$reply['httpstatus'] = $httpstatus;
1291+
$reply['rate'] = $rate;
1292+
break;
1293+
case CODEBIRD_RETURNFORMAT_OBJECT:
1294+
$reply->httpstatus = $httpstatus;
1295+
$reply->rate = $rate;
1296+
break;
12941297
}
12951298
return $reply;
12961299
}

0 commit comments

Comments
 (0)
0