Skip to content

Commit 26257da

Browse files
baartoszwing328
authored andcommitted
fixed ApiException's methods return types (#4845)
1 parent 1029b69 commit 26257da

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

modules/swagger-codegen/src/main/resources/php/ApiException.mustache

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ class ApiException extends Exception
5555
/**
5656
* Constructor
5757
*
58-
* @param string $message Error message
59-
* @param int $code HTTP status code
60-
* @param string $responseHeaders HTTP response header
61-
* @param mixed $responseBody HTTP body of the server response either as Json or string
58+
* @param string $message Error message
59+
* @param int $code HTTP status code
60+
* @param string[] $responseHeaders HTTP response header
61+
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
6262
*/
63-
public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null)
63+
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
6464
{
6565
parent::__construct($message, $code);
6666
$this->responseHeaders = $responseHeaders;
@@ -70,7 +70,7 @@ class ApiException extends Exception
7070
/**
7171
* Gets the HTTP response header
7272
*
73-
* @return string HTTP response header
73+
* @return string[] HTTP response headers
7474
*/
7575
public function getResponseHeaders()
7676
{
@@ -80,7 +80,7 @@ class ApiException extends Exception
8080
/**
8181
* Gets the HTTP body of the server response either as Json or string
8282
*
83-
* @return mixed HTTP body of the server response either as Json or string
83+
* @return mixed HTTP body of the server response either as \stdClass or string
8484
*/
8585
public function getResponseBody()
8686
{

samples/client/petstore-security-test/php/SwaggerClient-php/lib/ApiException.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ class ApiException extends Exception
6565
/**
6666
* Constructor
6767
*
68-
* @param string $message Error message
69-
* @param int $code HTTP status code
70-
* @param string $responseHeaders HTTP response header
71-
* @param mixed $responseBody HTTP body of the server response either as Json or string
68+
* @param string $message Error message
69+
* @param int $code HTTP status code
70+
* @param string[] $responseHeaders HTTP response header
71+
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
7272
*/
73-
public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null)
73+
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
7474
{
7575
parent::__construct($message, $code);
7676
$this->responseHeaders = $responseHeaders;
@@ -80,7 +80,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = null, $
8080
/**
8181
* Gets the HTTP response header
8282
*
83-
* @return string HTTP response header
83+
* @return string[] HTTP response headers
8484
*/
8585
public function getResponseHeaders()
8686
{
@@ -90,7 +90,7 @@ public function getResponseHeaders()
9090
/**
9191
* Gets the HTTP body of the server response either as Json or string
9292
*
93-
* @return mixed HTTP body of the server response either as Json or string
93+
* @return mixed HTTP body of the server response either as \stdClass or string
9494
*/
9595
public function getResponseBody()
9696
{

samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ class ApiException extends Exception
6565
/**
6666
* Constructor
6767
*
68-
* @param string $message Error message
69-
* @param int $code HTTP status code
70-
* @param string $responseHeaders HTTP response header
71-
* @param mixed $responseBody HTTP body of the server response either as Json or string
68+
* @param string $message Error message
69+
* @param int $code HTTP status code
70+
* @param string[] $responseHeaders HTTP response header
71+
* @param mixed $responseBody HTTP decoded body of the server response either as \stdClass or string
7272
*/
73-
public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null)
73+
public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null)
7474
{
7575
parent::__construct($message, $code);
7676
$this->responseHeaders = $responseHeaders;
@@ -80,7 +80,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = null, $
8080
/**
8181
* Gets the HTTP response header
8282
*
83-
* @return string HTTP response header
83+
* @return string[] HTTP response headers
8484
*/
8585
public function getResponseHeaders()
8686
{
@@ -90,7 +90,7 @@ public function getResponseHeaders()
9090
/**
9191
* Gets the HTTP body of the server response either as Json or string
9292
*
93-
* @return mixed HTTP body of the server response either as Json or string
93+
* @return mixed HTTP body of the server response either as \stdClass or string
9494
*/
9595
public function getResponseBody()
9696
{

samples/client/petstore/php/test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

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

0 commit comments

Comments
 (0)