fixed ApiException's methods return types (#4845)

This commit is contained in:
baartosz
2017-03-02 08:45:42 +00:00
committed by wing328
parent 1029b692e5
commit 26257daec3
4 changed files with 23 additions and 23 deletions

View File

@@ -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;
@@ -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()
{
@@ -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()
{

View File

@@ -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;
@@ -80,7 +80,7 @@ class ApiException extends Exception
/**
* Gets the HTTP response header
*
* @return string HTTP response header
* @return string[] HTTP response headers
*/
public function getResponseHeaders()
{
@@ -90,7 +90,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()
{

View File

@@ -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;
@@ -80,7 +80,7 @@ class ApiException extends Exception
/**
* Gets the HTTP response header
*
* @return string HTTP response header
* @return string[] HTTP response headers
*/
public function getResponseHeaders()
{
@@ -90,7 +90,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()
{

View File

@@ -55,7 +55,7 @@ try {
} 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";
}