forked from loafle/openapi-generator-original
fixed ApiException's methods return types (#4845)
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user