Skip to content

Commit

Permalink
Improved PHPDocs, addedd response headers to the exception information
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Jan 27, 2017
1 parent 140aa1b commit 3e5573c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/ActiveQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function init()

/**
* Creates a DB command that can be used to execute this query.
* @param Connection $db the DB connection used to create the DB command.
* @param AbstractConnection $db the DB connection used to create the DB command.
* If null, the DB connection returned by [[modelClass]] will be used.
* @return Command the created DB command instance
*/
Expand Down Expand Up @@ -237,7 +237,7 @@ public function addSelect($columns)
/**
* Executes query and returns a single row of result.
*
* @param Connection $db the DB connection used to create the DB command.
* @param AbstractConnection $db the DB connection used to create the DB command.
* If null, the DB connection returned by [[modelClass]] will be used.
* @return ActiveRecord|array|null a single row of query result. Depending on the setting of [[asArray]],
* the query result may be either an array or an ActiveRecord object. Null will be returned
Expand All @@ -256,7 +256,7 @@ public function one($db = null)

/**
* Executes query and returns all results as an array.
* @param Connection $db the DB connection used to create the DB command.
* @param AbstractConnection $db the DB connection used to create the DB command.
* If null, the DB connection returned by [[modelClass]] will be used.
* @return array|ActiveRecord[] the query results. If the query results in nothing, an empty array will be returned.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/ResponseDecodingException.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ protected function getErrorInfo()

return [
'statusCode' => $response->getStatusCode(),
'responseData' => $response->getRawData(),
'data' => $response->getRawData(),
'headers' => $response->getHeaders(),
'request' => [
'method' => $request->getMethod(),
'uri' => $request->getFullUri(),
Expand Down
3 changes: 2 additions & 1 deletion src/ResponseErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ protected function getErrorInfo()

return [
'statusCode' => $response->getStatusCode(),
'responseData' => $response->getData(),
'data' => $response->getData(),
'headers' => $response->getHeaders(),
'request' => [
'method' => $request->getMethod(),
'uri' => $request->getFullUri(),
Expand Down

0 comments on commit 3e5573c

Please sign in to comment.