Skip to content

Commit

Permalink
Merge pull request #5 from cegrif01/master
Browse files Browse the repository at this point in the history
fixed a bug in rawRequest method.  On a 422 (validation) error, it would...
  • Loading branch information
Brian Webb committed Feb 5, 2014
2 parents 0d68999 + e4d4a56 commit 97833f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"php": ">=5.3.0",
"illuminate/support": "4.x",
"guzzle/guzzle": "~3.7",
"doctrine/inflector": "1.0.*@dev"
"doctrine/inflector": "1.0.*@dev",
"mockery/mockery": "dev-master"
},
"require-dev": {
"phpdocumentor/phpdocumentor": "dev-develop",
Expand Down
6 changes: 3 additions & 3 deletions src/Indatus/ActiveResource/ActiveResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -1294,10 +1294,10 @@ function (\Guzzle\Common\Event $event) {
//get the errors and set them
$response = self::parseResponseStringToObject($event['response']->getBody(true));
if (property_exists($response, 'errors')) {
return new ActiveResourceRawResponse(false, $result, $response->errors);
return new ActiveResourceRawResponse(false, $response, $response->errors);
}

return new ActiveResourceRawResponse(false, $result);
return new ActiveResourceRawResponse(false, $response);
}
}
);
Expand Down Expand Up @@ -1326,7 +1326,7 @@ function (\Guzzle\Common\Event $event) {
//get the errors and set them
$result = self::parseResponseStringToObject($response->getBody(true));
if (property_exists($result, 'errors')) {
return new ActiveResourceRawResponse(false, $result, $response->errors);
return new ActiveResourceRawResponse(false, $result, $result->errors);
}

return new ActiveResourceRawResponse(false, $result);
Expand Down

0 comments on commit 97833f1

Please sign in to comment.