Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit ee430b2

Browse files
committed
Merge pull request #117 from J7mbo/develop
1.0.2
2 parents f41f025 + 24ba95b commit ee430b2

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

TwitterAPIExchange.php

+12-4
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,13 @@ public function buildOauth($url, $requestMethod)
254254
*/
255255
public function performRequest($return = true)
256256
{
257-
if (!is_bool($return))
258-
{
259-
throw new Exception('performRequest parameter must be true or false');
257+
if (!is_bool($return))
258+
{
259+
throw new Exception('performRequest parameter must be true or false');
260260
}
261261

262262
$header = array($this->buildAuthorizationHeader($this->oauth), 'Expect:');
263-
263+
264264
$getfield = $this->getGetfield();
265265
$postfields = $this->getPostfields();
266266

@@ -287,6 +287,14 @@ public function performRequest($return = true)
287287
$feed = curl_init();
288288
curl_setopt_array($feed, $options);
289289
$json = curl_exec($feed);
290+
291+
if (($error = curl_error($feed)) !== '')
292+
{
293+
curl_close($feed);
294+
295+
throw new \Exception($error);
296+
}
297+
290298
curl_close($feed);
291299

292300
return $json;

test/TwitterAPIExchangeTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function testStatusesHomeTimeline()
105105
{
106106
$url = 'https://api.twitter.com/1.1/statuses/home_timeline.json';
107107
$method = 'GET';
108-
$params = '?user_id=3232926711';
108+
$params = '?user_id=3232926711&max_id=595155660494471168';
109109

110110
$data = $this->exchange->request($url, $method, $params);
111111
$expected = "Test Tweet";

0 commit comments

Comments
 (0)