From aad80b94c5c98d25339b6e11c7d606b7204ad8ce Mon Sep 17 00:00:00 2001 From: Kim Sondrup Date: Thu, 22 Sep 2016 12:47:07 +0200 Subject: [PATCH] [PHP] Change APIException to expect headers as array (#3838) * [PHP] Change APIException to expect headers as array * Update petstore PHP --- .../src/main/resources/php/ApiException.mustache | 14 +++++++------- .../php/SwaggerClient-php/lib/ApiException.php | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache index f99a793fbc6..5562381faff 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiException.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiException.mustache @@ -43,7 +43,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[] + * @var string[]|null */ protected $responseHeaders; @@ -57,12 +57,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[]|null $responseHeaders HTTP response header + * @param mixed $responseBody HTTP body of the server response either as Json or string */ - public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, array $responseHeaders = null, $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -72,7 +72,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string HTTP response header + * @return string[]|null HTTP response header */ public function getResponseHeaders() { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index de692b68b96..63551837a16 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -64,7 +64,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[] + * @var string[]|null */ protected $responseHeaders; @@ -78,12 +78,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[]|null $responseHeaders HTTP response header + * @param mixed $responseBody HTTP body of the server response either as Json or string */ - public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) + public function __construct($message = "", $code = 0, array $responseHeaders = null, $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; @@ -93,7 +93,7 @@ class ApiException extends Exception /** * Gets the HTTP response header * - * @return string HTTP response header + * @return string[]|null HTTP response header */ public function getResponseHeaders() {