Skip to content

Commit

Permalink
Merge pull request #117 from J7mbo/develop
Browse files Browse the repository at this point in the history
1.0.2
  • Loading branch information
J7mbo committed May 10, 2015
2 parents f41f025 + 24ba95b commit ee430b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions TwitterAPIExchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ public function buildOauth($url, $requestMethod)
*/
public function performRequest($return = true)
{
if (!is_bool($return))
{
throw new Exception('performRequest parameter must be true or false');
if (!is_bool($return))
{
throw new Exception('performRequest parameter must be true or false');
}

$header = array($this->buildAuthorizationHeader($this->oauth), 'Expect:');

$getfield = $this->getGetfield();
$postfields = $this->getPostfields();

Expand All @@ -287,6 +287,14 @@ public function performRequest($return = true)
$feed = curl_init();
curl_setopt_array($feed, $options);
$json = curl_exec($feed);

if (($error = curl_error($feed)) !== '')
{
curl_close($feed);

throw new \Exception($error);
}

curl_close($feed);

return $json;
Expand Down
2 changes: 1 addition & 1 deletion test/TwitterAPIExchangeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function testStatusesHomeTimeline()
{
$url = 'https://api.twitter.com/1.1/statuses/home_timeline.json';
$method = 'GET';
$params = '?user_id=3232926711';
$params = '?user_id=3232926711&max_id=595155660494471168';

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

0 comments on commit ee430b2

Please sign in to comment.