Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ class ApiException extends Exception
/**
* Constructor
*
* @param string $message Error message
* @param int $code HTTP status code
* @param string $responseHeaders HTTP response header
* @param mixed $responseBody HTTP body of the server response either as Json or string
* @param string $message Error message
* @param int $code HTTP status code
* @param string[] $responseHeaders HTTP response header
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
*/
public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null)
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
{
parent::__construct($message, $code);
$this->responseHeaders = $responseHeaders;
Expand All @@ -70,7 +70,7 @@ class ApiException extends Exception
/**
* Gets the HTTP response header
*
* @return string HTTP response header
* @return string[] HTTP response headers
*/
public function getResponseHeaders()
{
Expand All @@ -80,7 +80,7 @@ class ApiException extends Exception
/**
* Gets the HTTP body of the server response either as Json or string
*
* @return mixed HTTP body of the server response either as Json or string
* @return mixed HTTP body of the server response either as \stdClass or string
*/
public function getResponseBody()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class ApiException extends Exception
/**
* Constructor
*
* @param string $message Error message
* @param int $code HTTP status code
* @param string $responseHeaders HTTP response header
* @param mixed $responseBody HTTP body of the server response either as Json or string
* @param string $message Error message
* @param int $code HTTP status code
* @param string[] $responseHeaders HTTP response header
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
*/
public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null)
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
{
parent::__construct($message, $code);
$this->responseHeaders = $responseHeaders;
Expand All @@ -80,7 +80,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = null, $
/**
* Gets the HTTP response header
*
* @return string HTTP response header
* @return string[] HTTP response headers
*/
public function getResponseHeaders()
{
Expand All @@ -90,7 +90,7 @@ public function getResponseHeaders()
/**
* Gets the HTTP body of the server response either as Json or string
*
* @return mixed HTTP body of the server response either as Json or string
* @return mixed HTTP body of the server response either as \stdClass or string
*/
public function getResponseBody()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class ApiException extends Exception
/**
* Constructor
*
* @param string $message Error message
* @param int $code HTTP status code
* @param string $responseHeaders HTTP response header
* @param mixed $responseBody HTTP body of the server response either as Json or string
* @param string $message Error message
* @param int $code HTTP status code
* @param string[] $responseHeaders HTTP response header
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
*/
public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null)
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
{
parent::__construct($message, $code);
$this->responseHeaders = $responseHeaders;
Expand All @@ -80,7 +80,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = null, $
/**
* Gets the HTTP response header
*
* @return string HTTP response header
* @return string[] HTTP response headers
*/
public function getResponseHeaders()
{
Expand All @@ -90,7 +90,7 @@ public function getResponseHeaders()
/**
* Gets the HTTP body of the server response either as Json or string
*
* @return mixed HTTP body of the server response either as Json or string
* @return mixed HTTP body of the server response either as \stdClass or string
*/
public function getResponseBody()
{
Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/php/test.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

} catch (Swagger\Client\ApiException $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
echo 'HTTP response headers: ', $e->getResponseHeaders(), "\n";
echo 'HTTP response body: ', $e->getResponseBody(), "\n";
echo 'HTTP response headers: ', print_r($e->getResponseHeaders(), true), "\n";
echo 'HTTP response body: ', print_r($e->getResponseBody(), true), "\n";
echo 'HTTP status code: ', $e->getCode(), "\n";
}