@@ -1449,7 +1449,7 @@ protected function _callApi($httpmethod, $method, $params = [], $multipart = fal
1449
1449
throw new \Exception ('To call this API, the OAuth access token must be set. ' );
1450
1450
}
1451
1451
// use separate API access for streaming API
1452
- if ($ this ->_detectStreaming ($ method )) {
1452
+ if ($ this ->_detectStreaming ($ method ) !== false ) {
1453
1453
return $ this ->_callApiStreaming ($ httpmethod , $ method , $ params , $ app_only_auth );
1454
1454
}
1455
1455
@@ -1754,7 +1754,6 @@ protected function _callApiStreaming(
1754
1754
1755
1755
$ errno = 0 ;
1756
1756
$ errstr = '' ;
1757
- $ timeout = $ this ->_connectionTimeout ;
1758
1757
$ ch = stream_socket_client (
1759
1758
'ssl:// ' . $ hostname . ':443 ' ,
1760
1759
$ errno , $ errstr ,
@@ -1786,8 +1785,8 @@ protected function _callApiStreaming(
1786
1785
$ httpstatus = $ match [1 ];
1787
1786
}
1788
1787
1789
- list ($ headers , $ none ) = $ this ->_parseApiHeaders ($ result );
1790
- $ rate = $ this ->_getRateLimitInfo ($ headers );
1788
+ list ($ headers ,) = $ this ->_parseApiHeaders ($ result );
1789
+ $ rate = $ this ->_getRateLimitInfo ($ headers );
1791
1790
1792
1791
if ($ httpstatus !== '200 ' ) {
1793
1792
$ reply = [
@@ -1804,10 +1803,8 @@ protected function _callApiStreaming(
1804
1803
}
1805
1804
}
1806
1805
1807
- $ ch_array = [$ ch ];
1808
- $ null = null ;
1809
- $ data = '' ;
1810
1806
$ signal_function = function_exists ('pcntl_signal_dispatch ' );
1807
+ $ data = '' ;
1811
1808
1812
1809
while (!feof ($ ch )) {
1813
1810
// call signal handlers, if any
0 commit comments