Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lastResponse attribute to the client var #112

Merged
merged 1 commit into from
Dec 30, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Services/Twilio.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Services_Twilio extends Services_Twilio_Resource

protected $http;
protected $retryAttempts;
protected $lastResponse;
protected $version;
protected $versions = array('2008-08-01', '2010-04-01');

Expand Down Expand Up @@ -208,6 +209,7 @@ private function _processResponse($response)
);
}
if (200 <= $status && $status < 300) {
$this->lastResponse = $decoded;
return $decoded;
}
throw new Services_Twilio_RestException(
Expand Down
2 changes: 1 addition & 1 deletion Services/Twilio/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function __get($key) {
public function __toString() {
$out = array();
foreach ($this as $key => $value) {
if ($key !== "client") {
if ($key !== "client" && $key !== "subresources") {
$out[$key] = (string)$value;
}
}
Expand Down