8000 Fix minor issues · balitax/codebird-php@d5e6e78 · GitHub
[go: up one dir, main page]

Skip to content

Commit d5e6e78

Browse files
committed
Fix minor issues
1 parent f886a83 commit d5e6e78

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/codebird.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ protected function _callApi($httpmethod, $method, $params = [], $multipart = fal
14491449
throw new \Exception('To call this API, the OAuth access token must be set.');
14501450
}
14511451
// use separate API access for streaming API
1452-
if ($this->_detectStreaming($method)) {
1452+
if ($this->_detectStreaming($method) !== false) {
14531453
return $this->_callApiStreaming($httpmethod, $method, $params, $app_only_auth);
14541454
}
14551455

@@ -1754,7 +1754,6 @@ protected function _callApiStreaming(
17541754

17551755
$errno = 0;
17561756
$errstr = '';
1757-
$timeout = $this->_connectionTimeout;
17581757
$ch = stream_socket_client(
17591758
'ssl://' . $hostname . ':443',
17601759
$errno, $errstr,
@@ -1786,8 +1785,8 @@ protected function _callApiStreaming(
17861785
$httpstatus = $match[1];
17871786
}
17881787

1789-
list($headers, $none) = $this->_parseApiHeaders($result);
1790-
$rate = $this->_getRateLimitInfo($headers);
1788+
list($headers,) = $this->_parseApiHeaders($result);
1789+
$rate = $this->_getRateLimitInfo($headers);
17911790

17921791
if ($httpstatus !== '200') {
17931792
$reply = [
@@ -1804,10 +1803,8 @@ protected function _callApiStreaming(
18041803
}
18051804
}
18061805

1807-
$ch_array = [$ch];
1808-
$null = null;
1809-
$data = '';
18101806
$signal_function = function_exists('pcntl_signal_dispatch');
1807+
$data = '';
18111808

18121809
while (!feof($ch)) {
18131810
// call signal handlers, if any

0 commit comments

Comments
 (0)
0