diff --git a/modules/openapi-generator/src/main/resources/php/api.mustache b/modules/openapi-generator/src/main/resources/php/api.mustache index 1debf085696..34fc0b3057f 100644 --- a/modules/openapi-generator/src/main/resources/php/api.mustache +++ b/modules/openapi-generator/src/main/resources/php/api.mustache @@ -189,7 +189,7 @@ use {{invokerPackage}}\ObjectSerializer; "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -219,7 +219,7 @@ use {{invokerPackage}}\ObjectSerializer; if ('{{dataType}}' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -238,7 +238,7 @@ use {{invokerPackage}}\ObjectSerializer; if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -353,7 +353,7 @@ use {{invokerPackage}}\ObjectSerializer; if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 4d01e48008b..5cf4e964777 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -156,7 +156,7 @@ class AnotherFakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -181,7 +181,7 @@ class AnotherFakeApi if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -196,7 +196,7 @@ class AnotherFakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -263,7 +263,7 @@ class AnotherFakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 527f71a9497..ff8e6d69248 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -155,7 +155,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -371,7 +371,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -396,7 +396,7 @@ class FakeApi if ('bool' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -411,7 +411,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -478,7 +478,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -628,7 +628,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -653,7 +653,7 @@ class FakeApi if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -668,7 +668,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -735,7 +735,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -885,7 +885,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -910,7 +910,7 @@ class FakeApi if ('float' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -925,7 +925,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -992,7 +992,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1142,7 +1142,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1167,7 +1167,7 @@ class FakeApi if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1182,7 +1182,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1249,7 +1249,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1398,7 +1398,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1615,7 +1615,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1848,7 +1848,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1873,7 +1873,7 @@ class FakeApi if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1888,7 +1888,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1955,7 +1955,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2140,7 +2140,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2535,7 +2535,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2818,7 +2818,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3099,7 +3099,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3320,7 +3320,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3557,7 +3557,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 249310a4c93..2d0d87e5d1a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -156,7 +156,7 @@ class FakeClassnameTags123Api "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -181,7 +181,7 @@ class FakeClassnameTags123Api if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -196,7 +196,7 @@ class FakeClassnameTags123Api if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -263,7 +263,7 @@ class FakeClassnameTags123Api if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index d51e1eb0d67..1d162e01629 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -155,7 +155,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -380,7 +380,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -616,7 +616,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -641,7 +641,7 @@ class PetApi if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -656,7 +656,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -723,7 +723,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -891,7 +891,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -916,7 +916,7 @@ class PetApi if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -931,7 +931,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -998,7 +998,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1166,7 +1166,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1191,7 +1191,7 @@ class PetApi if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1206,7 +1206,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1273,7 +1273,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1442,7 +1442,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1669,7 +1669,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1916,7 +1916,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1941,7 +1941,7 @@ class PetApi if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1956,7 +1956,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2027,7 +2027,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2211,7 +2211,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2236,7 +2236,7 @@ class PetApi if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2251,7 +2251,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2322,7 +2322,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 0c303fc86eb..f3951f8005d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -155,7 +155,7 @@ class StoreApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -378,7 +378,7 @@ class StoreApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -403,7 +403,7 @@ class StoreApi if ('map[string,int]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -418,7 +418,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -483,7 +483,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -638,7 +638,7 @@ class StoreApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -663,7 +663,7 @@ class StoreApi if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -678,7 +678,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -745,7 +745,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -917,7 +917,7 @@ class StoreApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -942,7 +942,7 @@ class StoreApi if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -957,7 +957,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1024,7 +1024,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index fa9839fa21d..7e756a60421 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -155,7 +155,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -374,7 +374,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -593,7 +593,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -812,7 +812,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1037,7 +1037,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1062,7 +1062,7 @@ class UserApi if ('\OpenAPI\Client\Model\User' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1077,7 +1077,7 @@ class UserApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1144,7 +1144,7 @@ class UserApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1311,7 +1311,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1336,7 +1336,7 @@ class UserApi if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1351,7 +1351,7 @@ class UserApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1420,7 +1420,7 @@ class UserApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1589,7 +1589,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1798,7 +1798,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index a85ca08dc2a..54b6b23e56b 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -156,7 +156,7 @@ class AnotherFakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -181,7 +181,7 @@ class AnotherFakeApi if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -196,7 +196,7 @@ class AnotherFakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -263,7 +263,7 @@ class AnotherFakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 5aa7cb7bd5f..6509b1adbe8 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -150,7 +150,7 @@ class DefaultApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -175,7 +175,7 @@ class DefaultApi if ('\OpenAPI\Client\Model\InlineResponseDefault' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -190,7 +190,7 @@ class DefaultApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -255,7 +255,7 @@ class DefaultApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 5c600e51d71..a4fb9c82888 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -154,7 +154,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -179,7 +179,7 @@ class FakeApi if ('\OpenAPI\Client\Model\HealthCheckResult' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -194,7 +194,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -259,7 +259,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -405,7 +405,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -430,7 +430,7 @@ class FakeApi if ('bool' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -445,7 +445,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -512,7 +512,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -662,7 +662,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -687,7 +687,7 @@ class FakeApi if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -702,7 +702,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -769,7 +769,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -919,7 +919,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -944,7 +944,7 @@ class FakeApi if ('float' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -959,7 +959,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1026,7 +1026,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1176,7 +1176,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1201,7 +1201,7 @@ class FakeApi if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1216,7 +1216,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1283,7 +1283,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1432,7 +1432,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1649,7 +1649,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1882,7 +1882,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1907,7 +1907,7 @@ class FakeApi if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1922,7 +1922,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1989,7 +1989,7 @@ class FakeApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2174,7 +2174,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2569,7 +2569,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2852,7 +2852,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3137,7 +3137,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3358,7 +3358,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -3595,7 +3595,7 @@ class FakeApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 68745dca6bb..d02129c035d 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -156,7 +156,7 @@ class FakeClassnameTags123Api "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -181,7 +181,7 @@ class FakeClassnameTags123Api if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -196,7 +196,7 @@ class FakeClassnameTags123Api if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -263,7 +263,7 @@ class FakeClassnameTags123Api if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 09a92a02a57..380f77af259 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -163,7 +163,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -406,7 +406,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -642,7 +642,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -667,7 +667,7 @@ class PetApi if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -682,7 +682,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -749,7 +749,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -917,7 +917,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -942,7 +942,7 @@ class PetApi if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -957,7 +957,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1024,7 +1024,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1192,7 +1192,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1217,7 +1217,7 @@ class PetApi if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1232,7 +1232,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1299,7 +1299,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1476,7 +1476,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1721,7 +1721,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1968,7 +1968,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1993,7 +1993,7 @@ class PetApi if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2008,7 +2008,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2079,7 +2079,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2263,7 +2263,7 @@ class PetApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -2288,7 +2288,7 @@ class PetApi if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2303,7 +2303,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -2374,7 +2374,7 @@ class PetApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 1287dd6d578..a62aebf8e48 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -155,7 +155,7 @@ class StoreApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -378,7 +378,7 @@ class StoreApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -403,7 +403,7 @@ class StoreApi if ('map[string,int]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -418,7 +418,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -483,7 +483,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -638,7 +638,7 @@ class StoreApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -663,7 +663,7 @@ class StoreApi if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -678,7 +678,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -745,7 +745,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -917,7 +917,7 @@ class StoreApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -942,7 +942,7 @@ class StoreApi if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -957,7 +957,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1024,7 +1024,7 @@ class StoreApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ diff --git a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 2625f3a843e..fac6d96dbd4 100644 --- a/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/openapi3/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -155,7 +155,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -374,7 +374,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -593,7 +593,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -812,7 +812,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1037,7 +1037,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1062,7 +1062,7 @@ class UserApi if ('\OpenAPI\Client\Model\User' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1077,7 +1077,7 @@ class UserApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1144,7 +1144,7 @@ class UserApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1311,7 +1311,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1336,7 +1336,7 @@ class UserApi if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1351,7 +1351,7 @@ class UserApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1420,7 +1420,7 @@ class UserApi if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { - $content = $responseBody->getContents(); + $content = (string) $responseBody; } return [ @@ -1589,7 +1589,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); } @@ -1798,7 +1798,7 @@ class UserApi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() ? (string) $e->getResponse()->getBody() : null ); }