From 40f4478110b1b23eefa447b1bf2a67be32bf0b3b Mon Sep 17 00:00:00 2001 From: Bartosz Bialek Date: Thu, 23 Feb 2017 09:32:57 +0000 Subject: [PATCH] fixed ApiException's methods return types --- .../src/main/resources/php/ApiException.mustache | 14 +++++++------- .../php/SwaggerClient-php/lib/ApiException.php | 14 +++++++------- .../php/SwaggerClient-php/lib/ApiException.php | 14 +++++++------- samples/client/petstore/php/test.php | 4 ++-- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache index 3df0f467fc0..31dc76fe3fb 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache @@ -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() { diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php index 4c029f982ae..6bc8c02024d 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php @@ -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 @@ 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() { @@ -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() { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index 8fa9056dbab..2c1a040490b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -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 @@ 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() { @@ -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() { diff --git a/samples/client/petstore/php/test.php b/samples/client/petstore/php/test.php index 6f571a1c176..5c27e3d7ae9 100644 --- a/samples/client/petstore/php/test.php +++ b/samples/client/petstore/php/test.php @@ -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"; }