Skip to content

Commit

Permalink
Fix for error when calling public method getCallsRemaining() (#2)
Browse files Browse the repository at this point in the history
The X-Shopify-Shop-Api-Call-Limit header now returns an array with a single string element instead of just a string, this fixes that. Credit to @tpenaranda
  • Loading branch information
tpenaranda authored and LukeTowers committed May 17, 2019
1 parent 45217cd commit 1d927b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Shopify.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,6 @@ protected function getCallLimitHeaderValue()
throw new Exception("Call limits can't be polled before a request has been made.");
}

return explode('/', $this->last_response_headers['X-Shopify-Shop-Api-Call-Limit']);
return explode('/', $this->last_response_headers['X-Shopify-Shop-Api-Call-Limit'][0]);
}
}

0 comments on commit 1d927b2

Please sign in to comment.