From fcbb0f5429399d7b0d3eebe89cacfcf0b31c103a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 8 Nov 2018 16:16:20 +0800 Subject: [PATCH 1/2] add file post processing to php --- .../codegen/languages/AbstractPhpCodegen.java | 39 +- .../lib/Api/AnotherFakeApi.php | 70 +- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 1133 +++++++++++------ .../lib/Api/FakeClassnameTags123Api.php | 69 +- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 688 ++++++---- .../OpenAPIClient-php/lib/Api/StoreApi.php | 258 ++-- .../php/OpenAPIClient-php/lib/Api/UserApi.php | 470 +++---- .../OpenAPIClient-php/lib/ApiException.php | 11 +- .../OpenAPIClient-php/lib/Configuration.php | 17 +- .../OpenAPIClient-php/lib/HeaderSelector.php | 18 +- .../lib/Model/AdditionalPropertiesClass.php | 49 +- .../OpenAPIClient-php/lib/Model/Animal.php | 47 +- .../lib/Model/AnimalFarm.php | 58 +- .../lib/Model/ApiResponse.php | 43 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 45 +- .../lib/Model/ArrayOfNumberOnly.php | 43 +- .../OpenAPIClient-php/lib/Model/ArrayTest.php | 55 +- .../lib/Model/Capitalization.php | 65 +- .../php/OpenAPIClient-php/lib/Model/Cat.php | 46 +- .../OpenAPIClient-php/lib/Model/Category.php | 43 +- .../lib/Model/ClassModel.php | 43 +- .../OpenAPIClient-php/lib/Model/Client.php | 43 +- .../php/OpenAPIClient-php/lib/Model/Dog.php | 46 +- .../lib/Model/EnumArrays.php | 65 +- .../OpenAPIClient-php/lib/Model/EnumClass.php | 14 +- .../OpenAPIClient-php/lib/Model/EnumTest.php | 119 +- .../php/OpenAPIClient-php/lib/Model/File.php | 43 +- .../lib/Model/FileSchemaTestClass.php | 43 +- .../lib/Model/FormatTest.php | 277 ++-- .../lib/Model/HasOnlyReadOnly.php | 39 +- .../OpenAPIClient-php/lib/Model/MapTest.php | 68 +- ...PropertiesAndAdditionalPropertiesClass.php | 47 +- .../lib/Model/Model200Response.php | 43 +- .../lib/Model/ModelInterface.php | 2 +- .../OpenAPIClient-php/lib/Model/ModelList.php | 43 +- .../lib/Model/ModelReturn.php | 43 +- .../php/OpenAPIClient-php/lib/Model/Name.php | 51 +- .../lib/Model/NumberOnly.php | 43 +- .../php/OpenAPIClient-php/lib/Model/Order.php | 65 +- .../lib/Model/OuterComposite.php | 51 +- .../OpenAPIClient-php/lib/Model/OuterEnum.php | 14 +- .../php/OpenAPIClient-php/lib/Model/Pet.php | 57 +- .../lib/Model/ReadOnlyFirst.php | 39 +- .../lib/Model/SpecialModelName.php | 45 +- .../lib/Model/StringBooleanMap.php | 58 +- .../php/OpenAPIClient-php/lib/Model/Tag.php | 39 +- .../php/OpenAPIClient-php/lib/Model/User.php | 67 +- .../lib/ObjectSerializer.php | 162 ++- .../test/Api/AnotherFakeApiTest.php | 9 +- .../test/Api/FakeApiTest.php | 9 +- .../test/Api/FakeClassnameTags123ApiTest.php | 9 +- .../OpenAPIClient-php/test/Api/PetApiTest.php | 9 +- .../test/Api/StoreApiTest.php | 9 +- .../test/Api/UserApiTest.php | 9 +- .../Model/AdditionalPropertiesClassTest.php | 3 +- .../test/Model/AnimalFarmTest.php | 3 +- .../test/Model/AnimalTest.php | 3 +- .../test/Model/ApiResponseTest.php | 3 +- .../Model/ArrayOfArrayOfNumberOnlyTest.php | 3 +- .../test/Model/ArrayOfNumberOnlyTest.php | 3 +- .../test/Model/ArrayTestTest.php | 3 +- .../test/Model/CapitalizationTest.php | 3 +- .../OpenAPIClient-php/test/Model/CatTest.php | 3 +- .../test/Model/CategoryTest.php | 3 +- .../test/Model/ClassModelTest.php | 3 +- .../test/Model/ClientTest.php | 3 +- .../OpenAPIClient-php/test/Model/DogTest.php | 3 +- .../test/Model/EnumArraysTest.php | 3 +- .../test/Model/EnumClassTest.php | 3 +- .../test/Model/EnumTestTest.php | 3 +- .../test/Model/FileSchemaTestClassTest.php | 3 +- .../OpenAPIClient-php/test/Model/FileTest.php | 3 +- .../test/Model/FormatTestTest.php | 3 +- .../test/Model/HasOnlyReadOnlyTest.php | 3 +- .../test/Model/MapTestTest.php | 3 +- ...ertiesAndAdditionalPropertiesClassTest.php | 6 +- .../test/Model/Model200ResponseTest.php | 3 +- .../test/Model/ModelListTest.php | 3 +- .../test/Model/ModelReturnTest.php | 3 +- .../OpenAPIClient-php/test/Model/NameTest.php | 3 +- .../test/Model/NumberOnlyTest.php | 3 +- .../test/Model/OrderTest.php | 3 +- .../test/Model/OuterCompositeTest.php | 3 +- .../test/Model/OuterEnumTest.php | 3 +- .../OpenAPIClient-php/test/Model/PetTest.php | 3 +- .../test/Model/ReadOnlyFirstTest.php | 3 +- .../test/Model/SpecialModelNameTest.php | 3 +- .../test/Model/StringBooleanMapTest.php | 3 +- .../OpenAPIClient-php/test/Model/TagTest.php | 3 +- .../OpenAPIClient-php/test/Model/UserTest.php | 3 +- 90 files changed, 2904 insertions(+), 2197 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java index 2490293204d8..967fd8357aed 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractPhpCodegen.java @@ -18,6 +18,7 @@ import io.swagger.v3.oas.models.media.ArraySchema; import io.swagger.v3.oas.models.media.Schema; +import org.apache.commons.io.FilenameUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CliOption; import org.openapitools.codegen.CodegenConfig; @@ -40,12 +41,6 @@ import java.util.Map; import java.util.regex.Matcher; -import org.apache.commons.lang3.StringUtils; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - - public abstract class AbstractPhpCodegen extends DefaultCodegen implements CodegenConfig { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractPhpCodegen.class); @@ -161,6 +156,11 @@ public AbstractPhpCodegen() { public void processOpts() { super.processOpts(); + if (StringUtils.isEmpty(System.getenv("PHP_POST_PROCESS_FILE"))) { + LOGGER.info("Environment variable PHP_POST_PROCESS_FILE not defined so the PHP code may not be properly formatted. To define it, try 'export PHP_POST_PROCESS_FILE=\"/usr/local/bin/prettier --write\"' (Linux/Mac)"); + LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI)."); + } + if (additionalProperties.containsKey(PACKAGE_NAME)) { this.setPackageName((String) additionalProperties.get(PACKAGE_NAME)); } else { @@ -773,4 +773,31 @@ protected String extractSimpleName(String phpClassName) { final int lastBackslashIndex = phpClassName.lastIndexOf('\\'); return phpClassName.substring(lastBackslashIndex + 1); } + + @Override + public void postProcessFile(File file, String fileType) { + if (file == null) { + return; + } + String phpPostProcessFile = System.getenv("PHP_POST_PROCESS_FILE"); + if (StringUtils.isEmpty(phpPostProcessFile)) { + return; // skip if PHP_POST_PROCESS_FILE env variable is not defined + } + // only process files with php extension + if ("php".equals(FilenameUtils.getExtension(file.toString()))) { + String command = phpPostProcessFile + " " + file.toString(); + try { + Process p = Runtime.getRuntime().exec(command); + p.waitFor(); + int exitValue = p.exitValue(); + if (exitValue != 0) { + LOGGER.error("Error running the command ({}). Exit value: {}", command, exitValue); + } else { + LOGGER.info("Successfully executed: " + command); + } + } catch (Exception e) { + LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage()); + } + } + } } 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 4c23e6c15228..73f99e310aed 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -128,7 +128,12 @@ public function call123TestSpecialTagsWithHttpInfo($client) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -148,7 +153,7 @@ public function call123TestSpecialTagsWithHttpInfo($client) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -157,7 +162,11 @@ public function call123TestSpecialTagsWithHttpInfo($client) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\Client', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -176,7 +185,6 @@ public function call123TestSpecialTagsWithHttpInfo($client) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -204,12 +212,11 @@ public function call123TestSpecialTagsWithHttpInfo($client) */ public function call123TestSpecialTagsAsync($client) { - return $this->call123TestSpecialTagsAsyncWithHttpInfo($client) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->call123TestSpecialTagsAsyncWithHttpInfo($client)->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -239,7 +246,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -285,8 +296,6 @@ protected function call123TestSpecialTagsRequest($client) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($client)) { @@ -294,9 +303,9 @@ protected function call123TestSpecialTagsRequest($client) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -308,7 +317,9 @@ protected function call123TestSpecialTagsRequest($client) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -323,32 +334,27 @@ protected function call123TestSpecialTagsRequest($client) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -364,9 +370,15 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + $options[RequestOptions::DEBUG] = fopen( + $this->config->getDebugFile(), + 'a' + ); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException( + 'Failed to open the debug file: ' . + $this->config->getDebugFile() + ); } } 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 11d71a693780..b83f2c7165ad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -124,7 +124,12 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -144,7 +149,7 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('bool' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -172,7 +177,6 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -191,7 +195,7 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) /** * Operation fakeOuterBooleanSerializeAsync * - * + * * * @param bool $body Input boolean as post body (optional) * @@ -200,18 +204,17 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) */ public function fakeOuterBooleanSerializeAsync($body = null) { - return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body)->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation fakeOuterBooleanSerializeAsyncWithHttpInfo * - * + * * * @param bool $body Input boolean as post body (optional) * @@ -235,7 +238,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -267,7 +274,6 @@ function ($exception) { */ protected function fakeOuterBooleanSerializeRequest($body = null) { - $resourcePath = '/fake/outer/boolean'; $formParams = []; $queryParams = []; @@ -275,8 +281,6 @@ protected function fakeOuterBooleanSerializeRequest($body = null) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($body)) { @@ -284,21 +288,20 @@ protected function fakeOuterBooleanSerializeRequest($body = null) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + '*/*' + ]); } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - [] - ); + $headers = $this->headerSelector->selectHeaders(['*/*'], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -313,32 +316,27 @@ protected function fakeOuterBooleanSerializeRequest($body = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -355,7 +353,9 @@ protected function fakeOuterBooleanSerializeRequest($body = null) */ public function fakeOuterCompositeSerialize($outer_composite = null) { - list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo($outer_composite); + list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo( + $outer_composite + ); return $response; } @@ -368,8 +368,9 @@ public function fakeOuterCompositeSerialize($outer_composite = null) * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OuterComposite, HTTP status code, HTTP response headers (array of strings) */ - public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) - { + public function fakeOuterCompositeSerializeWithHttpInfo( + $outer_composite = null + ) { $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); try { @@ -381,7 +382,12 @@ public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -401,16 +407,23 @@ public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: - if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') { + if ( + '\OpenAPI\Client\Model\OuterComposite' === + '\SplFileObject' + ) { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\OuterComposite', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\OuterComposite', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -429,7 +442,6 @@ public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -448,7 +460,7 @@ public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) /** * Operation fakeOuterCompositeSerializeAsync * - * + * * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * @@ -457,26 +469,26 @@ public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) */ public function fakeOuterCompositeSerializeAsync($outer_composite = null) { - return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo( + $outer_composite + )->then(function ($response) { + return $response[0]; + }); } /** * Operation fakeOuterCompositeSerializeAsyncWithHttpInfo * - * + * * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite = null) - { + public function fakeOuterCompositeSerializeAsyncWithHttpInfo( + $outer_composite = null + ) { $returnType = '\OpenAPI\Client\Model\OuterComposite'; $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); @@ -492,7 +504,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -522,9 +538,9 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fakeOuterCompositeSerializeRequest($outer_composite = null) - { - + protected function fakeOuterCompositeSerializeRequest( + $outer_composite = null + ) { $resourcePath = '/fake/outer/composite'; $formParams = []; $queryParams = []; @@ -532,8 +548,6 @@ protected function fakeOuterCompositeSerializeRequest($outer_composite = null) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($outer_composite)) { @@ -541,21 +555,20 @@ protected function fakeOuterCompositeSerializeRequest($outer_composite = null) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + '*/*' + ]); } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - [] - ); + $headers = $this->headerSelector->selectHeaders(['*/*'], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -570,32 +583,27 @@ protected function fakeOuterCompositeSerializeRequest($outer_composite = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -638,7 +646,12 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -658,7 +671,7 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('float' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -686,7 +699,6 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -705,7 +717,7 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) /** * Operation fakeOuterNumberSerializeAsync * - * + * * * @param float $body Input number as post body (optional) * @@ -714,18 +726,17 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) */ public function fakeOuterNumberSerializeAsync($body = null) { - return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body)->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation fakeOuterNumberSerializeAsyncWithHttpInfo * - * + * * * @param float $body Input number as post body (optional) * @@ -749,7 +760,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -781,7 +796,6 @@ function ($exception) { */ protected function fakeOuterNumberSerializeRequest($body = null) { - $resourcePath = '/fake/outer/number'; $formParams = []; $queryParams = []; @@ -789,8 +803,6 @@ protected function fakeOuterNumberSerializeRequest($body = null) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($body)) { @@ -798,21 +810,20 @@ protected function fakeOuterNumberSerializeRequest($body = null) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + '*/*' + ]); } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - [] - ); + $headers = $this->headerSelector->selectHeaders(['*/*'], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -827,32 +838,27 @@ protected function fakeOuterNumberSerializeRequest($body = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -895,7 +901,12 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -915,7 +926,7 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -943,7 +954,6 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -962,7 +972,7 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) /** * Operation fakeOuterStringSerializeAsync * - * + * * * @param string $body Input string as post body (optional) * @@ -971,18 +981,17 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) */ public function fakeOuterStringSerializeAsync($body = null) { - return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body)->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation fakeOuterStringSerializeAsyncWithHttpInfo * - * + * * * @param string $body Input string as post body (optional) * @@ -1006,7 +1015,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1038,7 +1051,6 @@ function ($exception) { */ protected function fakeOuterStringSerializeRequest($body = null) { - $resourcePath = '/fake/outer/string'; $formParams = []; $queryParams = []; @@ -1046,8 +1058,6 @@ protected function fakeOuterStringSerializeRequest($body = null) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($body)) { @@ -1055,21 +1065,20 @@ protected function fakeOuterStringSerializeRequest($body = null) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['*/*'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + '*/*' + ]); } else { - $headers = $this->headerSelector->selectHeaders( - ['*/*'], - [] - ); + $headers = $this->headerSelector->selectHeaders(['*/*'], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1084,32 +1093,27 @@ protected function fakeOuterStringSerializeRequest($body = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1140,7 +1144,9 @@ public function testBodyWithFileSchema($file_schema_test_class) */ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) { - $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); + $request = $this->testBodyWithFileSchemaRequest( + $file_schema_test_class + ); try { $options = $this->createHttpClientOption(); @@ -1151,7 +1157,12 @@ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1171,7 +1182,6 @@ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1182,7 +1192,7 @@ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) /** * Operation testBodyWithFileSchemaAsync * - * + * * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) * @@ -1191,34 +1201,40 @@ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) */ public function testBodyWithFileSchemaAsync($file_schema_test_class) { - return $this->testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->testBodyWithFileSchemaAsyncWithHttpInfo( + $file_schema_test_class + )->then(function ($response) { + return $response[0]; + }); } /** * Operation testBodyWithFileSchemaAsyncWithHttpInfo * - * + * * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) - { + public function testBodyWithFileSchemaAsyncWithHttpInfo( + $file_schema_test_class + ) { $returnType = ''; - $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); + $request = $this->testBodyWithFileSchemaRequest( + $file_schema_test_class + ); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1248,7 +1264,11 @@ function ($exception) { protected function testBodyWithFileSchemaRequest($file_schema_test_class) { // verify the required parameter 'file_schema_test_class' is set - if ($file_schema_test_class === null || (is_array($file_schema_test_class) && count($file_schema_test_class) === 0)) { + if ( + $file_schema_test_class === null || + (is_array($file_schema_test_class) && + count($file_schema_test_class) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $file_schema_test_class when calling testBodyWithFileSchema' ); @@ -1261,8 +1281,6 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($file_schema_test_class)) { @@ -1270,9 +1288,7 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -1284,7 +1300,9 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1299,32 +1317,27 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1368,7 +1381,12 @@ public function testBodyWithQueryParamsWithHttpInfo($query, $user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1388,7 +1406,6 @@ public function testBodyWithQueryParamsWithHttpInfo($query, $user) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1399,7 +1416,7 @@ public function testBodyWithQueryParamsWithHttpInfo($query, $user) /** * Operation testBodyWithQueryParamsAsync * - * + * * * @param string $query (required) * @param \OpenAPI\Client\Model\User $user (required) @@ -1409,18 +1426,18 @@ public function testBodyWithQueryParamsWithHttpInfo($query, $user) */ public function testBodyWithQueryParamsAsync($query, $user) { - return $this->testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->testBodyWithQueryParamsAsyncWithHttpInfo( + $query, + $user + )->then(function ($response) { + return $response[0]; + }); } /** * Operation testBodyWithQueryParamsAsyncWithHttpInfo * - * + * * * @param string $query (required) * @param \OpenAPI\Client\Model\User $user (required) @@ -1437,7 +1454,11 @@ public function testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1492,7 +1513,6 @@ protected function testBodyWithQueryParamsRequest($query, $user) $queryParams['query'] = ObjectSerializer::toQueryValue($query); } - // body params $_tempBody = null; if (isset($user)) { @@ -1500,9 +1520,7 @@ protected function testBodyWithQueryParamsRequest($query, $user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -1514,7 +1532,9 @@ protected function testBodyWithQueryParamsRequest($query, $user) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1529,32 +1549,27 @@ protected function testBodyWithQueryParamsRequest($query, $user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1601,7 +1616,12 @@ public function testClientModelWithHttpInfo($client) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1621,7 +1641,7 @@ public function testClientModelWithHttpInfo($client) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1630,7 +1650,11 @@ public function testClientModelWithHttpInfo($client) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\Client', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1649,7 +1673,6 @@ public function testClientModelWithHttpInfo($client) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1677,12 +1700,11 @@ public function testClientModelWithHttpInfo($client) */ public function testClientModelAsync($client) { - return $this->testClientModelAsyncWithHttpInfo($client) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->testClientModelAsyncWithHttpInfo($client)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -1712,7 +1734,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1758,8 +1784,6 @@ protected function testClientModelRequest($client) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($client)) { @@ -1767,9 +1791,9 @@ protected function testClientModelRequest($client) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -1781,7 +1805,9 @@ protected function testClientModelRequest($client) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1796,32 +1822,27 @@ protected function testClientModelRequest($client) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1851,9 +1872,38 @@ protected function testClientModelRequest($client) * @throws \InvalidArgumentException * @return void */ - public function testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { - $this->testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); + public function testEndpointParameters( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer = null, + $int32 = null, + $int64 = null, + $float = null, + $string = null, + $binary = null, + $date = null, + $date_time = null, + $password = null, + $callback = null + ) { + $this->testEndpointParametersWithHttpInfo( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer, + $int32, + $int64, + $float, + $string, + $binary, + $date, + $date_time, + $password, + $callback + ); } /** @@ -1880,9 +1930,38 @@ public function testEndpointParameters($number, $double, $pattern_without_delimi * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { - $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); + public function testEndpointParametersWithHttpInfo( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer = null, + $int32 = null, + $int64 = null, + $float = null, + $string = null, + $binary = null, + $date = null, + $date_time = null, + $password = null, + $callback = null + ) { + $request = $this->testEndpointParametersRequest( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer, + $int32, + $int64, + $float, + $string, + $binary, + $date, + $date_time, + $password, + $callback + ); try { $options = $this->createHttpClientOption(); @@ -1893,7 +1972,12 @@ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_wi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1913,7 +1997,6 @@ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_wi } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1944,14 +2027,40 @@ public function testEndpointParametersWithHttpInfo($number, $double, $pattern_wi * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEndpointParametersAsync($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { - return $this->testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback) - ->then( - function ($response) { - return $response[0]; - } - ); + public function testEndpointParametersAsync( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer = null, + $int32 = null, + $int64 = null, + $float = null, + $string = null, + $binary = null, + $date = null, + $date_time = null, + $password = null, + $callback = null + ) { + return $this->testEndpointParametersAsyncWithHttpInfo( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer, + $int32, + $int64, + $float, + $string, + $binary, + $date, + $date_time, + $password, + $callback + )->then(function ($response) { + return $response[0]; + }); } /** @@ -1977,16 +2086,49 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { + public function testEndpointParametersAsyncWithHttpInfo( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer = null, + $int32 = null, + $int64 = null, + $float = null, + $string = null, + $binary = null, + $date = null, + $date_time = null, + $password = null, + $callback = null + ) { $returnType = ''; - $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); + $request = $this->testEndpointParametersRequest( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer, + $int32, + $int64, + $float, + $string, + $binary, + $date, + $date_time, + $password, + $callback + ); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2026,8 +2168,22 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) - { + protected function testEndpointParametersRequest( + $number, + $double, + $pattern_without_delimiter, + $byte, + $integer = null, + $int32 = null, + $int64 = null, + $float = null, + $string = null, + $binary = null, + $date = null, + $date_time = null, + $password = null, + $callback = null + ) { // verify the required parameter 'number' is set if ($number === null || (is_array($number) && count($number) === 0)) { throw new \InvalidArgumentException( @@ -2035,10 +2191,14 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with ); } if ($number > 543.2) { - throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.'); + throw new \InvalidArgumentException( + 'invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.' + ); } if ($number < 32.1) { - throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.'); + throw new \InvalidArgumentException( + 'invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.' + ); } // verify the required parameter 'double' is set @@ -2048,20 +2208,30 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with ); } if ($double > 123.4) { - throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.'); + throw new \InvalidArgumentException( + 'invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.' + ); } if ($double < 67.8) { - throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.'); + throw new \InvalidArgumentException( + 'invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.' + ); } // verify the required parameter 'pattern_without_delimiter' is set - if ($pattern_without_delimiter === null || (is_array($pattern_without_delimiter) && count($pattern_without_delimiter) === 0)) { + if ( + $pattern_without_delimiter === null || + (is_array($pattern_without_delimiter) && + count($pattern_without_delimiter) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $pattern_without_delimiter when calling testEndpointParameters' ); } if (!preg_match("/^[A-Z].*/", $pattern_without_delimiter)) { - throw new \InvalidArgumentException("invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*/."); + throw new \InvalidArgumentException( + "invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*/." + ); } // verify the required parameter 'byte' is set @@ -2071,35 +2241,50 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with ); } if ($integer !== null && $integer > 100) { - throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.'); + throw new \InvalidArgumentException( + 'invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.' + ); } if ($integer !== null && $integer < 10) { - throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); + throw new \InvalidArgumentException( + 'invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.' + ); } if ($int32 !== null && $int32 > 200) { - throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.'); + throw new \InvalidArgumentException( + 'invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.' + ); } if ($int32 !== null && $int32 < 20) { - throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.'); + throw new \InvalidArgumentException( + 'invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.' + ); } if ($float !== null && $float > 987.6) { - throw new \InvalidArgumentException('invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.'); + throw new \InvalidArgumentException( + 'invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.' + ); } if ($string !== null && !preg_match("/[a-z]/i", $string)) { - throw new \InvalidArgumentException("invalid value for \"string\" when calling FakeApi.testEndpointParameters, must conform to the pattern /[a-z]/i."); + throw new \InvalidArgumentException( + "invalid value for \"string\" when calling FakeApi.testEndpointParameters, must conform to the pattern /[a-z]/i." + ); } if ($password !== null && strlen($password) > 64) { - throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.'); + throw new \InvalidArgumentException( + 'invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.' + ); } if ($password !== null && strlen($password) < 10) { - throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); + throw new \InvalidArgumentException( + 'invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.' + ); } - $resourcePath = '/fake'; $formParams = []; $queryParams = []; @@ -2107,8 +2292,6 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with $httpBody = ''; $multipart = false; - - // form params if ($integer !== null) { $formParams['integer'] = ObjectSerializer::toFormValue($integer); @@ -2139,7 +2322,9 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with } // form params if ($pattern_without_delimiter !== null) { - $formParams['pattern_without_delimiter'] = ObjectSerializer::toFormValue($pattern_without_delimiter); + $formParams[ + 'pattern_without_delimiter' + ] = ObjectSerializer::toFormValue($pattern_without_delimiter); } // form params if ($byte !== null) { @@ -2148,7 +2333,10 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with // form params if ($binary !== null) { $multipart = true; - $formParams['binary'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($binary), 'rb'); + $formParams['binary'] = \GuzzleHttp\Psr7\try_fopen( + ObjectSerializer::toFormValue($binary), + 'rb' + ); } // form params if ($date !== null) { @@ -2170,9 +2358,7 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -2184,7 +2370,9 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -2199,10 +2387,8 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -2210,8 +2396,17 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with } // this endpoint requires HTTP basic authentication - if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { - $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); + if ( + $this->config->getUsername() !== null || + $this->config->getPassword() !== null + ) { + $headers['Authorization'] = + 'Basic ' . + base64_encode( + $this->config->getUsername() . + ":" . + $this->config->getPassword() + ); } $defaultHeaders = []; @@ -2219,16 +2414,14 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2252,9 +2445,26 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with * @throws \InvalidArgumentException * @return void */ - public function testEnumParameters($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - $this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); + public function testEnumParameters( + $enum_header_string_array = null, + $enum_header_string = '-efg', + $enum_query_string_array = null, + $enum_query_string = '-efg', + $enum_query_integer = null, + $enum_query_double = null, + $enum_form_string_array = '$', + $enum_form_string = '-efg' + ) { + $this->testEnumParametersWithHttpInfo( + $enum_header_string_array, + $enum_header_string, + $enum_query_string_array, + $enum_query_string, + $enum_query_integer, + $enum_query_double, + $enum_form_string_array, + $enum_form_string + ); } /** @@ -2275,9 +2485,26 @@ public function testEnumParameters($enum_header_string_array = null, $enum_heade * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); + public function testEnumParametersWithHttpInfo( + $enum_header_string_array = null, + $enum_header_string = '-efg', + $enum_query_string_array = null, + $enum_query_string = '-efg', + $enum_query_integer = null, + $enum_query_double = null, + $enum_form_string_array = '$', + $enum_form_string = '-efg' + ) { + $request = $this->testEnumParametersRequest( + $enum_header_string_array, + $enum_header_string, + $enum_query_string_array, + $enum_query_string, + $enum_query_integer, + $enum_query_double, + $enum_form_string_array, + $enum_form_string + ); try { $options = $this->createHttpClientOption(); @@ -2288,7 +2515,12 @@ public function testEnumParametersWithHttpInfo($enum_header_string_array = null, "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -2308,7 +2540,6 @@ public function testEnumParametersWithHttpInfo($enum_header_string_array = null, } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -2333,14 +2564,28 @@ public function testEnumParametersWithHttpInfo($enum_header_string_array = null, * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEnumParametersAsync($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - return $this->testEnumParametersAsyncWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string) - ->then( - function ($response) { - return $response[0]; - } - ); + public function testEnumParametersAsync( + $enum_header_string_array = null, + $enum_header_string = '-efg', + $enum_query_string_array = null, + $enum_query_string = '-efg', + $enum_query_integer = null, + $enum_query_double = null, + $enum_form_string_array = '$', + $enum_form_string = '-efg' + ) { + return $this->testEnumParametersAsyncWithHttpInfo( + $enum_header_string_array, + $enum_header_string, + $enum_query_string_array, + $enum_query_string, + $enum_query_integer, + $enum_query_double, + $enum_form_string_array, + $enum_form_string + )->then(function ($response) { + return $response[0]; + }); } /** @@ -2360,16 +2605,37 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEnumParametersAsyncWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { + public function testEnumParametersAsyncWithHttpInfo( + $enum_header_string_array = null, + $enum_header_string = '-efg', + $enum_query_string_array = null, + $enum_query_string = '-efg', + $enum_query_integer = null, + $enum_query_double = null, + $enum_form_string_array = '$', + $enum_form_string = '-efg' + ) { $returnType = ''; - $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); + $request = $this->testEnumParametersRequest( + $enum_header_string_array, + $enum_header_string, + $enum_query_string_array, + $enum_query_string, + $enum_query_integer, + $enum_query_double, + $enum_form_string_array, + $enum_form_string + ); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2403,9 +2669,16 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') - { - + protected function testEnumParametersRequest( + $enum_header_string_array = null, + $enum_header_string = '-efg', + $enum_query_string_array = null, + $enum_query_string = '-efg', + $enum_query_integer = null, + $enum_query_double = null, + $enum_form_string_array = '$', + $enum_form_string = '-efg' + ) { $resourcePath = '/fake'; $formParams = []; $queryParams = []; @@ -2415,51 +2688,71 @@ protected function testEnumParametersRequest($enum_header_string_array = null, $ // query params if (is_array($enum_query_string_array)) { - $enum_query_string_array = ObjectSerializer::serializeCollection($enum_query_string_array, 'csv', true); + $enum_query_string_array = ObjectSerializer::serializeCollection( + $enum_query_string_array, + 'csv', + true + ); } if ($enum_query_string_array !== null) { - $queryParams['enum_query_string_array'] = ObjectSerializer::toQueryValue($enum_query_string_array); + $queryParams[ + 'enum_query_string_array' + ] = ObjectSerializer::toQueryValue($enum_query_string_array); } // query params if ($enum_query_string !== null) { - $queryParams['enum_query_string'] = ObjectSerializer::toQueryValue($enum_query_string); + $queryParams['enum_query_string'] = ObjectSerializer::toQueryValue( + $enum_query_string + ); } // query params if ($enum_query_integer !== null) { - $queryParams['enum_query_integer'] = ObjectSerializer::toQueryValue($enum_query_integer); + $queryParams['enum_query_integer'] = ObjectSerializer::toQueryValue( + $enum_query_integer + ); } // query params if ($enum_query_double !== null) { - $queryParams['enum_query_double'] = ObjectSerializer::toQueryValue($enum_query_double); + $queryParams['enum_query_double'] = ObjectSerializer::toQueryValue( + $enum_query_double + ); } // header params if (is_array($enum_header_string_array)) { - $enum_header_string_array = ObjectSerializer::serializeCollection($enum_header_string_array, 'csv'); + $enum_header_string_array = ObjectSerializer::serializeCollection( + $enum_header_string_array, + 'csv' + ); } if ($enum_header_string_array !== null) { - $headerParams['enum_header_string_array'] = ObjectSerializer::toHeaderValue($enum_header_string_array); + $headerParams[ + 'enum_header_string_array' + ] = ObjectSerializer::toHeaderValue($enum_header_string_array); } // header params if ($enum_header_string !== null) { - $headerParams['enum_header_string'] = ObjectSerializer::toHeaderValue($enum_header_string); + $headerParams[ + 'enum_header_string' + ] = ObjectSerializer::toHeaderValue($enum_header_string); } - // form params if ($enum_form_string_array !== null) { - $formParams['enum_form_string_array'] = ObjectSerializer::toFormValue($enum_form_string_array); + $formParams[ + 'enum_form_string_array' + ] = ObjectSerializer::toFormValue($enum_form_string_array); } // form params if ($enum_form_string !== null) { - $formParams['enum_form_string'] = ObjectSerializer::toFormValue($enum_form_string); + $formParams['enum_form_string'] = ObjectSerializer::toFormValue( + $enum_form_string + ); } // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -2471,7 +2764,9 @@ protected function testEnumParametersRequest($enum_header_string_array = null, $ if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -2486,32 +2781,27 @@ protected function testEnumParametersRequest($enum_header_string_array = null, $ } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2554,7 +2844,11 @@ public function testGroupParameters($associative_array) */ public function testGroupParametersWithHttpInfo($associative_array) { - $request = $this->testGroupParametersRequest($associative_array['string_group'], $associative_array['boolean_group'], $associative_array['int64_group']); + $request = $this->testGroupParametersRequest( + $associative_array['string_group'], + $associative_array['boolean_group'], + $associative_array['int64_group'] + ); try { $options = $this->createHttpClientOption(); @@ -2565,7 +2859,12 @@ public function testGroupParametersWithHttpInfo($associative_array) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -2585,7 +2884,6 @@ public function testGroupParametersWithHttpInfo($associative_array) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -2609,12 +2907,11 @@ public function testGroupParametersWithHttpInfo($associative_array) */ public function testGroupParametersAsync($associative_array) { - return $this->testGroupParametersAsyncWithHttpInfo($associative_array) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->testGroupParametersAsyncWithHttpInfo( + $associative_array + )->then(function ($response) { + return $response[0]; + }); } /** @@ -2640,7 +2937,11 @@ public function testGroupParametersAsyncWithHttpInfo($associative_array) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2674,10 +2975,15 @@ function ($exception) { protected function testGroupParametersRequest($associative_array) { // unbox the parameters from the associative array - $string_group = array_key_exists('string_group', $associative_array) ? $associative_array['string_group'] : null; - $boolean_group = array_key_exists('boolean_group', $associative_array) ? $associative_array['boolean_group'] : null; - $int64_group = array_key_exists('int64_group', $associative_array) ? $associative_array['int64_group'] : null; - + $string_group = array_key_exists('string_group', $associative_array) + ? $associative_array['string_group'] + : null; + $boolean_group = array_key_exists('boolean_group', $associative_array) + ? $associative_array['boolean_group'] + : null; + $int64_group = array_key_exists('int64_group', $associative_array) + ? $associative_array['int64_group'] + : null; $resourcePath = '/fake'; $formParams = []; @@ -2688,37 +2994,39 @@ protected function testGroupParametersRequest($associative_array) // query params if ($string_group !== null) { - $queryParams['string_group'] = ObjectSerializer::toQueryValue($string_group); + $queryParams['string_group'] = ObjectSerializer::toQueryValue( + $string_group + ); } // query params if ($int64_group !== null) { - $queryParams['int64_group'] = ObjectSerializer::toQueryValue($int64_group); + $queryParams['int64_group'] = ObjectSerializer::toQueryValue( + $int64_group + ); } // header params if ($boolean_group !== null) { - $headerParams['boolean_group'] = ObjectSerializer::toHeaderValue($boolean_group); + $headerParams['boolean_group'] = ObjectSerializer::toHeaderValue( + $boolean_group + ); } - // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -2733,32 +3041,27 @@ protected function testGroupParametersRequest($associative_array) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2804,7 +3107,12 @@ public function testInlineAdditionalPropertiesWithHttpInfo($request_body) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -2824,7 +3132,6 @@ public function testInlineAdditionalPropertiesWithHttpInfo($request_body) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -2844,12 +3151,11 @@ public function testInlineAdditionalPropertiesWithHttpInfo($request_body) */ public function testInlineAdditionalPropertiesAsync($request_body) { - return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo( + $request_body + )->then(function ($response) { + return $response[0]; + }); } /** @@ -2862,8 +3168,9 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) - { + public function testInlineAdditionalPropertiesAsyncWithHttpInfo( + $request_body + ) { $returnType = ''; $request = $this->testInlineAdditionalPropertiesRequest($request_body); @@ -2871,7 +3178,11 @@ public function testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -2901,7 +3212,10 @@ function ($exception) { protected function testInlineAdditionalPropertiesRequest($request_body) { // verify the required parameter 'request_body' is set - if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) { + if ( + $request_body === null || + (is_array($request_body) && count($request_body) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $request_body when calling testInlineAdditionalProperties' ); @@ -2914,8 +3228,6 @@ protected function testInlineAdditionalPropertiesRequest($request_body) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($request_body)) { @@ -2923,9 +3235,7 @@ protected function testInlineAdditionalPropertiesRequest($request_body) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -2937,7 +3247,9 @@ protected function testInlineAdditionalPropertiesRequest($request_body) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -2952,32 +3264,27 @@ protected function testInlineAdditionalPropertiesRequest($request_body) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3025,7 +3332,12 @@ public function testJsonFormDataWithHttpInfo($param, $param2) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -3045,7 +3357,6 @@ public function testJsonFormDataWithHttpInfo($param, $param2) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -3066,12 +3377,11 @@ public function testJsonFormDataWithHttpInfo($param, $param2) */ public function testJsonFormDataAsync($param, $param2) { - return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2)->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -3094,7 +3404,11 @@ public function testJsonFormDataAsyncWithHttpInfo($param, $param2) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -3144,8 +3458,6 @@ protected function testJsonFormDataRequest($param, $param2) $httpBody = ''; $multipart = false; - - // form params if ($param !== null) { $formParams['param'] = ObjectSerializer::toFormValue($param); @@ -3158,9 +3470,7 @@ protected function testJsonFormDataRequest($param, $param2) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -3172,7 +3482,9 @@ protected function testJsonFormDataRequest($param, $param2) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -3187,32 +3499,27 @@ protected function testJsonFormDataRequest($param, $param2) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3228,9 +3535,15 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + $options[RequestOptions::DEBUG] = fopen( + $this->config->getDebugFile(), + 'a' + ); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException( + 'Failed to open the debug file: ' . + $this->config->getDebugFile() + ); } } 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 b2aad6252e2f..6292f96df712 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -128,7 +128,12 @@ public function testClassnameWithHttpInfo($client) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -148,7 +153,7 @@ public function testClassnameWithHttpInfo($client) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -157,7 +162,11 @@ public function testClassnameWithHttpInfo($client) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\Client', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -176,7 +185,6 @@ public function testClassnameWithHttpInfo($client) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -204,12 +212,11 @@ public function testClassnameWithHttpInfo($client) */ public function testClassnameAsync($client) { - return $this->testClassnameAsyncWithHttpInfo($client) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->testClassnameAsyncWithHttpInfo($client)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -239,7 +246,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -285,8 +296,6 @@ protected function testClassnameRequest($client) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($client)) { @@ -294,9 +303,9 @@ protected function testClassnameRequest($client) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -308,7 +317,9 @@ protected function testClassnameRequest($client) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -323,10 +334,8 @@ protected function testClassnameRequest($client) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -344,16 +353,14 @@ protected function testClassnameRequest($client) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -369,9 +376,15 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + $options[RequestOptions::DEBUG] = fopen( + $this->config->getDebugFile(), + 'a' + ); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException( + 'Failed to open the debug file: ' . + $this->config->getDebugFile() + ); } } 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 b3f8a732f13a..8340dae7a03e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -127,7 +127,12 @@ public function addPetWithHttpInfo($pet) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -147,7 +152,6 @@ public function addPetWithHttpInfo($pet) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -167,12 +171,9 @@ public function addPetWithHttpInfo($pet) */ public function addPetAsync($pet) { - return $this->addPetAsyncWithHttpInfo($pet) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->addPetAsyncWithHttpInfo($pet)->then(function ($response) { + return $response[0]; + }); } /** @@ -194,7 +195,11 @@ public function addPetAsyncWithHttpInfo($pet) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -237,8 +242,6 @@ protected function addPetRequest($pet) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($pet)) { @@ -246,9 +249,7 @@ protected function addPetRequest($pet) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -260,7 +261,9 @@ protected function addPetRequest($pet) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -275,10 +278,8 @@ protected function addPetRequest($pet) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -287,7 +288,8 @@ protected function addPetRequest($pet) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = + 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -295,16 +297,14 @@ protected function addPetRequest($pet) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -352,7 +352,12 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -372,7 +377,6 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -393,12 +397,11 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) */ public function deletePetAsync($pet_id, $api_key = null) { - return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key)->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -421,7 +424,11 @@ public function deletePetAsyncWithHttpInfo($pet_id, $api_key = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -467,7 +474,9 @@ protected function deletePetRequest($pet_id, $api_key = null) // header params if ($api_key !== null) { - $headerParams['api_key'] = ObjectSerializer::toHeaderValue($api_key); + $headerParams['api_key'] = ObjectSerializer::toHeaderValue( + $api_key + ); } // path params @@ -483,21 +492,18 @@ protected function deletePetRequest($pet_id, $api_key = null) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -512,10 +518,8 @@ protected function deletePetRequest($pet_id, $api_key = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -524,7 +528,8 @@ protected function deletePetRequest($pet_id, $api_key = null) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = + 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -532,16 +537,14 @@ protected function deletePetRequest($pet_id, $api_key = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -588,7 +591,12 @@ public function findPetsByStatusWithHttpInfo($status) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -608,7 +616,7 @@ public function findPetsByStatusWithHttpInfo($status) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -617,7 +625,11 @@ public function findPetsByStatusWithHttpInfo($status) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\Pet[]', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -636,7 +648,6 @@ public function findPetsByStatusWithHttpInfo($status) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -664,12 +675,11 @@ public function findPetsByStatusWithHttpInfo($status) */ public function findPetsByStatusAsync($status) { - return $this->findPetsByStatusAsyncWithHttpInfo($status) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->findPetsByStatusAsyncWithHttpInfo($status)->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -699,7 +709,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -747,20 +761,24 @@ protected function findPetsByStatusRequest($status) // query params if (is_array($status)) { - $status = ObjectSerializer::serializeCollection($status, 'csv', true); + $status = ObjectSerializer::serializeCollection( + $status, + 'csv', + true + ); } if ($status !== null) { $queryParams['status'] = ObjectSerializer::toQueryValue($status); } - // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/xml', + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -772,7 +790,9 @@ protected function findPetsByStatusRequest($status) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -787,10 +807,8 @@ protected function findPetsByStatusRequest($status) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -799,7 +817,8 @@ protected function findPetsByStatusRequest($status) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = + 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -807,16 +826,14 @@ protected function findPetsByStatusRequest($status) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -863,7 +880,12 @@ public function findPetsByTagsWithHttpInfo($tags) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -883,7 +905,7 @@ public function findPetsByTagsWithHttpInfo($tags) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -892,7 +914,11 @@ public function findPetsByTagsWithHttpInfo($tags) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\Pet[]', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -911,7 +937,6 @@ public function findPetsByTagsWithHttpInfo($tags) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -939,12 +964,11 @@ public function findPetsByTagsWithHttpInfo($tags) */ public function findPetsByTagsAsync($tags) { - return $this->findPetsByTagsAsyncWithHttpInfo($tags) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->findPetsByTagsAsyncWithHttpInfo($tags)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -974,7 +998,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1028,14 +1056,14 @@ protected function findPetsByTagsRequest($tags) $queryParams['tags'] = ObjectSerializer::toQueryValue($tags); } - // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/xml', + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1047,7 +1075,9 @@ protected function findPetsByTagsRequest($tags) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1062,10 +1092,8 @@ protected function findPetsByTagsRequest($tags) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -1074,7 +1102,8 @@ protected function findPetsByTagsRequest($tags) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = + 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -1082,16 +1111,14 @@ protected function findPetsByTagsRequest($tags) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1138,7 +1165,12 @@ public function getPetByIdWithHttpInfo($pet_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1158,7 +1190,7 @@ public function getPetByIdWithHttpInfo($pet_id) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1167,7 +1199,11 @@ public function getPetByIdWithHttpInfo($pet_id) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\Pet', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1186,7 +1222,6 @@ public function getPetByIdWithHttpInfo($pet_id) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1214,12 +1249,11 @@ public function getPetByIdWithHttpInfo($pet_id) */ public function getPetByIdAsync($pet_id) { - return $this->getPetByIdAsyncWithHttpInfo($pet_id) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->getPetByIdAsyncWithHttpInfo($pet_id)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -1249,7 +1283,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1295,7 +1333,6 @@ protected function getPetByIdRequest($pet_id) $httpBody = ''; $multipart = false; - // path params if ($pet_id !== null) { $resourcePath = str_replace( @@ -1309,9 +1346,10 @@ protected function getPetByIdRequest($pet_id) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/xml', + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1323,7 +1361,9 @@ protected function getPetByIdRequest($pet_id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1338,10 +1378,8 @@ protected function getPetByIdRequest($pet_id) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -1359,16 +1397,14 @@ protected function getPetByIdRequest($pet_id) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1414,7 +1450,12 @@ public function updatePetWithHttpInfo($pet) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1434,7 +1475,6 @@ public function updatePetWithHttpInfo($pet) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1454,12 +1494,11 @@ public function updatePetWithHttpInfo($pet) */ public function updatePetAsync($pet) { - return $this->updatePetAsyncWithHttpInfo($pet) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->updatePetAsyncWithHttpInfo($pet)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -1481,7 +1520,11 @@ public function updatePetAsyncWithHttpInfo($pet) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1524,8 +1567,6 @@ protected function updatePetRequest($pet) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($pet)) { @@ -1533,9 +1574,7 @@ protected function updatePetRequest($pet) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -1547,7 +1586,9 @@ protected function updatePetRequest($pet) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1562,10 +1603,8 @@ protected function updatePetRequest($pet) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -1574,7 +1613,8 @@ protected function updatePetRequest($pet) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = + 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -1582,16 +1622,14 @@ protected function updatePetRequest($pet) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1628,8 +1666,11 @@ public function updatePetWithForm($pet_id, $name = null, $status = null) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null) - { + public function updatePetWithFormWithHttpInfo( + $pet_id, + $name = null, + $status = null + ) { $request = $this->updatePetWithFormRequest($pet_id, $name, $status); try { @@ -1641,7 +1682,12 @@ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = n "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1661,7 +1707,6 @@ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = n } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1681,14 +1726,18 @@ public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = n * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetWithFormAsync($pet_id, $name = null, $status = null) - { - return $this->updatePetWithFormAsyncWithHttpInfo($pet_id, $name, $status) - ->then( - function ($response) { - return $response[0]; - } - ); + public function updatePetWithFormAsync( + $pet_id, + $name = null, + $status = null + ) { + return $this->updatePetWithFormAsyncWithHttpInfo( + $pet_id, + $name, + $status + )->then(function ($response) { + return $response[0]; + }); } /** @@ -1703,8 +1752,11 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $status = null) - { + public function updatePetWithFormAsyncWithHttpInfo( + $pet_id, + $name = null, + $status = null + ) { $returnType = ''; $request = $this->updatePetWithFormRequest($pet_id, $name, $status); @@ -1712,7 +1764,11 @@ public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $statu ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1741,8 +1797,11 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updatePetWithFormRequest($pet_id, $name = null, $status = null) - { + protected function updatePetWithFormRequest( + $pet_id, + $name = null, + $status = null + ) { // verify the required parameter 'pet_id' is set if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { throw new \InvalidArgumentException( @@ -1757,7 +1816,6 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul $httpBody = ''; $multipart = false; - // path params if ($pet_id !== null) { $resourcePath = str_replace( @@ -1779,9 +1837,7 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -1793,7 +1849,9 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1808,10 +1866,8 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -1820,7 +1876,8 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = + 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -1828,16 +1885,14 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1856,9 +1911,16 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ApiResponse */ - public function uploadFile($pet_id, $additional_metadata = null, $file = null) - { - list($response) = $this->uploadFileWithHttpInfo($pet_id, $additional_metadata, $file); + public function uploadFile( + $pet_id, + $additional_metadata = null, + $file = null + ) { + list($response) = $this->uploadFileWithHttpInfo( + $pet_id, + $additional_metadata, + $file + ); return $response; } @@ -1875,9 +1937,16 @@ public function uploadFile($pet_id, $additional_metadata = null, $file = null) * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null) - { - $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); + public function uploadFileWithHttpInfo( + $pet_id, + $additional_metadata = null, + $file = null + ) { + $request = $this->uploadFileRequest( + $pet_id, + $additional_metadata, + $file + ); try { $options = $this->createHttpClientOption(); @@ -1888,7 +1957,12 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1908,16 +1982,22 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: - if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { + if ( + '\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject' + ) { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiResponse', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\ApiResponse', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1936,7 +2016,6 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1964,14 +2043,18 @@ public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $fi * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsync($pet_id, $additional_metadata = null, $file = null) - { - return $this->uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata, $file) - ->then( - function ($response) { - return $response[0]; - } - ); + public function uploadFileAsync( + $pet_id, + $additional_metadata = null, + $file = null + ) { + return $this->uploadFileAsyncWithHttpInfo( + $pet_id, + $additional_metadata, + $file + )->then(function ($response) { + return $response[0]; + }); } /** @@ -1986,10 +2069,17 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata = null, $file = null) - { + public function uploadFileAsyncWithHttpInfo( + $pet_id, + $additional_metadata = null, + $file = null + ) { $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); + $request = $this->uploadFileRequest( + $pet_id, + $additional_metadata, + $file + ); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2003,7 +2093,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -2035,8 +2129,11 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function uploadFileRequest($pet_id, $additional_metadata = null, $file = null) - { + protected function uploadFileRequest( + $pet_id, + $additional_metadata = null, + $file = null + ) { // verify the required parameter 'pet_id' is set if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { throw new \InvalidArgumentException( @@ -2051,7 +2148,6 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file $httpBody = ''; $multipart = false; - // path params if ($pet_id !== null) { $resourcePath = str_replace( @@ -2063,20 +2159,25 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file // form params if ($additional_metadata !== null) { - $formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata); + $formParams['additionalMetadata'] = ObjectSerializer::toFormValue( + $additional_metadata + ); } // form params if ($file !== null) { $multipart = true; - $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); + $formParams['file'] = \GuzzleHttp\Psr7\try_fopen( + ObjectSerializer::toFormValue($file), + 'rb' + ); } // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -2088,7 +2189,9 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -2103,10 +2206,8 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -2115,7 +2216,8 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = + 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -2123,16 +2225,14 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2151,9 +2251,16 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ApiResponse */ - public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata = null) - { - list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata); + public function uploadFileWithRequiredFile( + $pet_id, + $required_file, + $additional_metadata = null + ) { + list($response) = $this->uploadFileWithRequiredFileWithHttpInfo( + $pet_id, + $required_file, + $additional_metadata + ); return $response; } @@ -2170,9 +2277,16 @@ public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_ * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata = null) - { - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); + public function uploadFileWithRequiredFileWithHttpInfo( + $pet_id, + $required_file, + $additional_metadata = null + ) { + $request = $this->uploadFileWithRequiredFileRequest( + $pet_id, + $required_file, + $additional_metadata + ); try { $options = $this->createHttpClientOption(); @@ -2183,7 +2297,12 @@ public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -2203,16 +2322,22 @@ public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: - if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { + if ( + '\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject' + ) { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiResponse', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\ApiResponse', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -2231,7 +2356,6 @@ public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2259,14 +2383,18 @@ public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsync($pet_id, $required_file, $additional_metadata = null) - { - return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata) - ->then( - function ($response) { - return $response[0]; - } - ); + public function uploadFileWithRequiredFileAsync( + $pet_id, + $required_file, + $additional_metadata = null + ) { + return $this->uploadFileWithRequiredFileAsyncWithHttpInfo( + $pet_id, + $required_file, + $additional_metadata + )->then(function ($response) { + return $response[0]; + }); } /** @@ -2281,10 +2409,17 @@ function ($response) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata = null) - { + public function uploadFileWithRequiredFileAsyncWithHttpInfo( + $pet_id, + $required_file, + $additional_metadata = null + ) { $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); + $request = $this->uploadFileWithRequiredFileRequest( + $pet_id, + $required_file, + $additional_metadata + ); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2298,7 +2433,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -2330,8 +2469,11 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null) - { + protected function uploadFileWithRequiredFileRequest( + $pet_id, + $required_file, + $additional_metadata = null + ) { // verify the required parameter 'pet_id' is set if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { throw new \InvalidArgumentException( @@ -2339,7 +2481,10 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a ); } // verify the required parameter 'required_file' is set - if ($required_file === null || (is_array($required_file) && count($required_file) === 0)) { + if ( + $required_file === null || + (is_array($required_file) && count($required_file) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $required_file when calling uploadFileWithRequiredFile' ); @@ -2352,7 +2497,6 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a $httpBody = ''; $multipart = false; - // path params if ($pet_id !== null) { $resourcePath = str_replace( @@ -2364,20 +2508,25 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a // form params if ($additional_metadata !== null) { - $formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata); + $formParams['additionalMetadata'] = ObjectSerializer::toFormValue( + $additional_metadata + ); } // form params if ($required_file !== null) { $multipart = true; - $formParams['requiredFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($required_file), 'rb'); + $formParams['requiredFile'] = \GuzzleHttp\Psr7\try_fopen( + ObjectSerializer::toFormValue($required_file), + 'rb' + ); } // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -2389,7 +2538,9 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -2404,10 +2555,8 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -2416,7 +2565,8 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = + 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -2424,16 +2574,14 @@ protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $a $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2449,9 +2597,15 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + $options[RequestOptions::DEBUG] = fopen( + $this->config->getDebugFile(), + 'a' + ); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException( + 'Failed to open the debug file: ' . + $this->config->getDebugFile() + ); } } 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 9ea52b83e66e..7b5ca8297882 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -127,7 +127,12 @@ public function deleteOrderWithHttpInfo($order_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -147,7 +152,6 @@ public function deleteOrderWithHttpInfo($order_id) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -167,12 +171,11 @@ public function deleteOrderWithHttpInfo($order_id) */ public function deleteOrderAsync($order_id) { - return $this->deleteOrderAsyncWithHttpInfo($order_id) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->deleteOrderAsyncWithHttpInfo($order_id)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -194,7 +197,11 @@ public function deleteOrderAsyncWithHttpInfo($order_id) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -224,7 +231,10 @@ function ($exception) { protected function deleteOrderRequest($order_id) { // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + if ( + $order_id === null || + (is_array($order_id) && count($order_id) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $order_id when calling deleteOrder' ); @@ -237,7 +247,6 @@ protected function deleteOrderRequest($order_id) $httpBody = ''; $multipart = false; - // path params if ($order_id !== null) { $resourcePath = str_replace( @@ -251,21 +260,18 @@ protected function deleteOrderRequest($order_id) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -280,32 +286,27 @@ protected function deleteOrderRequest($order_id) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -350,7 +351,12 @@ public function getInventoryWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -370,7 +376,7 @@ public function getInventoryWithHttpInfo() } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('map[string,int]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -379,7 +385,11 @@ public function getInventoryWithHttpInfo() } return [ - ObjectSerializer::deserialize($content, 'map[string,int]', []), + ObjectSerializer::deserialize( + $content, + 'map[string,int]', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -398,7 +408,6 @@ public function getInventoryWithHttpInfo() $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -425,12 +434,11 @@ public function getInventoryWithHttpInfo() */ public function getInventoryAsync() { - return $this->getInventoryAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->getInventoryAsyncWithHttpInfo()->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -459,7 +467,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -490,7 +502,6 @@ function ($exception) { */ protected function getInventoryRequest() { - $resourcePath = '/store/inventory'; $formParams = []; $queryParams = []; @@ -498,15 +509,13 @@ protected function getInventoryRequest() $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -518,7 +527,9 @@ protected function getInventoryRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -533,10 +544,8 @@ protected function getInventoryRequest() } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -554,16 +563,14 @@ protected function getInventoryRequest() $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -610,7 +617,12 @@ public function getOrderByIdWithHttpInfo($order_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -630,7 +642,7 @@ public function getOrderByIdWithHttpInfo($order_id) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -639,7 +651,11 @@ public function getOrderByIdWithHttpInfo($order_id) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\Order', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -658,7 +674,6 @@ public function getOrderByIdWithHttpInfo($order_id) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -686,12 +701,11 @@ public function getOrderByIdWithHttpInfo($order_id) */ public function getOrderByIdAsync($order_id) { - return $this->getOrderByIdAsyncWithHttpInfo($order_id) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->getOrderByIdAsyncWithHttpInfo($order_id)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -721,7 +735,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -754,19 +772,25 @@ function ($exception) { protected function getOrderByIdRequest($order_id) { // verify the required parameter 'order_id' is set - if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { + if ( + $order_id === null || + (is_array($order_id) && count($order_id) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $order_id when calling getOrderById' ); } if ($order_id > 5) { - throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.'); + throw new \InvalidArgumentException( + 'invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.' + ); } if ($order_id < 1) { - throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.'); + throw new \InvalidArgumentException( + 'invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.' + ); } - $resourcePath = '/store/order/{order_id}'; $formParams = []; $queryParams = []; @@ -774,7 +798,6 @@ protected function getOrderByIdRequest($order_id) $httpBody = ''; $multipart = false; - // path params if ($order_id !== null) { $resourcePath = str_replace( @@ -788,9 +811,10 @@ protected function getOrderByIdRequest($order_id) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/xml', + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -802,7 +826,9 @@ protected function getOrderByIdRequest($order_id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -817,32 +843,27 @@ protected function getOrderByIdRequest($order_id) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -889,7 +910,12 @@ public function placeOrderWithHttpInfo($order) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -909,7 +935,7 @@ public function placeOrderWithHttpInfo($order) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -918,7 +944,11 @@ public function placeOrderWithHttpInfo($order) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\Order', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -937,7 +967,6 @@ public function placeOrderWithHttpInfo($order) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -965,12 +994,11 @@ public function placeOrderWithHttpInfo($order) */ public function placeOrderAsync($order) { - return $this->placeOrderAsyncWithHttpInfo($order) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->placeOrderAsyncWithHttpInfo($order)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -1000,7 +1028,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1046,8 +1078,6 @@ protected function placeOrderRequest($order) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($order)) { @@ -1055,9 +1085,10 @@ protected function placeOrderRequest($order) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/xml', + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1069,7 +1100,9 @@ protected function placeOrderRequest($order) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1084,32 +1117,27 @@ protected function placeOrderRequest($order) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1125,9 +1153,15 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + $options[RequestOptions::DEBUG] = fopen( + $this->config->getDebugFile(), + 'a' + ); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException( + 'Failed to open the debug file: ' . + $this->config->getDebugFile() + ); } } 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 35d836300502..59856b4ba066 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -127,7 +127,12 @@ public function createUserWithHttpInfo($user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -147,7 +152,6 @@ public function createUserWithHttpInfo($user) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -167,12 +171,11 @@ public function createUserWithHttpInfo($user) */ public function createUserAsync($user) { - return $this->createUserAsyncWithHttpInfo($user) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->createUserAsyncWithHttpInfo($user)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -194,7 +197,11 @@ public function createUserAsyncWithHttpInfo($user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -237,8 +244,6 @@ protected function createUserRequest($user) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($user)) { @@ -246,21 +251,18 @@ protected function createUserRequest($user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -275,32 +277,27 @@ protected function createUserRequest($user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -346,7 +343,12 @@ public function createUsersWithArrayInputWithHttpInfo($user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -366,7 +368,6 @@ public function createUsersWithArrayInputWithHttpInfo($user) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -386,12 +387,11 @@ public function createUsersWithArrayInputWithHttpInfo($user) */ public function createUsersWithArrayInputAsync($user) { - return $this->createUsersWithArrayInputAsyncWithHttpInfo($user) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->createUsersWithArrayInputAsyncWithHttpInfo($user)->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -413,7 +413,11 @@ public function createUsersWithArrayInputAsyncWithHttpInfo($user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -456,8 +460,6 @@ protected function createUsersWithArrayInputRequest($user) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($user)) { @@ -465,21 +467,18 @@ protected function createUsersWithArrayInputRequest($user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -494,32 +493,27 @@ protected function createUsersWithArrayInputRequest($user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -565,7 +559,12 @@ public function createUsersWithListInputWithHttpInfo($user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -585,7 +584,6 @@ public function createUsersWithListInputWithHttpInfo($user) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -605,12 +603,11 @@ public function createUsersWithListInputWithHttpInfo($user) */ public function createUsersWithListInputAsync($user) { - return $this->createUsersWithListInputAsyncWithHttpInfo($user) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->createUsersWithListInputAsyncWithHttpInfo($user)->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -632,7 +629,11 @@ public function createUsersWithListInputAsyncWithHttpInfo($user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -675,8 +676,6 @@ protected function createUsersWithListInputRequest($user) $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if (isset($user)) { @@ -684,21 +683,18 @@ protected function createUsersWithListInputRequest($user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -713,32 +709,27 @@ protected function createUsersWithListInputRequest($user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -784,7 +775,12 @@ public function deleteUserWithHttpInfo($username) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -804,7 +800,6 @@ public function deleteUserWithHttpInfo($username) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -824,12 +819,11 @@ public function deleteUserWithHttpInfo($username) */ public function deleteUserAsync($username) { - return $this->deleteUserAsyncWithHttpInfo($username) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->deleteUserAsyncWithHttpInfo($username)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -851,7 +845,11 @@ public function deleteUserAsyncWithHttpInfo($username) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -881,7 +879,10 @@ function ($exception) { protected function deleteUserRequest($username) { // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { + if ( + $username === null || + (is_array($username) && count($username) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $username when calling deleteUser' ); @@ -894,7 +895,6 @@ protected function deleteUserRequest($username) $httpBody = ''; $multipart = false; - // path params if ($username !== null) { $resourcePath = str_replace( @@ -908,21 +908,18 @@ protected function deleteUserRequest($username) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -937,32 +934,27 @@ protected function deleteUserRequest($username) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1009,7 +1001,12 @@ public function getUserByNameWithHttpInfo($username) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1029,7 +1026,7 @@ public function getUserByNameWithHttpInfo($username) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('\OpenAPI\Client\Model\User' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1038,7 +1035,11 @@ public function getUserByNameWithHttpInfo($username) } return [ - ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\User', []), + ObjectSerializer::deserialize( + $content, + '\OpenAPI\Client\Model\User', + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1057,7 +1058,6 @@ public function getUserByNameWithHttpInfo($username) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1085,12 +1085,11 @@ public function getUserByNameWithHttpInfo($username) */ public function getUserByNameAsync($username) { - return $this->getUserByNameAsyncWithHttpInfo($username) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->getUserByNameAsyncWithHttpInfo($username)->then(function ( + $response + ) { + return $response[0]; + }); } /** @@ -1120,7 +1119,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1153,7 +1156,10 @@ function ($exception) { protected function getUserByNameRequest($username) { // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { + if ( + $username === null || + (is_array($username) && count($username) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $username when calling getUserByName' ); @@ -1166,7 +1172,6 @@ protected function getUserByNameRequest($username) $httpBody = ''; $multipart = false; - // path params if ($username !== null) { $resourcePath = str_replace( @@ -1180,9 +1185,10 @@ protected function getUserByNameRequest($username) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/xml', + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1194,7 +1200,9 @@ protected function getUserByNameRequest($username) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1209,32 +1217,27 @@ protected function getUserByNameRequest($username) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1283,7 +1286,12 @@ public function loginUserWithHttpInfo($username, $password) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1303,7 +1311,7 @@ public function loginUserWithHttpInfo($username, $password) } $responseBody = $response->getBody(); - switch($statusCode) { + switch ($statusCode) { case 200: if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1331,7 +1339,6 @@ public function loginUserWithHttpInfo($username, $password) $response->getStatusCode(), $response->getHeaders() ]; - } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1360,12 +1367,11 @@ public function loginUserWithHttpInfo($username, $password) */ public function loginUserAsync($username, $password) { - return $this->loginUserAsyncWithHttpInfo($username, $password) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->loginUserAsyncWithHttpInfo($username, $password)->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1396,7 +1402,11 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize($content, $returnType, []), + ObjectSerializer::deserialize( + $content, + $returnType, + [] + ), $response->getStatusCode(), $response->getHeaders() ]; @@ -1430,13 +1440,19 @@ function ($exception) { protected function loginUserRequest($username, $password) { // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { + if ( + $username === null || + (is_array($username) && count($username) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $username when calling loginUser' ); } // verify the required parameter 'password' is set - if ($password === null || (is_array($password) && count($password) === 0)) { + if ( + $password === null || + (is_array($password) && count($password) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $password when calling loginUser' ); @@ -1451,21 +1467,25 @@ protected function loginUserRequest($username, $password) // query params if ($username !== null) { - $queryParams['username'] = ObjectSerializer::toQueryValue($username); + $queryParams['username'] = ObjectSerializer::toQueryValue( + $username + ); } // query params if ($password !== null) { - $queryParams['password'] = ObjectSerializer::toQueryValue($password); + $queryParams['password'] = ObjectSerializer::toQueryValue( + $password + ); } - // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - ['application/xml', 'application/json'] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([ + 'application/xml', + 'application/json' + ]); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1477,7 +1497,9 @@ protected function loginUserRequest($username, $password) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1492,32 +1514,27 @@ protected function loginUserRequest($username, $password) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1561,7 +1578,12 @@ public function logoutUserWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1581,7 +1603,6 @@ public function logoutUserWithHttpInfo() } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1600,12 +1621,9 @@ public function logoutUserWithHttpInfo() */ public function logoutUserAsync() { - return $this->logoutUserAsyncWithHttpInfo() - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->logoutUserAsyncWithHttpInfo()->then(function ($response) { + return $response[0]; + }); } /** @@ -1626,7 +1644,11 @@ public function logoutUserAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1654,7 +1676,6 @@ function ($exception) { */ protected function logoutUserRequest() { - $resourcePath = '/user/logout'; $formParams = []; $queryParams = []; @@ -1662,27 +1683,22 @@ protected function logoutUserRequest() $httpBody = ''; $multipart = false; - - // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1697,32 +1713,27 @@ protected function logoutUserRequest() } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1770,7 +1781,12 @@ public function updateUserWithHttpInfo($username, $user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + $e->getResponse() + ? $e + ->getResponse() + ->getBody() + ->getContents() + : null ); } @@ -1790,7 +1806,6 @@ public function updateUserWithHttpInfo($username, $user) } return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1811,12 +1826,11 @@ public function updateUserWithHttpInfo($username, $user) */ public function updateUserAsync($username, $user) { - return $this->updateUserAsyncWithHttpInfo($username, $user) - ->then( - function ($response) { - return $response[0]; - } - ); + return $this->updateUserAsyncWithHttpInfo($username, $user)->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1839,7 +1853,11 @@ public function updateUserAsyncWithHttpInfo($username, $user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + return [ + null, + $response->getStatusCode(), + $response->getHeaders() + ]; }, function ($exception) { $response = $exception->getResponse(); @@ -1870,7 +1888,10 @@ function ($exception) { protected function updateUserRequest($username, $user) { // verify the required parameter 'username' is set - if ($username === null || (is_array($username) && count($username) === 0)) { + if ( + $username === null || + (is_array($username) && count($username) === 0) + ) { throw new \InvalidArgumentException( 'Missing the required parameter $username when calling updateUser' ); @@ -1889,7 +1910,6 @@ protected function updateUserRequest($username, $user) $httpBody = ''; $multipart = false; - // path params if ($username !== null) { $resourcePath = str_replace( @@ -1906,21 +1926,18 @@ protected function updateUserRequest($username, $user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( - [] - ); + $headers = $this->headerSelector->selectHeadersForMultipart([]); } else { - $headers = $this->headerSelector->selectHeaders( - [], - [] - ); + $headers = $this->headerSelector->selectHeaders([], []); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); + $httpBody = \GuzzleHttp\json_encode( + ObjectSerializer::sanitizeForSerialization($_tempBody) + ); } else { $httpBody = $_tempBody; } @@ -1935,32 +1952,27 @@ protected function updateUserRequest($username, $user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); - } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); - } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); + $headers = array_merge($defaultHeaders, $headerParams, $headers); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $this->config->getHost() . + $resourcePath . + ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1976,9 +1988,15 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + $options[RequestOptions::DEBUG] = fopen( + $this->config->getDebugFile(), + 'a' + ); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + throw new \RuntimeException( + 'Failed to open the debug file: ' . + $this->config->getDebugFile() + ); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 16e6015c73b6..ceec18a56660 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ApiException extends Exception { - /** * The HTTP body of the server response either as Json or string. * @@ -70,8 +69,12 @@ class ApiException extends Exception * @param string[]|null $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 = [], $responseBody = null) - { + public function __construct( + $message = "", + $code = 0, + $responseHeaders = [], + $responseBody = null + ) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; $this->responseBody = $responseBody; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index e0ab19027502..571aa4aae47d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -142,7 +142,9 @@ public function setApiKey($apiKeyIdentifier, $key) */ public function getApiKey($apiKeyIdentifier) { - return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + return isset($this->apiKeys[$apiKeyIdentifier]) + ? $this->apiKeys[$apiKeyIdentifier] + : null; } /** @@ -168,7 +170,9 @@ public function setApiKeyPrefix($apiKeyIdentifier, $prefix) */ public function getApiKeyPrefix($apiKeyIdentifier) { - return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) + ? $this->apiKeyPrefixes[$apiKeyIdentifier] + : null; } /** @@ -393,11 +397,14 @@ public static function setDefaultConfiguration(Configuration $config) */ public static function toDebugReport() { - $report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL; + $report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: 1.0.0' . PHP_EOL; - $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + $report .= + ' Temp Folder Path: ' . + self::getDefaultConfiguration()->getTempFolderPath() . + PHP_EOL; return $report; } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index e401e18ab4a1..19c9ba937fe0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class HeaderSelector { - /** * @param string[] $accept * @param string[] $contentTypes @@ -55,7 +54,9 @@ public function selectHeaders($accept, $contentTypes) $headers['Accept'] = $accept; } - $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + $headers['Content-Type'] = $this->selectContentTypeHeader( + $contentTypes + ); return $headers; } @@ -80,7 +81,10 @@ public function selectHeadersForMultipart($accept) */ private function selectAcceptHeader($accept) { - if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + if ( + count($accept) === 0 || + (count($accept) === 1 && $accept[0] === '') + ) { return null; } elseif (preg_grep("/application\/json/i", $accept)) { return 'application/json'; @@ -98,7 +102,10 @@ private function selectAcceptHeader($accept) */ private function selectContentTypeHeader($contentType) { - if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + if ( + count($contentType) === 0 || + (count($contentType) === 1 && $contentType[0] === '') + ) { return 'application/json'; } elseif (preg_grep("/application\/json/i", $contentType)) { return 'application/json'; @@ -107,4 +114,3 @@ private function selectContentTypeHeader($contentType) } } } - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 54833c0abd09..eac26c4359f5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * AdditionalPropertiesClass Class Doc Comment @@ -45,27 +45,27 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AdditionalPropertiesClass'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'map_property' => 'map[string,string]', 'map_of_map_property' => 'map[string,map[string,string]]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'map_property' => null, 'map_of_map_property' => null @@ -163,10 +163,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -182,8 +178,14 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['map_property'] = isset($data['map_property']) ? $data['map_property'] : null; - $this->container['map_of_map_property'] = isset($data['map_of_map_property']) ? $data['map_of_map_property'] : null; + $this->container['map_property'] = isset($data['map_property']) + ? $data['map_property'] + : null; + $this->container['map_of_map_property'] = isset( + $data['map_of_map_property'] + ) + ? $data['map_of_map_property'] + : null; } /** @@ -209,7 +211,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets map_property * @@ -278,7 +279,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -323,5 +326,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index a177ba0b3fde..645e57e43934 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Animal Class Doc Comment @@ -45,27 +45,27 @@ class Animal implements ModelInterface, ArrayAccess const DISCRIMINATOR = 'className'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Animal'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'class_name' => 'string', 'color' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'class_name' => null, 'color' => null @@ -163,10 +163,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -182,8 +178,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['class_name'] = isset($data['class_name']) ? $data['class_name'] : null; - $this->container['color'] = isset($data['color']) ? $data['color'] : 'red'; + $this->container['class_name'] = isset($data['class_name']) + ? $data['class_name'] + : null; + $this->container['color'] = isset($data['color']) + ? $data['color'] + : 'red'; // Initialize discriminator property with the model name. $discriminator = array_search('className', self::$attributeMap, true); @@ -216,7 +216,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets class_name * @@ -285,7 +284,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -330,5 +331,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php index ef1da91249d3..76c431b1b174 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * AnimalFarm Class Doc Comment @@ -45,29 +45,25 @@ class AnimalFarm implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AnimalFarm'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - - ]; + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = []; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - - ]; + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = []; /** * Array of property to type mappings. Used for (de)serialization @@ -95,27 +91,21 @@ public static function openAPIFormats() * * @var string[] */ - protected static $attributeMap = [ - - ]; + protected static $attributeMap = []; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ - protected static $setters = [ - - ]; + protected static $setters = []; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ - protected static $getters = [ - - ]; + protected static $getters = []; /** * Array of attributes where the key is the local name, @@ -158,10 +148,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -223,7 +209,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -268,5 +256,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index b577ec608799..a614d3b5c659 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * ApiResponse Class Doc Comment @@ -45,17 +45,17 @@ class ApiResponse implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'code' => 'int', 'type' => 'string', @@ -63,10 +63,10 @@ class ApiResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'code' => 'int32', 'type' => null, @@ -168,10 +168,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -189,7 +185,9 @@ public function __construct(array $data = null) { $this->container['code'] = isset($data['code']) ? $data['code'] : null; $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['message'] = isset($data['message']) ? $data['message'] : null; + $this->container['message'] = isset($data['message']) + ? $data['message'] + : null; } /** @@ -215,7 +213,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets code * @@ -308,7 +305,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -353,5 +352,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 72b584d5c2fc..787fdc0ae118 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * ArrayOfArrayOfNumberOnly Class Doc Comment @@ -45,26 +45,26 @@ class ArrayOfArrayOfNumberOnly implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ArrayOfArrayOfNumberOnly'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'array_array_number' => 'float[][]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'array_array_number' => null ]; @@ -158,10 +158,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -177,7 +173,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['array_array_number'] = isset($data['array_array_number']) ? $data['array_array_number'] : null; + $this->container['array_array_number'] = isset( + $data['array_array_number'] + ) + ? $data['array_array_number'] + : null; } /** @@ -203,7 +203,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets array_array_number * @@ -248,7 +247,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -293,5 +294,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index d0a9aeb1d496..a8b278b07fc7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * ArrayOfNumberOnly Class Doc Comment @@ -45,26 +45,26 @@ class ArrayOfNumberOnly implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ArrayOfNumberOnly'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'array_number' => 'float[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'array_number' => null ]; @@ -158,10 +158,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -177,7 +173,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['array_number'] = isset($data['array_number']) ? $data['array_number'] : null; + $this->container['array_number'] = isset($data['array_number']) + ? $data['array_number'] + : null; } /** @@ -203,7 +201,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets array_number * @@ -248,7 +245,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -293,5 +292,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index ee79f972a4ca..e29c8ca7d320 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * ArrayTest Class Doc Comment @@ -45,17 +45,17 @@ class ArrayTest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ArrayTest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'array_of_string' => 'string[]', 'array_array_of_integer' => 'int[][]', @@ -63,10 +63,10 @@ class ArrayTest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'array_of_string' => null, 'array_array_of_integer' => 'int64', @@ -168,10 +168,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -187,9 +183,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['array_of_string'] = isset($data['array_of_string']) ? $data['array_of_string'] : null; - $this->container['array_array_of_integer'] = isset($data['array_array_of_integer']) ? $data['array_array_of_integer'] : null; - $this->container['array_array_of_model'] = isset($data['array_array_of_model']) ? $data['array_array_of_model'] : null; + $this->container['array_of_string'] = isset($data['array_of_string']) + ? $data['array_of_string'] + : null; + $this->container['array_array_of_integer'] = isset( + $data['array_array_of_integer'] + ) + ? $data['array_array_of_integer'] + : null; + $this->container['array_array_of_model'] = isset( + $data['array_array_of_model'] + ) + ? $data['array_array_of_model'] + : null; } /** @@ -215,7 +221,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets array_of_string * @@ -308,7 +313,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -353,5 +360,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index ce4ab13c1136..f57eb1428ceb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Capitalization Class Doc Comment @@ -45,17 +45,17 @@ class Capitalization implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Capitalization'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'small_camel' => 'string', 'capital_camel' => 'string', @@ -66,10 +66,10 @@ class Capitalization implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'small_camel' => null, 'capital_camel' => null, @@ -183,10 +183,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -202,12 +198,26 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['small_camel'] = isset($data['small_camel']) ? $data['small_camel'] : null; - $this->container['capital_camel'] = isset($data['capital_camel']) ? $data['capital_camel'] : null; - $this->container['small_snake'] = isset($data['small_snake']) ? $data['small_snake'] : null; - $this->container['capital_snake'] = isset($data['capital_snake']) ? $data['capital_snake'] : null; - $this->container['sca_eth_flow_points'] = isset($data['sca_eth_flow_points']) ? $data['sca_eth_flow_points'] : null; - $this->container['att_name'] = isset($data['att_name']) ? $data['att_name'] : null; + $this->container['small_camel'] = isset($data['small_camel']) + ? $data['small_camel'] + : null; + $this->container['capital_camel'] = isset($data['capital_camel']) + ? $data['capital_camel'] + : null; + $this->container['small_snake'] = isset($data['small_snake']) + ? $data['small_snake'] + : null; + $this->container['capital_snake'] = isset($data['capital_snake']) + ? $data['capital_snake'] + : null; + $this->container['sca_eth_flow_points'] = isset( + $data['sca_eth_flow_points'] + ) + ? $data['sca_eth_flow_points'] + : null; + $this->container['att_name'] = isset($data['att_name']) + ? $data['att_name'] + : null; } /** @@ -233,7 +243,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets small_camel * @@ -398,7 +407,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -443,5 +454,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 4fab7da51f95..d9da31e1978a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,7 +28,7 @@ */ namespace OpenAPI\Client\Model; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Cat Class Doc Comment @@ -38,31 +38,31 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class Cat extends Animal +class Cat extends Animal { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Cat'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'declawed' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'declawed' => null ]; @@ -156,11 +156,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - - /** * Constructor * @@ -171,7 +166,9 @@ public function __construct(array $data = null) { parent::__construct($data); - $this->container['declawed'] = isset($data['declawed']) ? $data['declawed'] : null; + $this->container['declawed'] = isset($data['declawed']) + ? $data['declawed'] + : null; } /** @@ -197,7 +194,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets declawed * @@ -242,7 +238,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -287,5 +285,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 2aef04e5885d..05a35bd6bdac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Category Class Doc Comment @@ -45,27 +45,27 @@ class Category implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Category'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'name' => null @@ -163,10 +163,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -183,7 +179,9 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['name'] = isset($data['name']) ? $data['name'] : 'default-name'; + $this->container['name'] = isset($data['name']) + ? $data['name'] + : 'default-name'; } /** @@ -212,7 +210,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets id * @@ -281,7 +278,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -326,5 +325,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 1dd178336841..43f1526ca485 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * ClassModel Class Doc Comment @@ -46,26 +46,26 @@ class ClassModel implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ClassModel'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ '_class' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ '_class' => null ]; @@ -159,10 +159,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -178,7 +174,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['_class'] = isset($data['_class']) ? $data['_class'] : null; + $this->container['_class'] = isset($data['_class']) + ? $data['_class'] + : null; } /** @@ -204,7 +202,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets _class * @@ -249,7 +246,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -294,5 +293,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index cb97b431e181..5aede04df0b9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Client Class Doc Comment @@ -45,26 +45,26 @@ class Client implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Client'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'client' => null ]; @@ -158,10 +158,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -177,7 +173,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['client'] = isset($data['client']) ? $data['client'] : null; + $this->container['client'] = isset($data['client']) + ? $data['client'] + : null; } /** @@ -203,7 +201,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets client * @@ -248,7 +245,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -293,5 +292,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 78fe83b1b36c..a80567f4efd6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,7 +28,7 @@ */ namespace OpenAPI\Client\Model; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Dog Class Doc Comment @@ -38,31 +38,31 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class Dog extends Animal +class Dog extends Animal { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Dog'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'breed' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'breed' => null ]; @@ -156,11 +156,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - - /** * Constructor * @@ -171,7 +166,9 @@ public function __construct(array $data = null) { parent::__construct($data); - $this->container['breed'] = isset($data['breed']) ? $data['breed'] : null; + $this->container['breed'] = isset($data['breed']) + ? $data['breed'] + : null; } /** @@ -197,7 +194,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets breed * @@ -242,7 +238,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -287,5 +285,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 011df11fea7a..21d1e01bbc28 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * EnumArrays Class Doc Comment @@ -45,27 +45,27 @@ class EnumArrays implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EnumArrays'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'just_symbol' => 'string', 'array_enum' => 'string[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'just_symbol' => null, 'array_enum' => null @@ -167,9 +167,7 @@ public function getModelName() const JUST_SYMBOL_DOLLAR = '$'; const ARRAY_ENUM_FISH = 'fish'; const ARRAY_ENUM_CRAB = 'crab'; - - /** * Gets allowable values of the enum * @@ -179,10 +177,10 @@ public function getJustSymbolAllowableValues() { return [ self::JUST_SYMBOL_GREATER_THAN_OR_EQUAL_TO, - self::JUST_SYMBOL_DOLLAR, + self::JUST_SYMBOL_DOLLAR ]; } - + /** * Gets allowable values of the enum * @@ -190,12 +188,8 @@ public function getJustSymbolAllowableValues() */ public function getArrayEnumAllowableValues() { - return [ - self::ARRAY_ENUM_FISH, - self::ARRAY_ENUM_CRAB, - ]; + return [self::ARRAY_ENUM_FISH, self::ARRAY_ENUM_CRAB]; } - /** * Associative array for storing property values @@ -212,8 +206,12 @@ public function getArrayEnumAllowableValues() */ public function __construct(array $data = null) { - $this->container['just_symbol'] = isset($data['just_symbol']) ? $data['just_symbol'] : null; - $this->container['array_enum'] = isset($data['array_enum']) ? $data['array_enum'] : null; + $this->container['just_symbol'] = isset($data['just_symbol']) + ? $data['just_symbol'] + : null; + $this->container['array_enum'] = isset($data['array_enum']) + ? $data['array_enum'] + : null; } /** @@ -226,7 +224,10 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getJustSymbolAllowableValues(); - if (!is_null($this->container['just_symbol']) && !in_array($this->container['just_symbol'], $allowedValues, true)) { + if ( + !is_null($this->container['just_symbol']) && + !in_array($this->container['just_symbol'], $allowedValues, true) + ) { $invalidProperties[] = sprintf( "invalid value for 'just_symbol', must be one of '%s'", implode("', '", $allowedValues) @@ -247,7 +248,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets just_symbol * @@ -268,7 +268,10 @@ public function getJustSymbol() public function setJustSymbol($just_symbol) { $allowedValues = $this->getJustSymbolAllowableValues(); - if (!is_null($just_symbol) && !in_array($just_symbol, $allowedValues, true)) { + if ( + !is_null($just_symbol) && + !in_array($just_symbol, $allowedValues, true) + ) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'just_symbol', must be one of '%s'", @@ -334,7 +337,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -379,5 +384,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index f7b87a413025..09ed61247966 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,7 +28,7 @@ */ namespace OpenAPI\Client\Model; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * EnumClass Class Doc Comment @@ -46,19 +46,13 @@ class EnumClass const ABC = '_abc'; const EFG = '-efg'; const XYZ = '(xyz)'; - + /** * Gets allowable values of the enum * @return string[] */ public static function getAllowableEnumValues() { - return [ - self::ABC, - self::EFG, - self::XYZ, - ]; + return [self::ABC, self::EFG, self::XYZ]; } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index d0bd84745ed0..490a0e6d7bdc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * EnumTest Class Doc Comment @@ -45,17 +45,17 @@ class EnumTest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Enum_Test'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'enum_string' => 'string', 'enum_string_required' => 'string', @@ -65,10 +65,10 @@ class EnumTest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'enum_string' => null, 'enum_string_required' => null, @@ -188,9 +188,7 @@ public function getModelName() const ENUM_INTEGER_MINUS_1 = -1; const ENUM_NUMBER_1_DOT_1 = 1.1; const ENUM_NUMBER_MINUS_1_DOT_2 = -1.2; - - /** * Gets allowable values of the enum * @@ -201,10 +199,10 @@ public function getEnumStringAllowableValues() return [ self::ENUM_STRING_UPPER, self::ENUM_STRING_LOWER, - self::ENUM_STRING_EMPTY, + self::ENUM_STRING_EMPTY ]; } - + /** * Gets allowable values of the enum * @@ -215,10 +213,10 @@ public function getEnumStringRequiredAllowableValues() return [ self::ENUM_STRING_REQUIRED_UPPER, self::ENUM_STRING_REQUIRED_LOWER, - self::ENUM_STRING_REQUIRED_EMPTY, + self::ENUM_STRING_REQUIRED_EMPTY ]; } - + /** * Gets allowable values of the enum * @@ -226,12 +224,9 @@ public function getEnumStringRequiredAllowableValues() */ public function getEnumIntegerAllowableValues() { - return [ - self::ENUM_INTEGER_1, - self::ENUM_INTEGER_MINUS_1, - ]; + return [self::ENUM_INTEGER_1, self::ENUM_INTEGER_MINUS_1]; } - + /** * Gets allowable values of the enum * @@ -239,12 +234,8 @@ public function getEnumIntegerAllowableValues() */ public function getEnumNumberAllowableValues() { - return [ - self::ENUM_NUMBER_1_DOT_1, - self::ENUM_NUMBER_MINUS_1_DOT_2, - ]; + return [self::ENUM_NUMBER_1_DOT_1, self::ENUM_NUMBER_MINUS_1_DOT_2]; } - /** * Associative array for storing property values @@ -261,11 +252,23 @@ public function getEnumNumberAllowableValues() */ public function __construct(array $data = null) { - $this->container['enum_string'] = isset($data['enum_string']) ? $data['enum_string'] : null; - $this->container['enum_string_required'] = isset($data['enum_string_required']) ? $data['enum_string_required'] : null; - $this->container['enum_integer'] = isset($data['enum_integer']) ? $data['enum_integer'] : null; - $this->container['enum_number'] = isset($data['enum_number']) ? $data['enum_number'] : null; - $this->container['outer_enum'] = isset($data['outer_enum']) ? $data['outer_enum'] : null; + $this->container['enum_string'] = isset($data['enum_string']) + ? $data['enum_string'] + : null; + $this->container['enum_string_required'] = isset( + $data['enum_string_required'] + ) + ? $data['enum_string_required'] + : null; + $this->container['enum_integer'] = isset($data['enum_integer']) + ? $data['enum_integer'] + : null; + $this->container['enum_number'] = isset($data['enum_number']) + ? $data['enum_number'] + : null; + $this->container['outer_enum'] = isset($data['outer_enum']) + ? $data['outer_enum'] + : null; } /** @@ -278,7 +281,10 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getEnumStringAllowableValues(); - if (!is_null($this->container['enum_string']) && !in_array($this->container['enum_string'], $allowedValues, true)) { + if ( + !is_null($this->container['enum_string']) && + !in_array($this->container['enum_string'], $allowedValues, true) + ) { $invalidProperties[] = sprintf( "invalid value for 'enum_string', must be one of '%s'", implode("', '", $allowedValues) @@ -289,7 +295,14 @@ public function listInvalidProperties() $invalidProperties[] = "'enum_string_required' can't be null"; } $allowedValues = $this->getEnumStringRequiredAllowableValues(); - if (!is_null($this->container['enum_string_required']) && !in_array($this->container['enum_string_required'], $allowedValues, true)) { + if ( + !is_null($this->container['enum_string_required']) && + !in_array( + $this->container['enum_string_required'], + $allowedValues, + true + ) + ) { $invalidProperties[] = sprintf( "invalid value for 'enum_string_required', must be one of '%s'", implode("', '", $allowedValues) @@ -297,7 +310,10 @@ public function listInvalidProperties() } $allowedValues = $this->getEnumIntegerAllowableValues(); - if (!is_null($this->container['enum_integer']) && !in_array($this->container['enum_integer'], $allowedValues, true)) { + if ( + !is_null($this->container['enum_integer']) && + !in_array($this->container['enum_integer'], $allowedValues, true) + ) { $invalidProperties[] = sprintf( "invalid value for 'enum_integer', must be one of '%s'", implode("', '", $allowedValues) @@ -305,7 +321,10 @@ public function listInvalidProperties() } $allowedValues = $this->getEnumNumberAllowableValues(); - if (!is_null($this->container['enum_number']) && !in_array($this->container['enum_number'], $allowedValues, true)) { + if ( + !is_null($this->container['enum_number']) && + !in_array($this->container['enum_number'], $allowedValues, true) + ) { $invalidProperties[] = sprintf( "invalid value for 'enum_number', must be one of '%s'", implode("', '", $allowedValues) @@ -326,7 +345,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets enum_string * @@ -347,7 +365,10 @@ public function getEnumString() public function setEnumString($enum_string) { $allowedValues = $this->getEnumStringAllowableValues(); - if (!is_null($enum_string) && !in_array($enum_string, $allowedValues, true)) { + if ( + !is_null($enum_string) && + !in_array($enum_string, $allowedValues, true) + ) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_string', must be one of '%s'", @@ -413,7 +434,10 @@ public function getEnumInteger() public function setEnumInteger($enum_integer) { $allowedValues = $this->getEnumIntegerAllowableValues(); - if (!is_null($enum_integer) && !in_array($enum_integer, $allowedValues, true)) { + if ( + !is_null($enum_integer) && + !in_array($enum_integer, $allowedValues, true) + ) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_integer', must be one of '%s'", @@ -446,7 +470,10 @@ public function getEnumNumber() public function setEnumNumber($enum_number) { $allowedValues = $this->getEnumNumberAllowableValues(); - if (!is_null($enum_number) && !in_array($enum_number, $allowedValues, true)) { + if ( + !is_null($enum_number) && + !in_array($enum_number, $allowedValues, true) + ) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_number', must be one of '%s'", @@ -503,7 +530,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -548,5 +577,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 4c1da430ad59..130f07026ec3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * File Class Doc Comment @@ -46,26 +46,26 @@ class File implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'File'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'source_uri' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'source_uri' => null ]; @@ -159,10 +159,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -178,7 +174,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['source_uri'] = isset($data['source_uri']) ? $data['source_uri'] : null; + $this->container['source_uri'] = isset($data['source_uri']) + ? $data['source_uri'] + : null; } /** @@ -204,7 +202,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets source_uri * @@ -249,7 +246,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -294,5 +293,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 2e44e4148073..9ab0f24e4fe8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * FileSchemaTestClass Class Doc Comment @@ -45,27 +45,27 @@ class FileSchemaTestClass implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FileSchemaTestClass'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'file' => '\OpenAPI\Client\Model\File', 'files' => '\OpenAPI\Client\Model\File[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'file' => null, 'files' => null @@ -163,10 +163,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -183,7 +179,9 @@ public function getModelName() public function __construct(array $data = null) { $this->container['file'] = isset($data['file']) ? $data['file'] : null; - $this->container['files'] = isset($data['files']) ? $data['files'] : null; + $this->container['files'] = isset($data['files']) + ? $data['files'] + : null; } /** @@ -209,7 +207,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets file * @@ -278,7 +275,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -323,5 +322,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 8c1ee70299b5..f5ca5008fa12 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * FormatTest Class Doc Comment @@ -45,17 +45,17 @@ class FormatTest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'format_test'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'integer' => 'int', 'int32' => 'int', @@ -73,10 +73,10 @@ class FormatTest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'integer' => null, 'int32' => 'int32', @@ -218,10 +218,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -237,19 +233,39 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['integer'] = isset($data['integer']) ? $data['integer'] : null; - $this->container['int32'] = isset($data['int32']) ? $data['int32'] : null; - $this->container['int64'] = isset($data['int64']) ? $data['int64'] : null; - $this->container['number'] = isset($data['number']) ? $data['number'] : null; - $this->container['float'] = isset($data['float']) ? $data['float'] : null; - $this->container['double'] = isset($data['double']) ? $data['double'] : null; - $this->container['string'] = isset($data['string']) ? $data['string'] : null; + $this->container['integer'] = isset($data['integer']) + ? $data['integer'] + : null; + $this->container['int32'] = isset($data['int32']) + ? $data['int32'] + : null; + $this->container['int64'] = isset($data['int64']) + ? $data['int64'] + : null; + $this->container['number'] = isset($data['number']) + ? $data['number'] + : null; + $this->container['float'] = isset($data['float']) + ? $data['float'] + : null; + $this->container['double'] = isset($data['double']) + ? $data['double'] + : null; + $this->container['string'] = isset($data['string']) + ? $data['string'] + : null; $this->container['byte'] = isset($data['byte']) ? $data['byte'] : null; - $this->container['binary'] = isset($data['binary']) ? $data['binary'] : null; + $this->container['binary'] = isset($data['binary']) + ? $data['binary'] + : null; $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; + $this->container['date_time'] = isset($data['date_time']) + ? $data['date_time'] + : null; $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['password'] = isset($data['password']) + ? $data['password'] + : null; } /** @@ -261,58 +277,102 @@ public function listInvalidProperties() { $invalidProperties = []; - if (!is_null($this->container['integer']) && ($this->container['integer'] > 100)) { - $invalidProperties[] = "invalid value for 'integer', must be smaller than or equal to 100."; + if ( + !is_null($this->container['integer']) && + $this->container['integer'] > 100 + ) { + $invalidProperties[] = + "invalid value for 'integer', must be smaller than or equal to 100."; } - if (!is_null($this->container['integer']) && ($this->container['integer'] < 10)) { - $invalidProperties[] = "invalid value for 'integer', must be bigger than or equal to 10."; + if ( + !is_null($this->container['integer']) && + $this->container['integer'] < 10 + ) { + $invalidProperties[] = + "invalid value for 'integer', must be bigger than or equal to 10."; } - if (!is_null($this->container['int32']) && ($this->container['int32'] > 200)) { - $invalidProperties[] = "invalid value for 'int32', must be smaller than or equal to 200."; + if ( + !is_null($this->container['int32']) && + $this->container['int32'] > 200 + ) { + $invalidProperties[] = + "invalid value for 'int32', must be smaller than or equal to 200."; } - if (!is_null($this->container['int32']) && ($this->container['int32'] < 20)) { - $invalidProperties[] = "invalid value for 'int32', must be bigger than or equal to 20."; + if ( + !is_null($this->container['int32']) && + $this->container['int32'] < 20 + ) { + $invalidProperties[] = + "invalid value for 'int32', must be bigger than or equal to 20."; } if ($this->container['number'] === null) { $invalidProperties[] = "'number' can't be null"; } - if (($this->container['number'] > 543.2)) { - $invalidProperties[] = "invalid value for 'number', must be smaller than or equal to 543.2."; + if ($this->container['number'] > 543.2) { + $invalidProperties[] = + "invalid value for 'number', must be smaller than or equal to 543.2."; } - if (($this->container['number'] < 32.1)) { - $invalidProperties[] = "invalid value for 'number', must be bigger than or equal to 32.1."; + if ($this->container['number'] < 32.1) { + $invalidProperties[] = + "invalid value for 'number', must be bigger than or equal to 32.1."; } - if (!is_null($this->container['float']) && ($this->container['float'] > 987.6)) { - $invalidProperties[] = "invalid value for 'float', must be smaller than or equal to 987.6."; + if ( + !is_null($this->container['float']) && + $this->container['float'] > 987.6 + ) { + $invalidProperties[] = + "invalid value for 'float', must be smaller than or equal to 987.6."; } - if (!is_null($this->container['float']) && ($this->container['float'] < 54.3)) { - $invalidProperties[] = "invalid value for 'float', must be bigger than or equal to 54.3."; + if ( + !is_null($this->container['float']) && + $this->container['float'] < 54.3 + ) { + $invalidProperties[] = + "invalid value for 'float', must be bigger than or equal to 54.3."; } - if (!is_null($this->container['double']) && ($this->container['double'] > 123.4)) { - $invalidProperties[] = "invalid value for 'double', must be smaller than or equal to 123.4."; + if ( + !is_null($this->container['double']) && + $this->container['double'] > 123.4 + ) { + $invalidProperties[] = + "invalid value for 'double', must be smaller than or equal to 123.4."; } - if (!is_null($this->container['double']) && ($this->container['double'] < 67.8)) { - $invalidProperties[] = "invalid value for 'double', must be bigger than or equal to 67.8."; + if ( + !is_null($this->container['double']) && + $this->container['double'] < 67.8 + ) { + $invalidProperties[] = + "invalid value for 'double', must be bigger than or equal to 67.8."; } - if (!is_null($this->container['string']) && !preg_match("/[a-z]/i", $this->container['string'])) { - $invalidProperties[] = "invalid value for 'string', must be conform to the pattern /[a-z]/i."; + if ( + !is_null($this->container['string']) && + !preg_match("/[a-z]/i", $this->container['string']) + ) { + $invalidProperties[] = + "invalid value for 'string', must be conform to the pattern /[a-z]/i."; } if ($this->container['byte'] === null) { $invalidProperties[] = "'byte' can't be null"; } - if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['byte'])) { - $invalidProperties[] = "invalid value for 'byte', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; + if ( + !preg_match( + "/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", + $this->container['byte'] + ) + ) { + $invalidProperties[] = + "invalid value for 'byte', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; } if ($this->container['date'] === null) { @@ -321,12 +381,14 @@ public function listInvalidProperties() if ($this->container['password'] === null) { $invalidProperties[] = "'password' can't be null"; } - if ((mb_strlen($this->container['password']) > 64)) { - $invalidProperties[] = "invalid value for 'password', the character length must be smaller than or equal to 64."; + if (mb_strlen($this->container['password']) > 64) { + $invalidProperties[] = + "invalid value for 'password', the character length must be smaller than or equal to 64."; } - if ((mb_strlen($this->container['password']) < 10)) { - $invalidProperties[] = "invalid value for 'password', the character length must be bigger than or equal to 10."; + if (mb_strlen($this->container['password']) < 10) { + $invalidProperties[] = + "invalid value for 'password', the character length must be bigger than or equal to 10."; } return $invalidProperties; @@ -343,7 +405,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets integer * @@ -363,12 +424,15 @@ public function getInteger() */ public function setInteger($integer) { - - if (!is_null($integer) && ($integer > 100)) { - throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.'); + if (!is_null($integer) && $integer > 100) { + throw new \InvalidArgumentException( + 'invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.' + ); } - if (!is_null($integer) && ($integer < 10)) { - throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.'); + if (!is_null($integer) && $integer < 10) { + throw new \InvalidArgumentException( + 'invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.' + ); } $this->container['integer'] = $integer; @@ -395,12 +459,15 @@ public function getInt32() */ public function setInt32($int32) { - - if (!is_null($int32) && ($int32 > 200)) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.'); + if (!is_null($int32) && $int32 > 200) { + throw new \InvalidArgumentException( + 'invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.' + ); } - if (!is_null($int32) && ($int32 < 20)) { - throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.'); + if (!is_null($int32) && $int32 < 20) { + throw new \InvalidArgumentException( + 'invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.' + ); } $this->container['int32'] = $int32; @@ -451,12 +518,15 @@ public function getNumber() */ public function setNumber($number) { - - if (($number > 543.2)) { - throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.'); + if ($number > 543.2) { + throw new \InvalidArgumentException( + 'invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.' + ); } - if (($number < 32.1)) { - throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be bigger than or equal to 32.1.'); + if ($number < 32.1) { + throw new \InvalidArgumentException( + 'invalid value for $number when calling FormatTest., must be bigger than or equal to 32.1.' + ); } $this->container['number'] = $number; @@ -483,12 +553,15 @@ public function getFloat() */ public function setFloat($float) { - - if (!is_null($float) && ($float > 987.6)) { - throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.'); + if (!is_null($float) && $float > 987.6) { + throw new \InvalidArgumentException( + 'invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.' + ); } - if (!is_null($float) && ($float < 54.3)) { - throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be bigger than or equal to 54.3.'); + if (!is_null($float) && $float < 54.3) { + throw new \InvalidArgumentException( + 'invalid value for $float when calling FormatTest., must be bigger than or equal to 54.3.' + ); } $this->container['float'] = $float; @@ -515,12 +588,15 @@ public function getDouble() */ public function setDouble($double) { - - if (!is_null($double) && ($double > 123.4)) { - throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.'); + if (!is_null($double) && $double > 123.4) { + throw new \InvalidArgumentException( + 'invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.' + ); } - if (!is_null($double) && ($double < 67.8)) { - throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be bigger than or equal to 67.8.'); + if (!is_null($double) && $double < 67.8) { + throw new \InvalidArgumentException( + 'invalid value for $double when calling FormatTest., must be bigger than or equal to 67.8.' + ); } $this->container['double'] = $double; @@ -547,9 +623,10 @@ public function getString() */ public function setString($string) { - - if (!is_null($string) && (!preg_match("/[a-z]/i", $string))) { - throw new \InvalidArgumentException("invalid value for $string when calling FormatTest., must conform to the pattern /[a-z]/i."); + if (!is_null($string) && !preg_match("/[a-z]/i", $string)) { + throw new \InvalidArgumentException( + "invalid value for $string when calling FormatTest., must conform to the pattern /[a-z]/i." + ); } $this->container['string'] = $string; @@ -576,9 +653,15 @@ public function getByte() */ public function setByte($byte) { - - if ((!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $byte))) { - throw new \InvalidArgumentException("invalid value for $byte when calling FormatTest., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); + if ( + !preg_match( + "/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", + $byte + ) + ) { + throw new \InvalidArgumentException( + "invalid value for $byte when calling FormatTest., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/." + ); } $this->container['byte'] = $byte; @@ -701,11 +784,15 @@ public function getPassword() */ public function setPassword($password) { - if ((mb_strlen($password) > 64)) { - throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be smaller than or equal to 64.'); + if (mb_strlen($password) > 64) { + throw new \InvalidArgumentException( + 'invalid length for $password when calling FormatTest., must be smaller than or equal to 64.' + ); } - if ((mb_strlen($password) < 10)) { - throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be bigger than or equal to 10.'); + if (mb_strlen($password) < 10) { + throw new \InvalidArgumentException( + 'invalid length for $password when calling FormatTest., must be bigger than or equal to 10.' + ); } $this->container['password'] = $password; @@ -733,7 +820,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -778,5 +867,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index fa7dc269837a..6377959d9028 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * HasOnlyReadOnly Class Doc Comment @@ -45,27 +45,27 @@ class HasOnlyReadOnly implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'hasOnlyReadOnly'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bar' => 'string', 'foo' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'bar' => null, 'foo' => null @@ -163,10 +163,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -209,7 +205,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets bar * @@ -278,7 +273,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -323,5 +320,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index ded302c8b29a..bc04b9f94057 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * MapTest Class Doc Comment @@ -45,17 +45,17 @@ class MapTest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MapTest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'map_map_of_string' => 'map[string,map[string,string]]', 'map_of_enum_string' => 'map[string,string]', @@ -64,10 +64,10 @@ class MapTest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'map_map_of_string' => null, 'map_of_enum_string' => null, @@ -175,9 +175,7 @@ public function getModelName() const MAP_OF_ENUM_STRING_UPPER = 'UPPER'; const MAP_OF_ENUM_STRING_LOWER = 'lower'; - - /** * Gets allowable values of the enum * @@ -185,12 +183,8 @@ public function getModelName() */ public function getMapOfEnumStringAllowableValues() { - return [ - self::MAP_OF_ENUM_STRING_UPPER, - self::MAP_OF_ENUM_STRING_LOWER, - ]; + return [self::MAP_OF_ENUM_STRING_UPPER, self::MAP_OF_ENUM_STRING_LOWER]; } - /** * Associative array for storing property values @@ -207,10 +201,22 @@ public function getMapOfEnumStringAllowableValues() */ public function __construct(array $data = null) { - $this->container['map_map_of_string'] = isset($data['map_map_of_string']) ? $data['map_map_of_string'] : null; - $this->container['map_of_enum_string'] = isset($data['map_of_enum_string']) ? $data['map_of_enum_string'] : null; - $this->container['direct_map'] = isset($data['direct_map']) ? $data['direct_map'] : null; - $this->container['indirect_map'] = isset($data['indirect_map']) ? $data['indirect_map'] : null; + $this->container['map_map_of_string'] = isset( + $data['map_map_of_string'] + ) + ? $data['map_map_of_string'] + : null; + $this->container['map_of_enum_string'] = isset( + $data['map_of_enum_string'] + ) + ? $data['map_of_enum_string'] + : null; + $this->container['direct_map'] = isset($data['direct_map']) + ? $data['direct_map'] + : null; + $this->container['indirect_map'] = isset($data['indirect_map']) + ? $data['indirect_map'] + : null; } /** @@ -236,7 +242,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets map_map_of_string * @@ -281,7 +286,10 @@ public function getMapOfEnumString() public function setMapOfEnumString($map_of_enum_string) { $allowedValues = $this->getMapOfEnumStringAllowableValues(); - if (!is_null($map_of_enum_string) && array_diff($map_of_enum_string, $allowedValues)) { + if ( + !is_null($map_of_enum_string) && + array_diff($map_of_enum_string, $allowedValues) + ) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'map_of_enum_string', must be one of '%s'", @@ -362,7 +370,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -407,5 +417,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index eb49dc7a7e8d..d2ee654e3b04 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * MixedPropertiesAndAdditionalPropertiesClass Class Doc Comment @@ -40,22 +40,24 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, ArrayAccess +class MixedPropertiesAndAdditionalPropertiesClass implements + ModelInterface, + ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MixedPropertiesAndAdditionalPropertiesClass'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'uuid' => 'string', 'date_time' => '\DateTime', @@ -63,10 +65,10 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, Arr ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'uuid' => 'uuid', 'date_time' => 'date-time', @@ -168,10 +170,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -188,7 +186,9 @@ public function getModelName() public function __construct(array $data = null) { $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; - $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; + $this->container['date_time'] = isset($data['date_time']) + ? $data['date_time'] + : null; $this->container['map'] = isset($data['map']) ? $data['map'] : null; } @@ -215,7 +215,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets uuid * @@ -308,7 +307,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -353,5 +354,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 9d0eb4fe6ce1..282c36aec245 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Model200Response Class Doc Comment @@ -46,27 +46,27 @@ class Model200Response implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = '200_response'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'int', 'class' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => 'int32', 'class' => null @@ -164,10 +164,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -184,7 +180,9 @@ public function getModelName() public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['class'] = isset($data['class']) ? $data['class'] : null; + $this->container['class'] = isset($data['class']) + ? $data['class'] + : null; } /** @@ -210,7 +208,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -279,7 +276,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -324,5 +323,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index b6dc03437bd5..69c6a9182008 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 0f626833f819..6dbcca3e4350 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * ModelList Class Doc Comment @@ -45,26 +45,26 @@ class ModelList implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'List'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ '_123_list' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ '_123_list' => null ]; @@ -158,10 +158,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -177,7 +173,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['_123_list'] = isset($data['_123_list']) ? $data['_123_list'] : null; + $this->container['_123_list'] = isset($data['_123_list']) + ? $data['_123_list'] + : null; } /** @@ -203,7 +201,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets _123_list * @@ -248,7 +245,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -293,5 +292,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 9012d5dc1611..67e49b03aa10 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * ModelReturn Class Doc Comment @@ -46,26 +46,26 @@ class ModelReturn implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Return'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'return' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'return' => 'int32' ]; @@ -159,10 +159,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -178,7 +174,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['return'] = isset($data['return']) ? $data['return'] : null; + $this->container['return'] = isset($data['return']) + ? $data['return'] + : null; } /** @@ -204,7 +202,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets return * @@ -249,7 +246,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -294,5 +293,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 4cfdbd8ef86d..70624fffa89c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Name Class Doc Comment @@ -46,17 +46,17 @@ class Name implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Name'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'int', 'snake_case' => 'int', @@ -65,10 +65,10 @@ class Name implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => 'int32', 'snake_case' => 'int32', @@ -174,10 +174,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -194,9 +190,15 @@ public function getModelName() public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['snake_case'] = isset($data['snake_case']) ? $data['snake_case'] : null; - $this->container['property'] = isset($data['property']) ? $data['property'] : null; - $this->container['_123_number'] = isset($data['_123_number']) ? $data['_123_number'] : null; + $this->container['snake_case'] = isset($data['snake_case']) + ? $data['snake_case'] + : null; + $this->container['property'] = isset($data['property']) + ? $data['property'] + : null; + $this->container['_123_number'] = isset($data['_123_number']) + ? $data['_123_number'] + : null; } /** @@ -225,7 +227,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets name * @@ -342,7 +343,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -387,5 +390,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 5d958aceaee7..eb7a3385d14d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * NumberOnly Class Doc Comment @@ -45,26 +45,26 @@ class NumberOnly implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'NumberOnly'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'just_number' => 'float' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'just_number' => null ]; @@ -158,10 +158,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -177,7 +173,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['just_number'] = isset($data['just_number']) ? $data['just_number'] : null; + $this->container['just_number'] = isset($data['just_number']) + ? $data['just_number'] + : null; } /** @@ -203,7 +201,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets just_number * @@ -248,7 +245,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -293,5 +292,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 3e094149d12a..503265d6b2b4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Order Class Doc Comment @@ -45,17 +45,17 @@ class Order implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Order'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'pet_id' => 'int', @@ -66,10 +66,10 @@ class Order implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'pet_id' => 'int64', @@ -186,9 +186,7 @@ public function getModelName() const STATUS_PLACED = 'placed'; const STATUS_APPROVED = 'approved'; const STATUS_DELIVERED = 'delivered'; - - /** * Gets allowable values of the enum * @@ -199,10 +197,9 @@ public function getStatusAllowableValues() return [ self::STATUS_PLACED, self::STATUS_APPROVED, - self::STATUS_DELIVERED, + self::STATUS_DELIVERED ]; } - /** * Associative array for storing property values @@ -220,11 +217,21 @@ public function getStatusAllowableValues() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['pet_id'] = isset($data['pet_id']) ? $data['pet_id'] : null; - $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; - $this->container['ship_date'] = isset($data['ship_date']) ? $data['ship_date'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; - $this->container['complete'] = isset($data['complete']) ? $data['complete'] : false; + $this->container['pet_id'] = isset($data['pet_id']) + ? $data['pet_id'] + : null; + $this->container['quantity'] = isset($data['quantity']) + ? $data['quantity'] + : null; + $this->container['ship_date'] = isset($data['ship_date']) + ? $data['ship_date'] + : null; + $this->container['status'] = isset($data['status']) + ? $data['status'] + : null; + $this->container['complete'] = isset($data['complete']) + ? $data['complete'] + : false; } /** @@ -237,7 +244,10 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + if ( + !is_null($this->container['status']) && + !in_array($this->container['status'], $allowedValues, true) + ) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -258,7 +268,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets id * @@ -432,7 +441,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -477,5 +488,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index f151c8979e96..01e31bdaaabb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * OuterComposite Class Doc Comment @@ -45,17 +45,17 @@ class OuterComposite implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OuterComposite'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'my_number' => 'float', 'my_string' => 'string', @@ -63,10 +63,10 @@ class OuterComposite implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'my_number' => null, 'my_string' => null, @@ -168,10 +168,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -187,9 +183,15 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['my_number'] = isset($data['my_number']) ? $data['my_number'] : null; - $this->container['my_string'] = isset($data['my_string']) ? $data['my_string'] : null; - $this->container['my_boolean'] = isset($data['my_boolean']) ? $data['my_boolean'] : null; + $this->container['my_number'] = isset($data['my_number']) + ? $data['my_number'] + : null; + $this->container['my_string'] = isset($data['my_string']) + ? $data['my_string'] + : null; + $this->container['my_boolean'] = isset($data['my_boolean']) + ? $data['my_boolean'] + : null; } /** @@ -215,7 +217,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets my_number * @@ -308,7 +309,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -353,5 +356,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 2e69bda233a3..f2a6f105fd35 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,7 +28,7 @@ */ namespace OpenAPI\Client\Model; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * OuterEnum Class Doc Comment @@ -46,19 +46,13 @@ class OuterEnum const PLACED = 'placed'; const APPROVED = 'approved'; const DELIVERED = 'delivered'; - + /** * Gets allowable values of the enum * @return string[] */ public static function getAllowableEnumValues() { - return [ - self::PLACED, - self::APPROVED, - self::DELIVERED, - ]; + return [self::PLACED, self::APPROVED, self::DELIVERED]; } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index a6ad7fb147f5..c1a0f6bdf5a7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Pet Class Doc Comment @@ -45,17 +45,17 @@ class Pet implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Pet'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'category' => '\OpenAPI\Client\Model\Category', @@ -66,10 +66,10 @@ class Pet implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'category' => null, @@ -186,9 +186,7 @@ public function getModelName() const STATUS_AVAILABLE = 'available'; const STATUS_PENDING = 'pending'; const STATUS_SOLD = 'sold'; - - /** * Gets allowable values of the enum * @@ -199,10 +197,9 @@ public function getStatusAllowableValues() return [ self::STATUS_AVAILABLE, self::STATUS_PENDING, - self::STATUS_SOLD, + self::STATUS_SOLD ]; } - /** * Associative array for storing property values @@ -220,11 +217,17 @@ public function getStatusAllowableValues() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['category'] = isset($data['category']) ? $data['category'] : null; + $this->container['category'] = isset($data['category']) + ? $data['category'] + : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['photo_urls'] = isset($data['photo_urls']) ? $data['photo_urls'] : null; + $this->container['photo_urls'] = isset($data['photo_urls']) + ? $data['photo_urls'] + : null; $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; - $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['status'] = isset($data['status']) + ? $data['status'] + : null; } /** @@ -243,7 +246,10 @@ public function listInvalidProperties() $invalidProperties[] = "'photo_urls' can't be null"; } $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + if ( + !is_null($this->container['status']) && + !in_array($this->container['status'], $allowedValues, true) + ) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -264,7 +270,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets id * @@ -438,7 +443,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -483,5 +490,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 074ae0bd39da..14391760c7af 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * ReadOnlyFirst Class Doc Comment @@ -45,27 +45,27 @@ class ReadOnlyFirst implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ReadOnlyFirst'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bar' => 'string', 'baz' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'bar' => null, 'baz' => null @@ -163,10 +163,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -209,7 +205,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets bar * @@ -278,7 +273,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -323,5 +320,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index aeb5e92acc45..59b4ac06fa54 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * SpecialModelName Class Doc Comment @@ -45,26 +45,26 @@ class SpecialModelName implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = '$special[model.name]'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'special_property_name' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'special_property_name' => 'int64' ]; @@ -158,10 +158,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -177,7 +173,11 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['special_property_name'] = isset($data['special_property_name']) ? $data['special_property_name'] : null; + $this->container['special_property_name'] = isset( + $data['special_property_name'] + ) + ? $data['special_property_name'] + : null; } /** @@ -203,7 +203,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets special_property_name * @@ -248,7 +247,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -293,5 +294,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php index 782833285722..6aca95bc790c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * StringBooleanMap Class Doc Comment @@ -45,29 +45,25 @@ class StringBooleanMap implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'StringBooleanMap'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - - ]; + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = []; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = [ - - ]; + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = []; /** * Array of property to type mappings. Used for (de)serialization @@ -95,27 +91,21 @@ public static function openAPIFormats() * * @var string[] */ - protected static $attributeMap = [ - - ]; + protected static $attributeMap = []; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ - protected static $setters = [ - - ]; + protected static $setters = []; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ - protected static $getters = [ - - ]; + protected static $getters = []; /** * Array of attributes where the key is the local name, @@ -158,10 +148,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -223,7 +209,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -268,5 +256,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 357d10022569..ac364bf31343 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * Tag Class Doc Comment @@ -45,27 +45,27 @@ class Tag implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Tag'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'name' => null @@ -163,10 +163,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -209,7 +205,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets id * @@ -278,7 +273,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -323,5 +320,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index a49732d42f09..378ea0c78c66 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\ObjectSerializer; /** * User Class Doc Comment @@ -45,17 +45,17 @@ class User implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'User'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'username' => 'string', @@ -68,10 +68,10 @@ class User implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'username' => null, @@ -193,10 +193,6 @@ public function getModelName() return self::$openAPIModelName; } - - - - /** * Associative array for storing property values * @@ -213,13 +209,27 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['username'] = isset($data['username']) ? $data['username'] : null; - $this->container['first_name'] = isset($data['first_name']) ? $data['first_name'] : null; - $this->container['last_name'] = isset($data['last_name']) ? $data['last_name'] : null; - $this->container['email'] = isset($data['email']) ? $data['email'] : null; - $this->container['password'] = isset($data['password']) ? $data['password'] : null; - $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; - $this->container['user_status'] = isset($data['user_status']) ? $data['user_status'] : null; + $this->container['username'] = isset($data['username']) + ? $data['username'] + : null; + $this->container['first_name'] = isset($data['first_name']) + ? $data['first_name'] + : null; + $this->container['last_name'] = isset($data['last_name']) + ? $data['last_name'] + : null; + $this->container['email'] = isset($data['email']) + ? $data['email'] + : null; + $this->container['password'] = isset($data['password']) + ? $data['password'] + : null; + $this->container['phone'] = isset($data['phone']) + ? $data['phone'] + : null; + $this->container['user_status'] = isset($data['user_status']) + ? $data['user_status'] + : null; } /** @@ -245,7 +255,6 @@ public function valid() return count($this->listInvalidProperties()) === 0; } - /** * Gets id * @@ -458,7 +467,9 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) ? $this->container[$offset] : null; + return isset($this->container[$offset]) + ? $this->container[$offset] + : null; } /** @@ -503,5 +514,3 @@ public function __toString() ); } } - - diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 77b1d70cea04..403dbb9ec0dc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -50,12 +50,17 @@ class ObjectSerializer * * @return string|object serialized form of $data */ - public static function sanitizeForSerialization($data, $type = null, $format = null) - { + public static function sanitizeForSerialization( + $data, + $type = null, + $format = null + ) { if (is_scalar($data) || null === $data) { return $data; } elseif ($data instanceof \DateTime) { - return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); + return $format === 'date' + ? $data->format('Y-m-d') + : $data->format(\DateTime::ATOM); } elseif (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); @@ -68,25 +73,60 @@ public static function sanitizeForSerialization($data, $type = null, $format = n foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ($value !== null - && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) - && method_exists($openAPIType, 'getAllowableEnumValues') - && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { - $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + if ( + $value !== null && + !in_array( + $openAPIType, + [ + 'DateTime', + 'bool', + 'boolean', + 'byte', + 'double', + 'float', + 'int', + 'integer', + 'mixed', + 'number', + 'object', + 'string', + 'void' + ], + true + ) && + method_exists($openAPIType, 'getAllowableEnumValues') && + !in_array( + $value, + $openAPIType::getAllowableEnumValues(), + true + ) + ) { + $imploded = implode( + "', '", + $openAPIType::getAllowableEnumValues() + ); + throw new \InvalidArgumentException( + "Invalid value for enum '$openAPIType', must be one of: '$imploded'" + ); } if ($value !== null) { - $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + $values[ + $data::attributeMap()[$property] + ] = self::sanitizeForSerialization( + $value, + $openAPIType, + $formats[$property] + ); } } } else { - foreach($data as $property => $value) { + foreach ($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } - return (object)$values; + return (object) $values; } else { - return (string)$data; + return (string) $data; } } @@ -182,7 +222,8 @@ public static function toFormValue($value) */ public static function toString($value) { - if ($value instanceof \DateTime) { // datetime in ISO8601 format + if ($value instanceof \DateTime) { + // datetime in ISO8601 format return $value->format(\DateTime::ATOM); } else { return $value; @@ -199,12 +240,19 @@ public static function toString($value) * * @return string */ - public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) - { - if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + public static function serializeCollection( + array $collection, + $collectionFormat, + $allowCollectionFormatMulti = false + ) { + if ($allowCollectionFormatMulti && 'multi' === $collectionFormat) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays. - return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + return preg_replace( + '/%5B[0-9]+%5D=/', + '=', + http_build_query($collection, '', '&') + ); } switch ($collectionFormat) { case 'pipes': @@ -217,7 +265,7 @@ public static function serializeCollection(array $collection, $collectionFormat, return implode(' ', $collection); case 'csv': - // Deliberate fall through. CSV is default format. + // Deliberate fall through. CSV is default format. default: return implode(',', $collection); } @@ -237,7 +285,8 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + } elseif (substr($class, 0, 4) === 'map[') { + // for associative array e.g. map[string,int] $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); @@ -246,7 +295,11 @@ public static function deserialize($data, $class, $httpHeaders = null) $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { - $deserialized[$key] = self::deserialize($value, $subClass, null); + $deserialized[$key] = self::deserialize( + $value, + $subClass, + null + ); } } return $deserialized; @@ -273,22 +326,54 @@ public static function deserialize($data, $class, $httpHeaders = null) } else { return null; } - } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + } elseif ( + in_array( + $class, + [ + 'DateTime', + 'bool', + 'boolean', + 'byte', + 'double', + 'float', + 'int', + 'integer', + 'mixed', + 'number', + 'object', + 'string', + 'void' + ], + true + ) + ) { settype($data, $class); return $data; } elseif ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { - $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + if ( + array_key_exists('Content-Disposition', $httpHeaders) && + preg_match( + '/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', + $httpHeaders['Content-Disposition'], + $match + ) + ) { + $filename = + Configuration::getDefaultConfiguration()->getTempFolderPath() . + DIRECTORY_SEPARATOR . + self::sanitizeFilename($match[1]); } else { - $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + $filename = tempnam( + Configuration::getDefaultConfiguration()->getTempFolderPath(), + '' + ); } $file = fopen($filename, 'w'); - while ($chunk = $data->read(200)) { + while (($chunk = $data->read(200))) { fwrite($file, $chunk); } fclose($file); @@ -297,15 +382,21 @@ public static function deserialize($data, $class, $httpHeaders = null) } elseif (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); - throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + throw new \InvalidArgumentException( + "Invalid value for enum '$class', must be one of: '$imploded'" + ); } return $data; } else { $data = is_string($data) ? json_decode($data) : $data; // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; - if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { - $subclass = '\OpenAPI\Client\Model\\' . $data->{$discriminator}; + if ( + !empty($discriminator) && + isset($data->$discriminator) && + is_string($data->$discriminator) + ) { + $subclass = '\OpenAPI\Client\Model\\' . $data->$discriminator; if (is_subclass_of($subclass, $class)) { $class = $subclass; } @@ -314,13 +405,18 @@ public static function deserialize($data, $class, $httpHeaders = null) foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; - if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + if ( + !isset($propertySetter) || + !isset($data->{$instance::attributeMap()[$property]}) + ) { continue; } $propertyValue = $data->{$instance::attributeMap()[$property]}; if (isset($propertyValue)) { - $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + $instance->$propertySetter( + self::deserialize($propertyValue, $type, null) + ); } } return $instance; diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index 2880f5ba9b12..65c28be5c112 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use \OpenAPI\Client\Configuration; -use \OpenAPI\Client\ApiException; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\Configuration; +use OpenAPI\Client\ApiException; +use OpenAPI\Client\ObjectSerializer; /** * AnotherFakeApiTest Class Doc Comment @@ -42,7 +42,6 @@ */ class AnotherFakeApiTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index c8a1b219b3a9..326b48238d16 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use \OpenAPI\Client\Configuration; -use \OpenAPI\Client\ApiException; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\Configuration; +use OpenAPI\Client\ApiException; +use OpenAPI\Client\ObjectSerializer; /** * FakeApiTest Class Doc Comment @@ -42,7 +42,6 @@ */ class FakeApiTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index 718fbcb30e9e..c72c5d54e0fb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use \OpenAPI\Client\Configuration; -use \OpenAPI\Client\ApiException; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\Configuration; +use OpenAPI\Client\ApiException; +use OpenAPI\Client\ObjectSerializer; /** * FakeClassnameTags123ApiTest Class Doc Comment @@ -42,7 +42,6 @@ */ class FakeClassnameTags123ApiTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index 40e20ba9f2f1..c5189f841eb3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use \OpenAPI\Client\Configuration; -use \OpenAPI\Client\ApiException; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\Configuration; +use OpenAPI\Client\ApiException; +use OpenAPI\Client\ObjectSerializer; /** * PetApiTest Class Doc Comment @@ -42,7 +42,6 @@ */ class PetApiTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index fa689746517c..7cf1da1bbc33 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use \OpenAPI\Client\Configuration; -use \OpenAPI\Client\ApiException; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\Configuration; +use OpenAPI\Client\ApiException; +use OpenAPI\Client\ObjectSerializer; /** * StoreApiTest Class Doc Comment @@ -42,7 +42,6 @@ */ class StoreApiTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index a904c3bfe062..acaabeeb1e74 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use \OpenAPI\Client\Configuration; -use \OpenAPI\Client\ApiException; -use \OpenAPI\Client\ObjectSerializer; +use OpenAPI\Client\Configuration; +use OpenAPI\Client\ApiException; +use OpenAPI\Client\ObjectSerializer; /** * UserApiTest Class Doc Comment @@ -42,7 +42,6 @@ */ class UserApiTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index dfae0c32c4c9..d253cb7e2245 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class AdditionalPropertiesClassTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php index ac52c8db220b..ca36a90ad2d7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class AnimalFarmTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index b8c08fc9a923..a7162d3423e2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class AnimalTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index 942391c06b0e..ea63b31267b8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ApiResponseTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 2a1ae856c0d1..18203666b3e5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ArrayOfArrayOfNumberOnlyTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 2728b43e7ab9..75bc397d51d3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ArrayOfNumberOnlyTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index fce5ac1a44a9..8da5687d6f43 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ArrayTestTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index ded18109da5c..188ca81d79ad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class CapitalizationTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index de5fb181c6d2..49dbc357e51e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class CatTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index 421c8d2fae76..bb50f085458b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class CategoryTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index 02997e5c669f..ba8d22a7e147 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ClassModelTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index 2e02a439db00..a9a103064c95 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ClientTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index d39130d1b3ac..880038b13242 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class DogTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index edec02ad0af8..08e6ea80c47a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class EnumArraysTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index f0575cdbe96d..1689b4e68db9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class EnumClassTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index e968f550bdeb..6a01b4e2f28a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class EnumTestTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php index 68b2bb73f160..6670ebc88b24 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class FileSchemaTestClassTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index ee9aab521737..574d04b3b517 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class FileTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index bb4992a126b6..4331a61a0346 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class FormatTestTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 552ebf8b435b..6099e3885611 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class HasOnlyReadOnlyTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index cdf7cbbce514..0093cd0ac378 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class MapTestTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index 2830f1165f99..edcca2f85dc3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -38,9 +38,9 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class MixedPropertiesAndAdditionalPropertiesClassTest extends \PHPUnit_Framework_TestCase +class MixedPropertiesAndAdditionalPropertiesClassTest extends + \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index ee972620fc13..bb9d5f019676 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class Model200ResponseTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index 9786a3f7dae6..8c5d4fcebc4f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ModelListTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index fc7147e7265b..6b92c6c195ff 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ModelReturnTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index 39045f66a0b9..53e726a8c5ff 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class NameTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index 2d0f99e11e29..bb47fbb9a3d6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class NumberOnlyTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index 33e14de9e05d..fb4d262d57c1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class OrderTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 9735a5612bfb..4ba25e254d43 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class OuterCompositeTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index be04ee705cfb..e99fbe006066 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class OuterEnumTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index ce886a65f60a..c55dd6e19390 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class PetTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index 35128f767980..cbee4c517f10 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class ReadOnlyFirstTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index 0d7fb2d540e6..be5e0529cdfd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class SpecialModelNameTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php index 990cf5d8e3c2..125910a1a393 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class StringBooleanMapTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index 72ed9d787f41..fc98cc8fac92 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class TagTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index 28ea7bc47c3d..2872cbdc9953 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,7 +40,6 @@ */ class UserTest extends \PHPUnit_Framework_TestCase { - /** * Setup before running any test case */ From 47359f833b786dfc424a1f81443bcbc390049974 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Thu, 8 Nov 2018 16:18:31 +0800 Subject: [PATCH 2/2] restore php petstore client --- .../lib/Api/AnotherFakeApi.php | 70 +- .../php/OpenAPIClient-php/lib/Api/FakeApi.php | 1133 ++++++----------- .../lib/Api/FakeClassnameTags123Api.php | 69 +- .../php/OpenAPIClient-php/lib/Api/PetApi.php | 688 ++++------ .../OpenAPIClient-php/lib/Api/StoreApi.php | 258 ++-- .../php/OpenAPIClient-php/lib/Api/UserApi.php | 470 ++++--- .../OpenAPIClient-php/lib/ApiException.php | 11 +- .../OpenAPIClient-php/lib/Configuration.php | 17 +- .../OpenAPIClient-php/lib/HeaderSelector.php | 18 +- .../lib/Model/AdditionalPropertiesClass.php | 49 +- .../OpenAPIClient-php/lib/Model/Animal.php | 47 +- .../lib/Model/AnimalFarm.php | 58 +- .../lib/Model/ApiResponse.php | 43 +- .../lib/Model/ArrayOfArrayOfNumberOnly.php | 45 +- .../lib/Model/ArrayOfNumberOnly.php | 43 +- .../OpenAPIClient-php/lib/Model/ArrayTest.php | 55 +- .../lib/Model/Capitalization.php | 65 +- .../php/OpenAPIClient-php/lib/Model/Cat.php | 46 +- .../OpenAPIClient-php/lib/Model/Category.php | 43 +- .../lib/Model/ClassModel.php | 43 +- .../OpenAPIClient-php/lib/Model/Client.php | 43 +- .../php/OpenAPIClient-php/lib/Model/Dog.php | 46 +- .../lib/Model/EnumArrays.php | 65 +- .../OpenAPIClient-php/lib/Model/EnumClass.php | 14 +- .../OpenAPIClient-php/lib/Model/EnumTest.php | 119 +- .../php/OpenAPIClient-php/lib/Model/File.php | 43 +- .../lib/Model/FileSchemaTestClass.php | 43 +- .../lib/Model/FormatTest.php | 277 ++-- .../lib/Model/HasOnlyReadOnly.php | 39 +- .../OpenAPIClient-php/lib/Model/MapTest.php | 68 +- ...PropertiesAndAdditionalPropertiesClass.php | 47 +- .../lib/Model/Model200Response.php | 43 +- .../lib/Model/ModelInterface.php | 2 +- .../OpenAPIClient-php/lib/Model/ModelList.php | 43 +- .../lib/Model/ModelReturn.php | 43 +- .../php/OpenAPIClient-php/lib/Model/Name.php | 51 +- .../lib/Model/NumberOnly.php | 43 +- .../php/OpenAPIClient-php/lib/Model/Order.php | 65 +- .../lib/Model/OuterComposite.php | 51 +- .../OpenAPIClient-php/lib/Model/OuterEnum.php | 14 +- .../php/OpenAPIClient-php/lib/Model/Pet.php | 57 +- .../lib/Model/ReadOnlyFirst.php | 39 +- .../lib/Model/SpecialModelName.php | 45 +- .../lib/Model/StringBooleanMap.php | 58 +- .../php/OpenAPIClient-php/lib/Model/Tag.php | 39 +- .../php/OpenAPIClient-php/lib/Model/User.php | 67 +- .../lib/ObjectSerializer.php | 162 +-- .../test/Api/AnotherFakeApiTest.php | 9 +- .../test/Api/FakeApiTest.php | 9 +- .../test/Api/FakeClassnameTags123ApiTest.php | 9 +- .../OpenAPIClient-php/test/Api/PetApiTest.php | 9 +- .../test/Api/StoreApiTest.php | 9 +- .../test/Api/UserApiTest.php | 9 +- .../Model/AdditionalPropertiesClassTest.php | 3 +- .../test/Model/AnimalFarmTest.php | 3 +- .../test/Model/AnimalTest.php | 3 +- .../test/Model/ApiResponseTest.php | 3 +- .../Model/ArrayOfArrayOfNumberOnlyTest.php | 3 +- .../test/Model/ArrayOfNumberOnlyTest.php | 3 +- .../test/Model/ArrayTestTest.php | 3 +- .../test/Model/CapitalizationTest.php | 3 +- .../OpenAPIClient-php/test/Model/CatTest.php | 3 +- .../test/Model/CategoryTest.php | 3 +- .../test/Model/ClassModelTest.php | 3 +- .../test/Model/ClientTest.php | 3 +- .../OpenAPIClient-php/test/Model/DogTest.php | 3 +- .../test/Model/EnumArraysTest.php | 3 +- .../test/Model/EnumClassTest.php | 3 +- .../test/Model/EnumTestTest.php | 3 +- .../test/Model/FileSchemaTestClassTest.php | 3 +- .../OpenAPIClient-php/test/Model/FileTest.php | 3 +- .../test/Model/FormatTestTest.php | 3 +- .../test/Model/HasOnlyReadOnlyTest.php | 3 +- .../test/Model/MapTestTest.php | 3 +- ...ertiesAndAdditionalPropertiesClassTest.php | 6 +- .../test/Model/Model200ResponseTest.php | 3 +- .../test/Model/ModelListTest.php | 3 +- .../test/Model/ModelReturnTest.php | 3 +- .../OpenAPIClient-php/test/Model/NameTest.php | 3 +- .../test/Model/NumberOnlyTest.php | 3 +- .../test/Model/OrderTest.php | 3 +- .../test/Model/OuterCompositeTest.php | 3 +- .../test/Model/OuterEnumTest.php | 3 +- .../OpenAPIClient-php/test/Model/PetTest.php | 3 +- .../test/Model/ReadOnlyFirstTest.php | 3 +- .../test/Model/SpecialModelNameTest.php | 3 +- .../test/Model/StringBooleanMapTest.php | 3 +- .../OpenAPIClient-php/test/Model/TagTest.php | 3 +- .../OpenAPIClient-php/test/Model/UserTest.php | 3 +- 89 files changed, 2191 insertions(+), 2871 deletions(-) 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 73f99e310aed..4c23e6c15228 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -128,12 +128,7 @@ public function call123TestSpecialTagsWithHttpInfo($client) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -153,7 +148,7 @@ public function call123TestSpecialTagsWithHttpInfo($client) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -162,11 +157,7 @@ public function call123TestSpecialTagsWithHttpInfo($client) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\Client', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -185,6 +176,7 @@ public function call123TestSpecialTagsWithHttpInfo($client) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -212,11 +204,12 @@ public function call123TestSpecialTagsWithHttpInfo($client) */ public function call123TestSpecialTagsAsync($client) { - return $this->call123TestSpecialTagsAsyncWithHttpInfo($client)->then( - function ($response) { - return $response[0]; - } - ); + return $this->call123TestSpecialTagsAsyncWithHttpInfo($client) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -246,11 +239,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -296,6 +285,8 @@ protected function call123TestSpecialTagsRequest($client) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($client)) { @@ -303,9 +294,9 @@ protected function call123TestSpecialTagsRequest($client) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -317,9 +308,7 @@ protected function call123TestSpecialTagsRequest($client) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -334,27 +323,32 @@ protected function call123TestSpecialTagsRequest($client) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -370,15 +364,9 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen( - $this->config->getDebugFile(), - 'a' - ); + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException( - 'Failed to open the debug file: ' . - $this->config->getDebugFile() - ); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } 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 b83f2c7165ad..11d71a693780 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -124,12 +124,7 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -149,7 +144,7 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('bool' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -177,6 +172,7 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -195,7 +191,7 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) /** * Operation fakeOuterBooleanSerializeAsync * - * + * * * @param bool $body Input boolean as post body (optional) * @@ -204,17 +200,18 @@ public function fakeOuterBooleanSerializeWithHttpInfo($body = null) */ public function fakeOuterBooleanSerializeAsync($body = null) { - return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body)->then( - function ($response) { - return $response[0]; - } - ); + return $this->fakeOuterBooleanSerializeAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation fakeOuterBooleanSerializeAsyncWithHttpInfo * - * + * * * @param bool $body Input boolean as post body (optional) * @@ -238,11 +235,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -274,6 +267,7 @@ function ($exception) { */ protected function fakeOuterBooleanSerializeRequest($body = null) { + $resourcePath = '/fake/outer/boolean'; $formParams = []; $queryParams = []; @@ -281,6 +275,8 @@ protected function fakeOuterBooleanSerializeRequest($body = null) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($body)) { @@ -288,20 +284,21 @@ protected function fakeOuterBooleanSerializeRequest($body = null) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - '*/*' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['*/*'] + ); } else { - $headers = $this->headerSelector->selectHeaders(['*/*'], []); + $headers = $this->headerSelector->selectHeaders( + ['*/*'], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -316,27 +313,32 @@ protected function fakeOuterBooleanSerializeRequest($body = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -353,9 +355,7 @@ protected function fakeOuterBooleanSerializeRequest($body = null) */ public function fakeOuterCompositeSerialize($outer_composite = null) { - list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo( - $outer_composite - ); + list($response) = $this->fakeOuterCompositeSerializeWithHttpInfo($outer_composite); return $response; } @@ -368,9 +368,8 @@ public function fakeOuterCompositeSerialize($outer_composite = null) * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\OuterComposite, HTTP status code, HTTP response headers (array of strings) */ - public function fakeOuterCompositeSerializeWithHttpInfo( - $outer_composite = null - ) { + public function fakeOuterCompositeSerializeWithHttpInfo($outer_composite = null) + { $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); try { @@ -382,12 +381,7 @@ public function fakeOuterCompositeSerializeWithHttpInfo( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -407,23 +401,16 @@ public function fakeOuterCompositeSerializeWithHttpInfo( } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: - if ( - '\OpenAPI\Client\Model\OuterComposite' === - '\SplFileObject' - ) { + if ('\OpenAPI\Client\Model\OuterComposite' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\OuterComposite', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\OuterComposite', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -442,6 +429,7 @@ public function fakeOuterCompositeSerializeWithHttpInfo( $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -460,7 +448,7 @@ public function fakeOuterCompositeSerializeWithHttpInfo( /** * Operation fakeOuterCompositeSerializeAsync * - * + * * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * @@ -469,26 +457,26 @@ public function fakeOuterCompositeSerializeWithHttpInfo( */ public function fakeOuterCompositeSerializeAsync($outer_composite = null) { - return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo( - $outer_composite - )->then(function ($response) { - return $response[0]; - }); + return $this->fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite) + ->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation fakeOuterCompositeSerializeAsyncWithHttpInfo * - * + * * * @param \OpenAPI\Client\Model\OuterComposite $outer_composite Input composite as post body (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function fakeOuterCompositeSerializeAsyncWithHttpInfo( - $outer_composite = null - ) { + public function fakeOuterCompositeSerializeAsyncWithHttpInfo($outer_composite = null) + { $returnType = '\OpenAPI\Client\Model\OuterComposite'; $request = $this->fakeOuterCompositeSerializeRequest($outer_composite); @@ -504,11 +492,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -538,9 +522,9 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function fakeOuterCompositeSerializeRequest( - $outer_composite = null - ) { + protected function fakeOuterCompositeSerializeRequest($outer_composite = null) + { + $resourcePath = '/fake/outer/composite'; $formParams = []; $queryParams = []; @@ -548,6 +532,8 @@ protected function fakeOuterCompositeSerializeRequest( $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($outer_composite)) { @@ -555,20 +541,21 @@ protected function fakeOuterCompositeSerializeRequest( } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - '*/*' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['*/*'] + ); } else { - $headers = $this->headerSelector->selectHeaders(['*/*'], []); + $headers = $this->headerSelector->selectHeaders( + ['*/*'], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -583,27 +570,32 @@ protected function fakeOuterCompositeSerializeRequest( } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -646,12 +638,7 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -671,7 +658,7 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('float' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -699,6 +686,7 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -717,7 +705,7 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) /** * Operation fakeOuterNumberSerializeAsync * - * + * * * @param float $body Input number as post body (optional) * @@ -726,17 +714,18 @@ public function fakeOuterNumberSerializeWithHttpInfo($body = null) */ public function fakeOuterNumberSerializeAsync($body = null) { - return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body)->then( - function ($response) { - return $response[0]; - } - ); + return $this->fakeOuterNumberSerializeAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation fakeOuterNumberSerializeAsyncWithHttpInfo * - * + * * * @param float $body Input number as post body (optional) * @@ -760,11 +749,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -796,6 +781,7 @@ function ($exception) { */ protected function fakeOuterNumberSerializeRequest($body = null) { + $resourcePath = '/fake/outer/number'; $formParams = []; $queryParams = []; @@ -803,6 +789,8 @@ protected function fakeOuterNumberSerializeRequest($body = null) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($body)) { @@ -810,20 +798,21 @@ protected function fakeOuterNumberSerializeRequest($body = null) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - '*/*' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['*/*'] + ); } else { - $headers = $this->headerSelector->selectHeaders(['*/*'], []); + $headers = $this->headerSelector->selectHeaders( + ['*/*'], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -838,27 +827,32 @@ protected function fakeOuterNumberSerializeRequest($body = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -901,12 +895,7 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -926,7 +915,7 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -954,6 +943,7 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -972,7 +962,7 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) /** * Operation fakeOuterStringSerializeAsync * - * + * * * @param string $body Input string as post body (optional) * @@ -981,17 +971,18 @@ public function fakeOuterStringSerializeWithHttpInfo($body = null) */ public function fakeOuterStringSerializeAsync($body = null) { - return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body)->then( - function ($response) { - return $response[0]; - } - ); + return $this->fakeOuterStringSerializeAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation fakeOuterStringSerializeAsyncWithHttpInfo * - * + * * * @param string $body Input string as post body (optional) * @@ -1015,11 +1006,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1051,6 +1038,7 @@ function ($exception) { */ protected function fakeOuterStringSerializeRequest($body = null) { + $resourcePath = '/fake/outer/string'; $formParams = []; $queryParams = []; @@ -1058,6 +1046,8 @@ protected function fakeOuterStringSerializeRequest($body = null) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($body)) { @@ -1065,20 +1055,21 @@ protected function fakeOuterStringSerializeRequest($body = null) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - '*/*' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['*/*'] + ); } else { - $headers = $this->headerSelector->selectHeaders(['*/*'], []); + $headers = $this->headerSelector->selectHeaders( + ['*/*'], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1093,27 +1084,32 @@ protected function fakeOuterStringSerializeRequest($body = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1144,9 +1140,7 @@ public function testBodyWithFileSchema($file_schema_test_class) */ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) { - $request = $this->testBodyWithFileSchemaRequest( - $file_schema_test_class - ); + $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); try { $options = $this->createHttpClientOption(); @@ -1157,12 +1151,7 @@ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1182,6 +1171,7 @@ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1192,7 +1182,7 @@ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) /** * Operation testBodyWithFileSchemaAsync * - * + * * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) * @@ -1201,40 +1191,34 @@ public function testBodyWithFileSchemaWithHttpInfo($file_schema_test_class) */ public function testBodyWithFileSchemaAsync($file_schema_test_class) { - return $this->testBodyWithFileSchemaAsyncWithHttpInfo( - $file_schema_test_class - )->then(function ($response) { - return $response[0]; - }); + return $this->testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) + ->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation testBodyWithFileSchemaAsyncWithHttpInfo * - * + * * * @param \OpenAPI\Client\Model\FileSchemaTestClass $file_schema_test_class (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testBodyWithFileSchemaAsyncWithHttpInfo( - $file_schema_test_class - ) { + public function testBodyWithFileSchemaAsyncWithHttpInfo($file_schema_test_class) + { $returnType = ''; - $request = $this->testBodyWithFileSchemaRequest( - $file_schema_test_class - ); + $request = $this->testBodyWithFileSchemaRequest($file_schema_test_class); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1264,11 +1248,7 @@ function ($exception) { protected function testBodyWithFileSchemaRequest($file_schema_test_class) { // verify the required parameter 'file_schema_test_class' is set - if ( - $file_schema_test_class === null || - (is_array($file_schema_test_class) && - count($file_schema_test_class) === 0) - ) { + if ($file_schema_test_class === null || (is_array($file_schema_test_class) && count($file_schema_test_class) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $file_schema_test_class when calling testBodyWithFileSchema' ); @@ -1281,6 +1261,8 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($file_schema_test_class)) { @@ -1288,7 +1270,9 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -1300,9 +1284,7 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1317,27 +1299,32 @@ protected function testBodyWithFileSchemaRequest($file_schema_test_class) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1381,12 +1368,7 @@ public function testBodyWithQueryParamsWithHttpInfo($query, $user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1406,6 +1388,7 @@ public function testBodyWithQueryParamsWithHttpInfo($query, $user) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1416,7 +1399,7 @@ public function testBodyWithQueryParamsWithHttpInfo($query, $user) /** * Operation testBodyWithQueryParamsAsync * - * + * * * @param string $query (required) * @param \OpenAPI\Client\Model\User $user (required) @@ -1426,18 +1409,18 @@ public function testBodyWithQueryParamsWithHttpInfo($query, $user) */ public function testBodyWithQueryParamsAsync($query, $user) { - return $this->testBodyWithQueryParamsAsyncWithHttpInfo( - $query, - $user - )->then(function ($response) { - return $response[0]; - }); + return $this->testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) + ->then( + function ($response) { + return $response[0]; + } + ); } /** * Operation testBodyWithQueryParamsAsyncWithHttpInfo * - * + * * * @param string $query (required) * @param \OpenAPI\Client\Model\User $user (required) @@ -1454,11 +1437,7 @@ public function testBodyWithQueryParamsAsyncWithHttpInfo($query, $user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1513,6 +1492,7 @@ protected function testBodyWithQueryParamsRequest($query, $user) $queryParams['query'] = ObjectSerializer::toQueryValue($query); } + // body params $_tempBody = null; if (isset($user)) { @@ -1520,7 +1500,9 @@ protected function testBodyWithQueryParamsRequest($query, $user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -1532,9 +1514,7 @@ protected function testBodyWithQueryParamsRequest($query, $user) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1549,27 +1529,32 @@ protected function testBodyWithQueryParamsRequest($query, $user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1616,12 +1601,7 @@ public function testClientModelWithHttpInfo($client) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1641,7 +1621,7 @@ public function testClientModelWithHttpInfo($client) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1650,11 +1630,7 @@ public function testClientModelWithHttpInfo($client) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\Client', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1673,6 +1649,7 @@ public function testClientModelWithHttpInfo($client) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1700,11 +1677,12 @@ public function testClientModelWithHttpInfo($client) */ public function testClientModelAsync($client) { - return $this->testClientModelAsyncWithHttpInfo($client)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->testClientModelAsyncWithHttpInfo($client) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1734,11 +1712,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1784,6 +1758,8 @@ protected function testClientModelRequest($client) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($client)) { @@ -1791,9 +1767,9 @@ protected function testClientModelRequest($client) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -1805,9 +1781,7 @@ protected function testClientModelRequest($client) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1822,27 +1796,32 @@ protected function testClientModelRequest($client) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1872,38 +1851,9 @@ protected function testClientModelRequest($client) * @throws \InvalidArgumentException * @return void */ - public function testEndpointParameters( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer = null, - $int32 = null, - $int64 = null, - $float = null, - $string = null, - $binary = null, - $date = null, - $date_time = null, - $password = null, - $callback = null - ) { - $this->testEndpointParametersWithHttpInfo( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer, - $int32, - $int64, - $float, - $string, - $binary, - $date, - $date_time, - $password, - $callback - ); + public function testEndpointParameters($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + { + $this->testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); } /** @@ -1930,38 +1880,9 @@ public function testEndpointParameters( * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testEndpointParametersWithHttpInfo( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer = null, - $int32 = null, - $int64 = null, - $float = null, - $string = null, - $binary = null, - $date = null, - $date_time = null, - $password = null, - $callback = null - ) { - $request = $this->testEndpointParametersRequest( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer, - $int32, - $int64, - $float, - $string, - $binary, - $date, - $date_time, - $password, - $callback - ); + public function testEndpointParametersWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + { + $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); try { $options = $this->createHttpClientOption(); @@ -1972,12 +1893,7 @@ public function testEndpointParametersWithHttpInfo( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1997,6 +1913,7 @@ public function testEndpointParametersWithHttpInfo( } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -2027,40 +1944,14 @@ public function testEndpointParametersWithHttpInfo( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEndpointParametersAsync( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer = null, - $int32 = null, - $int64 = null, - $float = null, - $string = null, - $binary = null, - $date = null, - $date_time = null, - $password = null, - $callback = null - ) { - return $this->testEndpointParametersAsyncWithHttpInfo( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer, - $int32, - $int64, - $float, - $string, - $binary, - $date, - $date_time, - $password, - $callback - )->then(function ($response) { - return $response[0]; - }); + public function testEndpointParametersAsync($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + { + return $this->testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -2086,49 +1977,16 @@ public function testEndpointParametersAsync( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEndpointParametersAsyncWithHttpInfo( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer = null, - $int32 = null, - $int64 = null, - $float = null, - $string = null, - $binary = null, - $date = null, - $date_time = null, - $password = null, - $callback = null - ) { + public function testEndpointParametersAsyncWithHttpInfo($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + { $returnType = ''; - $request = $this->testEndpointParametersRequest( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer, - $int32, - $int64, - $float, - $string, - $binary, - $date, - $date_time, - $password, - $callback - ); + $request = $this->testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer, $int32, $int64, $float, $string, $binary, $date, $date_time, $password, $callback); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -2168,22 +2026,8 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testEndpointParametersRequest( - $number, - $double, - $pattern_without_delimiter, - $byte, - $integer = null, - $int32 = null, - $int64 = null, - $float = null, - $string = null, - $binary = null, - $date = null, - $date_time = null, - $password = null, - $callback = null - ) { + protected function testEndpointParametersRequest($number, $double, $pattern_without_delimiter, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $string = null, $binary = null, $date = null, $date_time = null, $password = null, $callback = null) + { // verify the required parameter 'number' is set if ($number === null || (is_array($number) && count($number) === 0)) { throw new \InvalidArgumentException( @@ -2191,14 +2035,10 @@ protected function testEndpointParametersRequest( ); } if ($number > 543.2) { - throw new \InvalidArgumentException( - 'invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.' - ); + throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 543.2.'); } if ($number < 32.1) { - throw new \InvalidArgumentException( - 'invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.' - ); + throw new \InvalidArgumentException('invalid value for "$number" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 32.1.'); } // verify the required parameter 'double' is set @@ -2208,30 +2048,20 @@ protected function testEndpointParametersRequest( ); } if ($double > 123.4) { - throw new \InvalidArgumentException( - 'invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.' - ); + throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 123.4.'); } if ($double < 67.8) { - throw new \InvalidArgumentException( - 'invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.' - ); + throw new \InvalidArgumentException('invalid value for "$double" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 67.8.'); } // verify the required parameter 'pattern_without_delimiter' is set - if ( - $pattern_without_delimiter === null || - (is_array($pattern_without_delimiter) && - count($pattern_without_delimiter) === 0) - ) { + if ($pattern_without_delimiter === null || (is_array($pattern_without_delimiter) && count($pattern_without_delimiter) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $pattern_without_delimiter when calling testEndpointParameters' ); } if (!preg_match("/^[A-Z].*/", $pattern_without_delimiter)) { - throw new \InvalidArgumentException( - "invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*/." - ); + throw new \InvalidArgumentException("invalid value for \"pattern_without_delimiter\" when calling FakeApi.testEndpointParameters, must conform to the pattern /^[A-Z].*/."); } // verify the required parameter 'byte' is set @@ -2241,50 +2071,35 @@ protected function testEndpointParametersRequest( ); } if ($integer !== null && $integer > 100) { - throw new \InvalidArgumentException( - 'invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.' - ); + throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 100.'); } if ($integer !== null && $integer < 10) { - throw new \InvalidArgumentException( - 'invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.' - ); + throw new \InvalidArgumentException('invalid value for "$integer" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); } if ($int32 !== null && $int32 > 200) { - throw new \InvalidArgumentException( - 'invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.' - ); + throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 200.'); } if ($int32 !== null && $int32 < 20) { - throw new \InvalidArgumentException( - 'invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.' - ); + throw new \InvalidArgumentException('invalid value for "$int32" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 20.'); } if ($float !== null && $float > 987.6) { - throw new \InvalidArgumentException( - 'invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.' - ); + throw new \InvalidArgumentException('invalid value for "$float" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 987.6.'); } if ($string !== null && !preg_match("/[a-z]/i", $string)) { - throw new \InvalidArgumentException( - "invalid value for \"string\" when calling FakeApi.testEndpointParameters, must conform to the pattern /[a-z]/i." - ); + throw new \InvalidArgumentException("invalid value for \"string\" when calling FakeApi.testEndpointParameters, must conform to the pattern /[a-z]/i."); } if ($password !== null && strlen($password) > 64) { - throw new \InvalidArgumentException( - 'invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.' - ); + throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be smaller than or equal to 64.'); } if ($password !== null && strlen($password) < 10) { - throw new \InvalidArgumentException( - 'invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.' - ); + throw new \InvalidArgumentException('invalid length for "$password" when calling FakeApi.testEndpointParameters, must be bigger than or equal to 10.'); } + $resourcePath = '/fake'; $formParams = []; $queryParams = []; @@ -2292,6 +2107,8 @@ protected function testEndpointParametersRequest( $httpBody = ''; $multipart = false; + + // form params if ($integer !== null) { $formParams['integer'] = ObjectSerializer::toFormValue($integer); @@ -2322,9 +2139,7 @@ protected function testEndpointParametersRequest( } // form params if ($pattern_without_delimiter !== null) { - $formParams[ - 'pattern_without_delimiter' - ] = ObjectSerializer::toFormValue($pattern_without_delimiter); + $formParams['pattern_without_delimiter'] = ObjectSerializer::toFormValue($pattern_without_delimiter); } // form params if ($byte !== null) { @@ -2333,10 +2148,7 @@ protected function testEndpointParametersRequest( // form params if ($binary !== null) { $multipart = true; - $formParams['binary'] = \GuzzleHttp\Psr7\try_fopen( - ObjectSerializer::toFormValue($binary), - 'rb' - ); + $formParams['binary'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($binary), 'rb'); } // form params if ($date !== null) { @@ -2358,7 +2170,9 @@ protected function testEndpointParametersRequest( $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -2370,9 +2184,7 @@ protected function testEndpointParametersRequest( if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -2387,8 +2199,10 @@ protected function testEndpointParametersRequest( } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -2396,17 +2210,8 @@ protected function testEndpointParametersRequest( } // this endpoint requires HTTP basic authentication - if ( - $this->config->getUsername() !== null || - $this->config->getPassword() !== null - ) { - $headers['Authorization'] = - 'Basic ' . - base64_encode( - $this->config->getUsername() . - ":" . - $this->config->getPassword() - ); + if ($this->config->getUsername() !== null || $this->config->getPassword() !== null) { + $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . ":" . $this->config->getPassword()); } $defaultHeaders = []; @@ -2414,14 +2219,16 @@ protected function testEndpointParametersRequest( $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2445,26 +2252,9 @@ protected function testEndpointParametersRequest( * @throws \InvalidArgumentException * @return void */ - public function testEnumParameters( - $enum_header_string_array = null, - $enum_header_string = '-efg', - $enum_query_string_array = null, - $enum_query_string = '-efg', - $enum_query_integer = null, - $enum_query_double = null, - $enum_form_string_array = '$', - $enum_form_string = '-efg' - ) { - $this->testEnumParametersWithHttpInfo( - $enum_header_string_array, - $enum_header_string, - $enum_query_string_array, - $enum_query_string, - $enum_query_integer, - $enum_query_double, - $enum_form_string_array, - $enum_form_string - ); + public function testEnumParameters($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + { + $this->testEnumParametersWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); } /** @@ -2485,26 +2275,9 @@ public function testEnumParameters( * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function testEnumParametersWithHttpInfo( - $enum_header_string_array = null, - $enum_header_string = '-efg', - $enum_query_string_array = null, - $enum_query_string = '-efg', - $enum_query_integer = null, - $enum_query_double = null, - $enum_form_string_array = '$', - $enum_form_string = '-efg' - ) { - $request = $this->testEnumParametersRequest( - $enum_header_string_array, - $enum_header_string, - $enum_query_string_array, - $enum_query_string, - $enum_query_integer, - $enum_query_double, - $enum_form_string_array, - $enum_form_string - ); + public function testEnumParametersWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + { + $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); try { $options = $this->createHttpClientOption(); @@ -2515,12 +2288,7 @@ public function testEnumParametersWithHttpInfo( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -2540,6 +2308,7 @@ public function testEnumParametersWithHttpInfo( } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -2564,28 +2333,14 @@ public function testEnumParametersWithHttpInfo( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEnumParametersAsync( - $enum_header_string_array = null, - $enum_header_string = '-efg', - $enum_query_string_array = null, - $enum_query_string = '-efg', - $enum_query_integer = null, - $enum_query_double = null, - $enum_form_string_array = '$', - $enum_form_string = '-efg' - ) { - return $this->testEnumParametersAsyncWithHttpInfo( - $enum_header_string_array, - $enum_header_string, - $enum_query_string_array, - $enum_query_string, - $enum_query_integer, - $enum_query_double, - $enum_form_string_array, - $enum_form_string - )->then(function ($response) { - return $response[0]; - }); + public function testEnumParametersAsync($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + { + return $this->testEnumParametersAsyncWithHttpInfo($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -2605,37 +2360,16 @@ public function testEnumParametersAsync( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testEnumParametersAsyncWithHttpInfo( - $enum_header_string_array = null, - $enum_header_string = '-efg', - $enum_query_string_array = null, - $enum_query_string = '-efg', - $enum_query_integer = null, - $enum_query_double = null, - $enum_form_string_array = '$', - $enum_form_string = '-efg' - ) { + public function testEnumParametersAsyncWithHttpInfo($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + { $returnType = ''; - $request = $this->testEnumParametersRequest( - $enum_header_string_array, - $enum_header_string, - $enum_query_string_array, - $enum_query_string, - $enum_query_integer, - $enum_query_double, - $enum_form_string_array, - $enum_form_string - ); + $request = $this->testEnumParametersRequest($enum_header_string_array, $enum_header_string, $enum_query_string_array, $enum_query_string, $enum_query_integer, $enum_query_double, $enum_form_string_array, $enum_form_string); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -2669,16 +2403,9 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function testEnumParametersRequest( - $enum_header_string_array = null, - $enum_header_string = '-efg', - $enum_query_string_array = null, - $enum_query_string = '-efg', - $enum_query_integer = null, - $enum_query_double = null, - $enum_form_string_array = '$', - $enum_form_string = '-efg' - ) { + protected function testEnumParametersRequest($enum_header_string_array = null, $enum_header_string = '-efg', $enum_query_string_array = null, $enum_query_string = '-efg', $enum_query_integer = null, $enum_query_double = null, $enum_form_string_array = '$', $enum_form_string = '-efg') + { + $resourcePath = '/fake'; $formParams = []; $queryParams = []; @@ -2688,71 +2415,51 @@ protected function testEnumParametersRequest( // query params if (is_array($enum_query_string_array)) { - $enum_query_string_array = ObjectSerializer::serializeCollection( - $enum_query_string_array, - 'csv', - true - ); + $enum_query_string_array = ObjectSerializer::serializeCollection($enum_query_string_array, 'csv', true); } if ($enum_query_string_array !== null) { - $queryParams[ - 'enum_query_string_array' - ] = ObjectSerializer::toQueryValue($enum_query_string_array); + $queryParams['enum_query_string_array'] = ObjectSerializer::toQueryValue($enum_query_string_array); } // query params if ($enum_query_string !== null) { - $queryParams['enum_query_string'] = ObjectSerializer::toQueryValue( - $enum_query_string - ); + $queryParams['enum_query_string'] = ObjectSerializer::toQueryValue($enum_query_string); } // query params if ($enum_query_integer !== null) { - $queryParams['enum_query_integer'] = ObjectSerializer::toQueryValue( - $enum_query_integer - ); + $queryParams['enum_query_integer'] = ObjectSerializer::toQueryValue($enum_query_integer); } // query params if ($enum_query_double !== null) { - $queryParams['enum_query_double'] = ObjectSerializer::toQueryValue( - $enum_query_double - ); + $queryParams['enum_query_double'] = ObjectSerializer::toQueryValue($enum_query_double); } // header params if (is_array($enum_header_string_array)) { - $enum_header_string_array = ObjectSerializer::serializeCollection( - $enum_header_string_array, - 'csv' - ); + $enum_header_string_array = ObjectSerializer::serializeCollection($enum_header_string_array, 'csv'); } if ($enum_header_string_array !== null) { - $headerParams[ - 'enum_header_string_array' - ] = ObjectSerializer::toHeaderValue($enum_header_string_array); + $headerParams['enum_header_string_array'] = ObjectSerializer::toHeaderValue($enum_header_string_array); } // header params if ($enum_header_string !== null) { - $headerParams[ - 'enum_header_string' - ] = ObjectSerializer::toHeaderValue($enum_header_string); + $headerParams['enum_header_string'] = ObjectSerializer::toHeaderValue($enum_header_string); } + // form params if ($enum_form_string_array !== null) { - $formParams[ - 'enum_form_string_array' - ] = ObjectSerializer::toFormValue($enum_form_string_array); + $formParams['enum_form_string_array'] = ObjectSerializer::toFormValue($enum_form_string_array); } // form params if ($enum_form_string !== null) { - $formParams['enum_form_string'] = ObjectSerializer::toFormValue( - $enum_form_string - ); + $formParams['enum_form_string'] = ObjectSerializer::toFormValue($enum_form_string); } // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -2764,9 +2471,7 @@ protected function testEnumParametersRequest( if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -2781,27 +2486,32 @@ protected function testEnumParametersRequest( } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2844,11 +2554,7 @@ public function testGroupParameters($associative_array) */ public function testGroupParametersWithHttpInfo($associative_array) { - $request = $this->testGroupParametersRequest( - $associative_array['string_group'], - $associative_array['boolean_group'], - $associative_array['int64_group'] - ); + $request = $this->testGroupParametersRequest($associative_array['string_group'], $associative_array['boolean_group'], $associative_array['int64_group']); try { $options = $this->createHttpClientOption(); @@ -2859,12 +2565,7 @@ public function testGroupParametersWithHttpInfo($associative_array) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -2884,6 +2585,7 @@ public function testGroupParametersWithHttpInfo($associative_array) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -2907,11 +2609,12 @@ public function testGroupParametersWithHttpInfo($associative_array) */ public function testGroupParametersAsync($associative_array) { - return $this->testGroupParametersAsyncWithHttpInfo( - $associative_array - )->then(function ($response) { - return $response[0]; - }); + return $this->testGroupParametersAsyncWithHttpInfo($associative_array) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -2937,11 +2640,7 @@ public function testGroupParametersAsyncWithHttpInfo($associative_array) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -2975,15 +2674,10 @@ function ($exception) { protected function testGroupParametersRequest($associative_array) { // unbox the parameters from the associative array - $string_group = array_key_exists('string_group', $associative_array) - ? $associative_array['string_group'] - : null; - $boolean_group = array_key_exists('boolean_group', $associative_array) - ? $associative_array['boolean_group'] - : null; - $int64_group = array_key_exists('int64_group', $associative_array) - ? $associative_array['int64_group'] - : null; + $string_group = array_key_exists('string_group', $associative_array) ? $associative_array['string_group'] : null; + $boolean_group = array_key_exists('boolean_group', $associative_array) ? $associative_array['boolean_group'] : null; + $int64_group = array_key_exists('int64_group', $associative_array) ? $associative_array['int64_group'] : null; + $resourcePath = '/fake'; $formParams = []; @@ -2994,39 +2688,37 @@ protected function testGroupParametersRequest($associative_array) // query params if ($string_group !== null) { - $queryParams['string_group'] = ObjectSerializer::toQueryValue( - $string_group - ); + $queryParams['string_group'] = ObjectSerializer::toQueryValue($string_group); } // query params if ($int64_group !== null) { - $queryParams['int64_group'] = ObjectSerializer::toQueryValue( - $int64_group - ); + $queryParams['int64_group'] = ObjectSerializer::toQueryValue($int64_group); } // header params if ($boolean_group !== null) { - $headerParams['boolean_group'] = ObjectSerializer::toHeaderValue( - $boolean_group - ); + $headerParams['boolean_group'] = ObjectSerializer::toHeaderValue($boolean_group); } + // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -3041,27 +2733,32 @@ protected function testGroupParametersRequest($associative_array) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3107,12 +2804,7 @@ public function testInlineAdditionalPropertiesWithHttpInfo($request_body) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -3132,6 +2824,7 @@ public function testInlineAdditionalPropertiesWithHttpInfo($request_body) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -3151,11 +2844,12 @@ public function testInlineAdditionalPropertiesWithHttpInfo($request_body) */ public function testInlineAdditionalPropertiesAsync($request_body) { - return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo( - $request_body - )->then(function ($response) { - return $response[0]; - }); + return $this->testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -3168,9 +2862,8 @@ public function testInlineAdditionalPropertiesAsync($request_body) * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function testInlineAdditionalPropertiesAsyncWithHttpInfo( - $request_body - ) { + public function testInlineAdditionalPropertiesAsyncWithHttpInfo($request_body) + { $returnType = ''; $request = $this->testInlineAdditionalPropertiesRequest($request_body); @@ -3178,11 +2871,7 @@ public function testInlineAdditionalPropertiesAsyncWithHttpInfo( ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -3212,10 +2901,7 @@ function ($exception) { protected function testInlineAdditionalPropertiesRequest($request_body) { // verify the required parameter 'request_body' is set - if ( - $request_body === null || - (is_array($request_body) && count($request_body) === 0) - ) { + if ($request_body === null || (is_array($request_body) && count($request_body) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $request_body when calling testInlineAdditionalProperties' ); @@ -3228,6 +2914,8 @@ protected function testInlineAdditionalPropertiesRequest($request_body) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($request_body)) { @@ -3235,7 +2923,9 @@ protected function testInlineAdditionalPropertiesRequest($request_body) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -3247,9 +2937,7 @@ protected function testInlineAdditionalPropertiesRequest($request_body) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -3264,27 +2952,32 @@ protected function testInlineAdditionalPropertiesRequest($request_body) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3332,12 +3025,7 @@ public function testJsonFormDataWithHttpInfo($param, $param2) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -3357,6 +3045,7 @@ public function testJsonFormDataWithHttpInfo($param, $param2) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -3377,11 +3066,12 @@ public function testJsonFormDataWithHttpInfo($param, $param2) */ public function testJsonFormDataAsync($param, $param2) { - return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2)->then( - function ($response) { - return $response[0]; - } - ); + return $this->testJsonFormDataAsyncWithHttpInfo($param, $param2) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -3404,11 +3094,7 @@ public function testJsonFormDataAsyncWithHttpInfo($param, $param2) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -3458,6 +3144,8 @@ protected function testJsonFormDataRequest($param, $param2) $httpBody = ''; $multipart = false; + + // form params if ($param !== null) { $formParams['param'] = ObjectSerializer::toFormValue($param); @@ -3470,7 +3158,9 @@ protected function testJsonFormDataRequest($param, $param2) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -3482,9 +3172,7 @@ protected function testJsonFormDataRequest($param, $param2) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -3499,27 +3187,32 @@ protected function testJsonFormDataRequest($param, $param2) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -3535,15 +3228,9 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen( - $this->config->getDebugFile(), - 'a' - ); + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException( - 'Failed to open the debug file: ' . - $this->config->getDebugFile() - ); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } 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 6292f96df712..b2aad6252e2f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -128,12 +128,7 @@ public function testClassnameWithHttpInfo($client) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -153,7 +148,7 @@ public function testClassnameWithHttpInfo($client) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Client' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -162,11 +157,7 @@ public function testClassnameWithHttpInfo($client) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\Client', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Client', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -185,6 +176,7 @@ public function testClassnameWithHttpInfo($client) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -212,11 +204,12 @@ public function testClassnameWithHttpInfo($client) */ public function testClassnameAsync($client) { - return $this->testClassnameAsyncWithHttpInfo($client)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->testClassnameAsyncWithHttpInfo($client) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -246,11 +239,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -296,6 +285,8 @@ protected function testClassnameRequest($client) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($client)) { @@ -303,9 +294,9 @@ protected function testClassnameRequest($client) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -317,9 +308,7 @@ protected function testClassnameRequest($client) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -334,8 +323,10 @@ protected function testClassnameRequest($client) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -353,14 +344,16 @@ protected function testClassnameRequest($client) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -376,15 +369,9 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen( - $this->config->getDebugFile(), - 'a' - ); + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException( - 'Failed to open the debug file: ' . - $this->config->getDebugFile() - ); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } 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 8340dae7a03e..b3f8a732f13a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -127,12 +127,7 @@ public function addPetWithHttpInfo($pet) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -152,6 +147,7 @@ public function addPetWithHttpInfo($pet) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -171,9 +167,12 @@ public function addPetWithHttpInfo($pet) */ public function addPetAsync($pet) { - return $this->addPetAsyncWithHttpInfo($pet)->then(function ($response) { - return $response[0]; - }); + return $this->addPetAsyncWithHttpInfo($pet) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -195,11 +194,7 @@ public function addPetAsyncWithHttpInfo($pet) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -242,6 +237,8 @@ protected function addPetRequest($pet) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($pet)) { @@ -249,7 +246,9 @@ protected function addPetRequest($pet) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -261,9 +260,7 @@ protected function addPetRequest($pet) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -278,8 +275,10 @@ protected function addPetRequest($pet) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -288,8 +287,7 @@ protected function addPetRequest($pet) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = - 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -297,14 +295,16 @@ protected function addPetRequest($pet) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -352,12 +352,7 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -377,6 +372,7 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -397,11 +393,12 @@ public function deletePetWithHttpInfo($pet_id, $api_key = null) */ public function deletePetAsync($pet_id, $api_key = null) { - return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key)->then( - function ($response) { - return $response[0]; - } - ); + return $this->deletePetAsyncWithHttpInfo($pet_id, $api_key) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -424,11 +421,7 @@ public function deletePetAsyncWithHttpInfo($pet_id, $api_key = null) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -474,9 +467,7 @@ protected function deletePetRequest($pet_id, $api_key = null) // header params if ($api_key !== null) { - $headerParams['api_key'] = ObjectSerializer::toHeaderValue( - $api_key - ); + $headerParams['api_key'] = ObjectSerializer::toHeaderValue($api_key); } // path params @@ -492,18 +483,21 @@ protected function deletePetRequest($pet_id, $api_key = null) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -518,8 +512,10 @@ protected function deletePetRequest($pet_id, $api_key = null) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -528,8 +524,7 @@ protected function deletePetRequest($pet_id, $api_key = null) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = - 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -537,14 +532,16 @@ protected function deletePetRequest($pet_id, $api_key = null) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -591,12 +588,7 @@ public function findPetsByStatusWithHttpInfo($status) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -616,7 +608,7 @@ public function findPetsByStatusWithHttpInfo($status) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -625,11 +617,7 @@ public function findPetsByStatusWithHttpInfo($status) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\Pet[]', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -648,6 +636,7 @@ public function findPetsByStatusWithHttpInfo($status) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -675,11 +664,12 @@ public function findPetsByStatusWithHttpInfo($status) */ public function findPetsByStatusAsync($status) { - return $this->findPetsByStatusAsyncWithHttpInfo($status)->then( - function ($response) { - return $response[0]; - } - ); + return $this->findPetsByStatusAsyncWithHttpInfo($status) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -709,11 +699,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -761,24 +747,20 @@ protected function findPetsByStatusRequest($status) // query params if (is_array($status)) { - $status = ObjectSerializer::serializeCollection( - $status, - 'csv', - true - ); + $status = ObjectSerializer::serializeCollection($status, 'csv', true); } if ($status !== null) { $queryParams['status'] = ObjectSerializer::toQueryValue($status); } + // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/xml', 'application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -790,9 +772,7 @@ protected function findPetsByStatusRequest($status) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -807,8 +787,10 @@ protected function findPetsByStatusRequest($status) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -817,8 +799,7 @@ protected function findPetsByStatusRequest($status) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = - 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -826,14 +807,16 @@ protected function findPetsByStatusRequest($status) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -880,12 +863,7 @@ public function findPetsByTagsWithHttpInfo($tags) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -905,7 +883,7 @@ public function findPetsByTagsWithHttpInfo($tags) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Pet[]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -914,11 +892,7 @@ public function findPetsByTagsWithHttpInfo($tags) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\Pet[]', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet[]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -937,6 +911,7 @@ public function findPetsByTagsWithHttpInfo($tags) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -964,11 +939,12 @@ public function findPetsByTagsWithHttpInfo($tags) */ public function findPetsByTagsAsync($tags) { - return $this->findPetsByTagsAsyncWithHttpInfo($tags)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->findPetsByTagsAsyncWithHttpInfo($tags) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -998,11 +974,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1056,14 +1028,14 @@ protected function findPetsByTagsRequest($tags) $queryParams['tags'] = ObjectSerializer::toQueryValue($tags); } + // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/xml', 'application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1075,9 +1047,7 @@ protected function findPetsByTagsRequest($tags) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1092,8 +1062,10 @@ protected function findPetsByTagsRequest($tags) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -1102,8 +1074,7 @@ protected function findPetsByTagsRequest($tags) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = - 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -1111,14 +1082,16 @@ protected function findPetsByTagsRequest($tags) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1165,12 +1138,7 @@ public function getPetByIdWithHttpInfo($pet_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1190,7 +1158,7 @@ public function getPetByIdWithHttpInfo($pet_id) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Pet' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1199,11 +1167,7 @@ public function getPetByIdWithHttpInfo($pet_id) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\Pet', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Pet', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1222,6 +1186,7 @@ public function getPetByIdWithHttpInfo($pet_id) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1249,11 +1214,12 @@ public function getPetByIdWithHttpInfo($pet_id) */ public function getPetByIdAsync($pet_id) { - return $this->getPetByIdAsyncWithHttpInfo($pet_id)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->getPetByIdAsyncWithHttpInfo($pet_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1283,11 +1249,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1333,6 +1295,7 @@ protected function getPetByIdRequest($pet_id) $httpBody = ''; $multipart = false; + // path params if ($pet_id !== null) { $resourcePath = str_replace( @@ -1346,10 +1309,9 @@ protected function getPetByIdRequest($pet_id) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/xml', 'application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1361,9 +1323,7 @@ protected function getPetByIdRequest($pet_id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1378,8 +1338,10 @@ protected function getPetByIdRequest($pet_id) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -1397,14 +1359,16 @@ protected function getPetByIdRequest($pet_id) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1450,12 +1414,7 @@ public function updatePetWithHttpInfo($pet) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1475,6 +1434,7 @@ public function updatePetWithHttpInfo($pet) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1494,11 +1454,12 @@ public function updatePetWithHttpInfo($pet) */ public function updatePetAsync($pet) { - return $this->updatePetAsyncWithHttpInfo($pet)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->updatePetAsyncWithHttpInfo($pet) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1520,11 +1481,7 @@ public function updatePetAsyncWithHttpInfo($pet) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1567,6 +1524,8 @@ protected function updatePetRequest($pet) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($pet)) { @@ -1574,7 +1533,9 @@ protected function updatePetRequest($pet) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -1586,9 +1547,7 @@ protected function updatePetRequest($pet) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1603,8 +1562,10 @@ protected function updatePetRequest($pet) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -1613,8 +1574,7 @@ protected function updatePetRequest($pet) // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = - 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -1622,14 +1582,16 @@ protected function updatePetRequest($pet) $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1666,11 +1628,8 @@ public function updatePetWithForm($pet_id, $name = null, $status = null) * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function updatePetWithFormWithHttpInfo( - $pet_id, - $name = null, - $status = null - ) { + public function updatePetWithFormWithHttpInfo($pet_id, $name = null, $status = null) + { $request = $this->updatePetWithFormRequest($pet_id, $name, $status); try { @@ -1682,12 +1641,7 @@ public function updatePetWithFormWithHttpInfo( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1707,6 +1661,7 @@ public function updatePetWithFormWithHttpInfo( } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1726,18 +1681,14 @@ public function updatePetWithFormWithHttpInfo( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetWithFormAsync( - $pet_id, - $name = null, - $status = null - ) { - return $this->updatePetWithFormAsyncWithHttpInfo( - $pet_id, - $name, - $status - )->then(function ($response) { - return $response[0]; - }); + public function updatePetWithFormAsync($pet_id, $name = null, $status = null) + { + return $this->updatePetWithFormAsyncWithHttpInfo($pet_id, $name, $status) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1752,11 +1703,8 @@ public function updatePetWithFormAsync( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updatePetWithFormAsyncWithHttpInfo( - $pet_id, - $name = null, - $status = null - ) { + public function updatePetWithFormAsyncWithHttpInfo($pet_id, $name = null, $status = null) + { $returnType = ''; $request = $this->updatePetWithFormRequest($pet_id, $name, $status); @@ -1764,11 +1712,7 @@ public function updatePetWithFormAsyncWithHttpInfo( ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1797,11 +1741,8 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function updatePetWithFormRequest( - $pet_id, - $name = null, - $status = null - ) { + protected function updatePetWithFormRequest($pet_id, $name = null, $status = null) + { // verify the required parameter 'pet_id' is set if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { throw new \InvalidArgumentException( @@ -1816,6 +1757,7 @@ protected function updatePetWithFormRequest( $httpBody = ''; $multipart = false; + // path params if ($pet_id !== null) { $resourcePath = str_replace( @@ -1837,7 +1779,9 @@ protected function updatePetWithFormRequest( $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { $headers = $this->headerSelector->selectHeaders( [], @@ -1849,9 +1793,7 @@ protected function updatePetWithFormRequest( if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1866,8 +1808,10 @@ protected function updatePetWithFormRequest( } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -1876,8 +1820,7 @@ protected function updatePetWithFormRequest( // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = - 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -1885,14 +1828,16 @@ protected function updatePetWithFormRequest( $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1911,16 +1856,9 @@ protected function updatePetWithFormRequest( * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ApiResponse */ - public function uploadFile( - $pet_id, - $additional_metadata = null, - $file = null - ) { - list($response) = $this->uploadFileWithHttpInfo( - $pet_id, - $additional_metadata, - $file - ); + public function uploadFile($pet_id, $additional_metadata = null, $file = null) + { + list($response) = $this->uploadFileWithHttpInfo($pet_id, $additional_metadata, $file); return $response; } @@ -1937,16 +1875,9 @@ public function uploadFile( * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithHttpInfo( - $pet_id, - $additional_metadata = null, - $file = null - ) { - $request = $this->uploadFileRequest( - $pet_id, - $additional_metadata, - $file - ); + public function uploadFileWithHttpInfo($pet_id, $additional_metadata = null, $file = null) + { + $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); try { $options = $this->createHttpClientOption(); @@ -1957,12 +1888,7 @@ public function uploadFileWithHttpInfo( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1982,22 +1908,16 @@ public function uploadFileWithHttpInfo( } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: - if ( - '\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject' - ) { + if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\ApiResponse', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2016,6 +1936,7 @@ public function uploadFileWithHttpInfo( $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2043,18 +1964,14 @@ public function uploadFileWithHttpInfo( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsync( - $pet_id, - $additional_metadata = null, - $file = null - ) { - return $this->uploadFileAsyncWithHttpInfo( - $pet_id, - $additional_metadata, - $file - )->then(function ($response) { - return $response[0]; - }); + public function uploadFileAsync($pet_id, $additional_metadata = null, $file = null) + { + return $this->uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata, $file) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -2069,17 +1986,10 @@ public function uploadFileAsync( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileAsyncWithHttpInfo( - $pet_id, - $additional_metadata = null, - $file = null - ) { + public function uploadFileAsyncWithHttpInfo($pet_id, $additional_metadata = null, $file = null) + { $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileRequest( - $pet_id, - $additional_metadata, - $file - ); + $request = $this->uploadFileRequest($pet_id, $additional_metadata, $file); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2093,11 +2003,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2129,11 +2035,8 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function uploadFileRequest( - $pet_id, - $additional_metadata = null, - $file = null - ) { + protected function uploadFileRequest($pet_id, $additional_metadata = null, $file = null) + { // verify the required parameter 'pet_id' is set if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { throw new \InvalidArgumentException( @@ -2148,6 +2051,7 @@ protected function uploadFileRequest( $httpBody = ''; $multipart = false; + // path params if ($pet_id !== null) { $resourcePath = str_replace( @@ -2159,25 +2063,20 @@ protected function uploadFileRequest( // form params if ($additional_metadata !== null) { - $formParams['additionalMetadata'] = ObjectSerializer::toFormValue( - $additional_metadata - ); + $formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata); } // form params if ($file !== null) { $multipart = true; - $formParams['file'] = \GuzzleHttp\Psr7\try_fopen( - ObjectSerializer::toFormValue($file), - 'rb' - ); + $formParams['file'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($file), 'rb'); } // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -2189,9 +2088,7 @@ protected function uploadFileRequest( if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -2206,8 +2103,10 @@ protected function uploadFileRequest( } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -2216,8 +2115,7 @@ protected function uploadFileRequest( // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = - 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -2225,14 +2123,16 @@ protected function uploadFileRequest( $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2251,16 +2151,9 @@ protected function uploadFileRequest( * @throws \InvalidArgumentException * @return \OpenAPI\Client\Model\ApiResponse */ - public function uploadFileWithRequiredFile( - $pet_id, - $required_file, - $additional_metadata = null - ) { - list($response) = $this->uploadFileWithRequiredFileWithHttpInfo( - $pet_id, - $required_file, - $additional_metadata - ); + public function uploadFileWithRequiredFile($pet_id, $required_file, $additional_metadata = null) + { + list($response) = $this->uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata); return $response; } @@ -2277,16 +2170,9 @@ public function uploadFileWithRequiredFile( * @throws \InvalidArgumentException * @return array of \OpenAPI\Client\Model\ApiResponse, HTTP status code, HTTP response headers (array of strings) */ - public function uploadFileWithRequiredFileWithHttpInfo( - $pet_id, - $required_file, - $additional_metadata = null - ) { - $request = $this->uploadFileWithRequiredFileRequest( - $pet_id, - $required_file, - $additional_metadata - ); + public function uploadFileWithRequiredFileWithHttpInfo($pet_id, $required_file, $additional_metadata = null) + { + $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); try { $options = $this->createHttpClientOption(); @@ -2297,12 +2183,7 @@ public function uploadFileWithRequiredFileWithHttpInfo( "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -2322,22 +2203,16 @@ public function uploadFileWithRequiredFileWithHttpInfo( } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: - if ( - '\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject' - ) { + if ('\OpenAPI\Client\Model\ApiResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = $responseBody->getContents(); } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\ApiResponse', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\ApiResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2356,6 +2231,7 @@ public function uploadFileWithRequiredFileWithHttpInfo( $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2383,18 +2259,14 @@ public function uploadFileWithRequiredFileWithHttpInfo( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsync( - $pet_id, - $required_file, - $additional_metadata = null - ) { - return $this->uploadFileWithRequiredFileAsyncWithHttpInfo( - $pet_id, - $required_file, - $additional_metadata - )->then(function ($response) { - return $response[0]; - }); + public function uploadFileWithRequiredFileAsync($pet_id, $required_file, $additional_metadata = null) + { + return $this->uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -2409,17 +2281,10 @@ public function uploadFileWithRequiredFileAsync( * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function uploadFileWithRequiredFileAsyncWithHttpInfo( - $pet_id, - $required_file, - $additional_metadata = null - ) { + public function uploadFileWithRequiredFileAsyncWithHttpInfo($pet_id, $required_file, $additional_metadata = null) + { $returnType = '\OpenAPI\Client\Model\ApiResponse'; - $request = $this->uploadFileWithRequiredFileRequest( - $pet_id, - $required_file, - $additional_metadata - ); + $request = $this->uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2433,11 +2298,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2469,11 +2330,8 @@ function ($exception) { * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function uploadFileWithRequiredFileRequest( - $pet_id, - $required_file, - $additional_metadata = null - ) { + protected function uploadFileWithRequiredFileRequest($pet_id, $required_file, $additional_metadata = null) + { // verify the required parameter 'pet_id' is set if ($pet_id === null || (is_array($pet_id) && count($pet_id) === 0)) { throw new \InvalidArgumentException( @@ -2481,10 +2339,7 @@ protected function uploadFileWithRequiredFileRequest( ); } // verify the required parameter 'required_file' is set - if ( - $required_file === null || - (is_array($required_file) && count($required_file) === 0) - ) { + if ($required_file === null || (is_array($required_file) && count($required_file) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $required_file when calling uploadFileWithRequiredFile' ); @@ -2497,6 +2352,7 @@ protected function uploadFileWithRequiredFileRequest( $httpBody = ''; $multipart = false; + // path params if ($pet_id !== null) { $resourcePath = str_replace( @@ -2508,25 +2364,20 @@ protected function uploadFileWithRequiredFileRequest( // form params if ($additional_metadata !== null) { - $formParams['additionalMetadata'] = ObjectSerializer::toFormValue( - $additional_metadata - ); + $formParams['additionalMetadata'] = ObjectSerializer::toFormValue($additional_metadata); } // form params if ($required_file !== null) { $multipart = true; - $formParams['requiredFile'] = \GuzzleHttp\Psr7\try_fopen( - ObjectSerializer::toFormValue($required_file), - 'rb' - ); + $formParams['requiredFile'] = \GuzzleHttp\Psr7\try_fopen(ObjectSerializer::toFormValue($required_file), 'rb'); } // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -2538,9 +2389,7 @@ protected function uploadFileWithRequiredFileRequest( if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -2555,8 +2404,10 @@ protected function uploadFileWithRequiredFileRequest( } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -2565,8 +2416,7 @@ protected function uploadFileWithRequiredFileRequest( // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { - $headers['Authorization'] = - 'Bearer ' . $this->config->getAccessToken(); + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; @@ -2574,14 +2424,16 @@ protected function uploadFileWithRequiredFileRequest( $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -2597,15 +2449,9 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen( - $this->config->getDebugFile(), - 'a' - ); + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException( - 'Failed to open the debug file: ' . - $this->config->getDebugFile() - ); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } 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 7b5ca8297882..9ea52b83e66e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -127,12 +127,7 @@ public function deleteOrderWithHttpInfo($order_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -152,6 +147,7 @@ public function deleteOrderWithHttpInfo($order_id) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -171,11 +167,12 @@ public function deleteOrderWithHttpInfo($order_id) */ public function deleteOrderAsync($order_id) { - return $this->deleteOrderAsyncWithHttpInfo($order_id)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->deleteOrderAsyncWithHttpInfo($order_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -197,11 +194,7 @@ public function deleteOrderAsyncWithHttpInfo($order_id) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -231,10 +224,7 @@ function ($exception) { protected function deleteOrderRequest($order_id) { // verify the required parameter 'order_id' is set - if ( - $order_id === null || - (is_array($order_id) && count($order_id) === 0) - ) { + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $order_id when calling deleteOrder' ); @@ -247,6 +237,7 @@ protected function deleteOrderRequest($order_id) $httpBody = ''; $multipart = false; + // path params if ($order_id !== null) { $resourcePath = str_replace( @@ -260,18 +251,21 @@ protected function deleteOrderRequest($order_id) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -286,27 +280,32 @@ protected function deleteOrderRequest($order_id) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -351,12 +350,7 @@ public function getInventoryWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -376,7 +370,7 @@ public function getInventoryWithHttpInfo() } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('map[string,int]' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -385,11 +379,7 @@ public function getInventoryWithHttpInfo() } return [ - ObjectSerializer::deserialize( - $content, - 'map[string,int]', - [] - ), + ObjectSerializer::deserialize($content, 'map[string,int]', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -408,6 +398,7 @@ public function getInventoryWithHttpInfo() $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -434,11 +425,12 @@ public function getInventoryWithHttpInfo() */ public function getInventoryAsync() { - return $this->getInventoryAsyncWithHttpInfo()->then(function ( - $response - ) { - return $response[0]; - }); + return $this->getInventoryAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -467,11 +459,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -502,6 +490,7 @@ function ($exception) { */ protected function getInventoryRequest() { + $resourcePath = '/store/inventory'; $formParams = []; $queryParams = []; @@ -509,13 +498,15 @@ protected function getInventoryRequest() $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], @@ -527,9 +518,7 @@ protected function getInventoryRequest() if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -544,8 +533,10 @@ protected function getInventoryRequest() } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); @@ -563,14 +554,16 @@ protected function getInventoryRequest() $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -617,12 +610,7 @@ public function getOrderByIdWithHttpInfo($order_id) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -642,7 +630,7 @@ public function getOrderByIdWithHttpInfo($order_id) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -651,11 +639,7 @@ public function getOrderByIdWithHttpInfo($order_id) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\Order', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -674,6 +658,7 @@ public function getOrderByIdWithHttpInfo($order_id) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -701,11 +686,12 @@ public function getOrderByIdWithHttpInfo($order_id) */ public function getOrderByIdAsync($order_id) { - return $this->getOrderByIdAsyncWithHttpInfo($order_id)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->getOrderByIdAsyncWithHttpInfo($order_id) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -735,11 +721,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -772,25 +754,19 @@ function ($exception) { protected function getOrderByIdRequest($order_id) { // verify the required parameter 'order_id' is set - if ( - $order_id === null || - (is_array($order_id) && count($order_id) === 0) - ) { + if ($order_id === null || (is_array($order_id) && count($order_id) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $order_id when calling getOrderById' ); } if ($order_id > 5) { - throw new \InvalidArgumentException( - 'invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.' - ); + throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be smaller than or equal to 5.'); } if ($order_id < 1) { - throw new \InvalidArgumentException( - 'invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.' - ); + throw new \InvalidArgumentException('invalid value for "$order_id" when calling StoreApi.getOrderById, must be bigger than or equal to 1.'); } + $resourcePath = '/store/order/{order_id}'; $formParams = []; $queryParams = []; @@ -798,6 +774,7 @@ protected function getOrderByIdRequest($order_id) $httpBody = ''; $multipart = false; + // path params if ($order_id !== null) { $resourcePath = str_replace( @@ -811,10 +788,9 @@ protected function getOrderByIdRequest($order_id) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/xml', 'application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -826,9 +802,7 @@ protected function getOrderByIdRequest($order_id) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -843,27 +817,32 @@ protected function getOrderByIdRequest($order_id) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -910,12 +889,7 @@ public function placeOrderWithHttpInfo($order) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -935,7 +909,7 @@ public function placeOrderWithHttpInfo($order) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\Order' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -944,11 +918,7 @@ public function placeOrderWithHttpInfo($order) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\Order', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\Order', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -967,6 +937,7 @@ public function placeOrderWithHttpInfo($order) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -994,11 +965,12 @@ public function placeOrderWithHttpInfo($order) */ public function placeOrderAsync($order) { - return $this->placeOrderAsyncWithHttpInfo($order)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->placeOrderAsyncWithHttpInfo($order) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1028,11 +1000,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1078,6 +1046,8 @@ protected function placeOrderRequest($order) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($order)) { @@ -1085,10 +1055,9 @@ protected function placeOrderRequest($order) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/xml', 'application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1100,9 +1069,7 @@ protected function placeOrderRequest($order) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1117,27 +1084,32 @@ protected function placeOrderRequest($order) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1153,15 +1125,9 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen( - $this->config->getDebugFile(), - 'a' - ); + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException( - 'Failed to open the debug file: ' . - $this->config->getDebugFile() - ); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } 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 59856b4ba066..35d836300502 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -127,12 +127,7 @@ public function createUserWithHttpInfo($user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -152,6 +147,7 @@ public function createUserWithHttpInfo($user) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -171,11 +167,12 @@ public function createUserWithHttpInfo($user) */ public function createUserAsync($user) { - return $this->createUserAsyncWithHttpInfo($user)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->createUserAsyncWithHttpInfo($user) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -197,11 +194,7 @@ public function createUserAsyncWithHttpInfo($user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -244,6 +237,8 @@ protected function createUserRequest($user) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($user)) { @@ -251,18 +246,21 @@ protected function createUserRequest($user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -277,27 +275,32 @@ protected function createUserRequest($user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -343,12 +346,7 @@ public function createUsersWithArrayInputWithHttpInfo($user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -368,6 +366,7 @@ public function createUsersWithArrayInputWithHttpInfo($user) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -387,11 +386,12 @@ public function createUsersWithArrayInputWithHttpInfo($user) */ public function createUsersWithArrayInputAsync($user) { - return $this->createUsersWithArrayInputAsyncWithHttpInfo($user)->then( - function ($response) { - return $response[0]; - } - ); + return $this->createUsersWithArrayInputAsyncWithHttpInfo($user) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -413,11 +413,7 @@ public function createUsersWithArrayInputAsyncWithHttpInfo($user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -460,6 +456,8 @@ protected function createUsersWithArrayInputRequest($user) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($user)) { @@ -467,18 +465,21 @@ protected function createUsersWithArrayInputRequest($user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -493,27 +494,32 @@ protected function createUsersWithArrayInputRequest($user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -559,12 +565,7 @@ public function createUsersWithListInputWithHttpInfo($user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -584,6 +585,7 @@ public function createUsersWithListInputWithHttpInfo($user) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -603,11 +605,12 @@ public function createUsersWithListInputWithHttpInfo($user) */ public function createUsersWithListInputAsync($user) { - return $this->createUsersWithListInputAsyncWithHttpInfo($user)->then( - function ($response) { - return $response[0]; - } - ); + return $this->createUsersWithListInputAsyncWithHttpInfo($user) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -629,11 +632,7 @@ public function createUsersWithListInputAsyncWithHttpInfo($user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -676,6 +675,8 @@ protected function createUsersWithListInputRequest($user) $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if (isset($user)) { @@ -683,18 +684,21 @@ protected function createUsersWithListInputRequest($user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -709,27 +713,32 @@ protected function createUsersWithListInputRequest($user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -775,12 +784,7 @@ public function deleteUserWithHttpInfo($username) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -800,6 +804,7 @@ public function deleteUserWithHttpInfo($username) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -819,11 +824,12 @@ public function deleteUserWithHttpInfo($username) */ public function deleteUserAsync($username) { - return $this->deleteUserAsyncWithHttpInfo($username)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->deleteUserAsyncWithHttpInfo($username) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -845,11 +851,7 @@ public function deleteUserAsyncWithHttpInfo($username) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -879,10 +881,7 @@ function ($exception) { protected function deleteUserRequest($username) { // verify the required parameter 'username' is set - if ( - $username === null || - (is_array($username) && count($username) === 0) - ) { + if ($username === null || (is_array($username) && count($username) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $username when calling deleteUser' ); @@ -895,6 +894,7 @@ protected function deleteUserRequest($username) $httpBody = ''; $multipart = false; + // path params if ($username !== null) { $resourcePath = str_replace( @@ -908,18 +908,21 @@ protected function deleteUserRequest($username) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -934,27 +937,32 @@ protected function deleteUserRequest($username) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'DELETE', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1001,12 +1009,7 @@ public function getUserByNameWithHttpInfo($username) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1026,7 +1029,7 @@ public function getUserByNameWithHttpInfo($username) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('\OpenAPI\Client\Model\User' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1035,11 +1038,7 @@ public function getUserByNameWithHttpInfo($username) } return [ - ObjectSerializer::deserialize( - $content, - '\OpenAPI\Client\Model\User', - [] - ), + ObjectSerializer::deserialize($content, '\OpenAPI\Client\Model\User', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1058,6 +1057,7 @@ public function getUserByNameWithHttpInfo($username) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1085,11 +1085,12 @@ public function getUserByNameWithHttpInfo($username) */ public function getUserByNameAsync($username) { - return $this->getUserByNameAsyncWithHttpInfo($username)->then(function ( - $response - ) { - return $response[0]; - }); + return $this->getUserByNameAsyncWithHttpInfo($username) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1119,11 +1120,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1156,10 +1153,7 @@ function ($exception) { protected function getUserByNameRequest($username) { // verify the required parameter 'username' is set - if ( - $username === null || - (is_array($username) && count($username) === 0) - ) { + if ($username === null || (is_array($username) && count($username) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $username when calling getUserByName' ); @@ -1172,6 +1166,7 @@ protected function getUserByNameRequest($username) $httpBody = ''; $multipart = false; + // path params if ($username !== null) { $resourcePath = str_replace( @@ -1185,10 +1180,9 @@ protected function getUserByNameRequest($username) $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/xml', 'application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1200,9 +1194,7 @@ protected function getUserByNameRequest($username) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1217,27 +1209,32 @@ protected function getUserByNameRequest($username) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1286,12 +1283,7 @@ public function loginUserWithHttpInfo($username, $password) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1311,7 +1303,7 @@ public function loginUserWithHttpInfo($username, $password) } $responseBody = $response->getBody(); - switch ($statusCode) { + switch($statusCode) { case 200: if ('string' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1339,6 +1331,7 @@ public function loginUserWithHttpInfo($username, $password) $response->getStatusCode(), $response->getHeaders() ]; + } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1367,11 +1360,12 @@ public function loginUserWithHttpInfo($username, $password) */ public function loginUserAsync($username, $password) { - return $this->loginUserAsyncWithHttpInfo($username, $password)->then( - function ($response) { - return $response[0]; - } - ); + return $this->loginUserAsyncWithHttpInfo($username, $password) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1402,11 +1396,7 @@ function ($response) use ($returnType) { } return [ - ObjectSerializer::deserialize( - $content, - $returnType, - [] - ), + ObjectSerializer::deserialize($content, $returnType, []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1440,19 +1430,13 @@ function ($exception) { protected function loginUserRequest($username, $password) { // verify the required parameter 'username' is set - if ( - $username === null || - (is_array($username) && count($username) === 0) - ) { + if ($username === null || (is_array($username) && count($username) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $username when calling loginUser' ); } // verify the required parameter 'password' is set - if ( - $password === null || - (is_array($password) && count($password) === 0) - ) { + if ($password === null || (is_array($password) && count($password) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $password when calling loginUser' ); @@ -1467,25 +1451,21 @@ protected function loginUserRequest($username, $password) // query params if ($username !== null) { - $queryParams['username'] = ObjectSerializer::toQueryValue( - $username - ); + $queryParams['username'] = ObjectSerializer::toQueryValue($username); } // query params if ($password !== null) { - $queryParams['password'] = ObjectSerializer::toQueryValue( - $password - ); + $queryParams['password'] = ObjectSerializer::toQueryValue($password); } + // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([ - 'application/xml', - 'application/json' - ]); + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/xml', 'application/json'] + ); } else { $headers = $this->headerSelector->selectHeaders( ['application/xml', 'application/json'], @@ -1497,9 +1477,7 @@ protected function loginUserRequest($username, $password) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1514,27 +1492,32 @@ protected function loginUserRequest($username, $password) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1578,12 +1561,7 @@ public function logoutUserWithHttpInfo() "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1603,6 +1581,7 @@ public function logoutUserWithHttpInfo() } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1621,9 +1600,12 @@ public function logoutUserWithHttpInfo() */ public function logoutUserAsync() { - return $this->logoutUserAsyncWithHttpInfo()->then(function ($response) { - return $response[0]; - }); + return $this->logoutUserAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1644,11 +1626,7 @@ public function logoutUserAsyncWithHttpInfo() ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1676,6 +1654,7 @@ function ($exception) { */ protected function logoutUserRequest() { + $resourcePath = '/user/logout'; $formParams = []; $queryParams = []; @@ -1683,22 +1662,27 @@ protected function logoutUserRequest() $httpBody = ''; $multipart = false; + + // body params $_tempBody = null; if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1713,27 +1697,32 @@ protected function logoutUserRequest() } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'GET', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1781,12 +1770,7 @@ public function updateUserWithHttpInfo($username, $user) "[{$e->getCode()}] {$e->getMessage()}", $e->getCode(), $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() - ? $e - ->getResponse() - ->getBody() - ->getContents() - : null + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null ); } @@ -1806,6 +1790,7 @@ public function updateUserWithHttpInfo($username, $user) } return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1826,11 +1811,12 @@ public function updateUserWithHttpInfo($username, $user) */ public function updateUserAsync($username, $user) { - return $this->updateUserAsyncWithHttpInfo($username, $user)->then( - function ($response) { - return $response[0]; - } - ); + return $this->updateUserAsyncWithHttpInfo($username, $user) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -1853,11 +1839,7 @@ public function updateUserAsyncWithHttpInfo($username, $user) ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [ - null, - $response->getStatusCode(), - $response->getHeaders() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1888,10 +1870,7 @@ function ($exception) { protected function updateUserRequest($username, $user) { // verify the required parameter 'username' is set - if ( - $username === null || - (is_array($username) && count($username) === 0) - ) { + if ($username === null || (is_array($username) && count($username) === 0)) { throw new \InvalidArgumentException( 'Missing the required parameter $username when calling updateUser' ); @@ -1910,6 +1889,7 @@ protected function updateUserRequest($username, $user) $httpBody = ''; $multipart = false; + // path params if ($username !== null) { $resourcePath = str_replace( @@ -1926,18 +1906,21 @@ protected function updateUserRequest($username, $user) } if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart([]); + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); } else { - $headers = $this->headerSelector->selectHeaders([], []); + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode( - ObjectSerializer::sanitizeForSerialization($_tempBody) - ); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } @@ -1952,27 +1935,32 @@ protected function updateUserRequest($username, $user) } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); + } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); + } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } + $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } - $headers = array_merge($defaultHeaders, $headerParams, $headers); + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PUT', - $this->config->getHost() . - $resourcePath . - ($query ? "?{$query}" : ''), + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); @@ -1988,15 +1976,9 @@ protected function createHttpClientOption() { $options = []; if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen( - $this->config->getDebugFile(), - 'a' - ); + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException( - 'Failed to open the debug file: ' . - $this->config->getDebugFile() - ); + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); } } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index ceec18a56660..16e6015c73b6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ApiException extends Exception { + /** * The HTTP body of the server response either as Json or string. * @@ -69,12 +70,8 @@ class ApiException extends Exception * @param string[]|null $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 = [], - $responseBody = null - ) { + public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) + { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; $this->responseBody = $responseBody; diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 571aa4aae47d..e0ab19027502 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -142,9 +142,7 @@ public function setApiKey($apiKeyIdentifier, $key) */ public function getApiKey($apiKeyIdentifier) { - return isset($this->apiKeys[$apiKeyIdentifier]) - ? $this->apiKeys[$apiKeyIdentifier] - : null; + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; } /** @@ -170,9 +168,7 @@ public function setApiKeyPrefix($apiKeyIdentifier, $prefix) */ public function getApiKeyPrefix($apiKeyIdentifier) { - return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) - ? $this->apiKeyPrefixes[$apiKeyIdentifier] - : null; + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; } /** @@ -397,14 +393,11 @@ public static function setDefaultConfiguration(Configuration $config) */ public static function toDebugReport() { - $report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL; + $report = 'PHP SDK (OpenAPI\Client) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' OpenAPI Spec Version: 1.0.0' . PHP_EOL; - $report .= - ' Temp Folder Path: ' . - self::getDefaultConfiguration()->getTempFolderPath() . - PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; } diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 19c9ba937fe0..e401e18ab4a1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class HeaderSelector { + /** * @param string[] $accept * @param string[] $contentTypes @@ -54,9 +55,7 @@ public function selectHeaders($accept, $contentTypes) $headers['Accept'] = $accept; } - $headers['Content-Type'] = $this->selectContentTypeHeader( - $contentTypes - ); + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); return $headers; } @@ -81,10 +80,7 @@ public function selectHeadersForMultipart($accept) */ private function selectAcceptHeader($accept) { - if ( - count($accept) === 0 || - (count($accept) === 1 && $accept[0] === '') - ) { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { return null; } elseif (preg_grep("/application\/json/i", $accept)) { return 'application/json'; @@ -102,10 +98,7 @@ private function selectAcceptHeader($accept) */ private function selectContentTypeHeader($contentType) { - if ( - count($contentType) === 0 || - (count($contentType) === 1 && $contentType[0] === '') - ) { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { return 'application/json'; } elseif (preg_grep("/application\/json/i", $contentType)) { return 'application/json'; @@ -114,3 +107,4 @@ private function selectContentTypeHeader($contentType) } } } + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index eac26c4359f5..54833c0abd09 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * AdditionalPropertiesClass Class Doc Comment @@ -45,27 +45,27 @@ class AdditionalPropertiesClass implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AdditionalPropertiesClass'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'map_property' => 'map[string,string]', 'map_of_map_property' => 'map[string,map[string,string]]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'map_property' => null, 'map_of_map_property' => null @@ -163,6 +163,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -178,14 +182,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['map_property'] = isset($data['map_property']) - ? $data['map_property'] - : null; - $this->container['map_of_map_property'] = isset( - $data['map_of_map_property'] - ) - ? $data['map_of_map_property'] - : null; + $this->container['map_property'] = isset($data['map_property']) ? $data['map_property'] : null; + $this->container['map_of_map_property'] = isset($data['map_of_map_property']) ? $data['map_of_map_property'] : null; } /** @@ -211,6 +209,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets map_property * @@ -279,9 +278,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -326,3 +323,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 645e57e43934..a177ba0b3fde 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Animal Class Doc Comment @@ -45,27 +45,27 @@ class Animal implements ModelInterface, ArrayAccess const DISCRIMINATOR = 'className'; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Animal'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'class_name' => 'string', 'color' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'class_name' => null, 'color' => null @@ -163,6 +163,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -178,12 +182,8 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['class_name'] = isset($data['class_name']) - ? $data['class_name'] - : null; - $this->container['color'] = isset($data['color']) - ? $data['color'] - : 'red'; + $this->container['class_name'] = isset($data['class_name']) ? $data['class_name'] : null; + $this->container['color'] = isset($data['color']) ? $data['color'] : 'red'; // Initialize discriminator property with the model name. $discriminator = array_search('className', self::$attributeMap, true); @@ -216,6 +216,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets class_name * @@ -284,9 +285,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -331,3 +330,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php index 76c431b1b174..ef1da91249d3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AnimalFarm.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * AnimalFarm Class Doc Comment @@ -45,25 +45,29 @@ class AnimalFarm implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'AnimalFarm'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = []; + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = []; + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + + ]; /** * Array of property to type mappings. Used for (de)serialization @@ -91,21 +95,27 @@ public static function openAPIFormats() * * @var string[] */ - protected static $attributeMap = []; + protected static $attributeMap = [ + + ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ - protected static $setters = []; + protected static $setters = [ + + ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ - protected static $getters = []; + protected static $getters = [ + + ]; /** * Array of attributes where the key is the local name, @@ -148,6 +158,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -209,9 +223,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -256,3 +268,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index a614d3b5c659..b577ec608799 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * ApiResponse Class Doc Comment @@ -45,17 +45,17 @@ class ApiResponse implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ApiResponse'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'code' => 'int', 'type' => 'string', @@ -63,10 +63,10 @@ class ApiResponse implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'code' => 'int32', 'type' => null, @@ -168,6 +168,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -185,9 +189,7 @@ public function __construct(array $data = null) { $this->container['code'] = isset($data['code']) ? $data['code'] : null; $this->container['type'] = isset($data['type']) ? $data['type'] : null; - $this->container['message'] = isset($data['message']) - ? $data['message'] - : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; } /** @@ -213,6 +215,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets code * @@ -305,9 +308,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -352,3 +353,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 787fdc0ae118..72b584d5c2fc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * ArrayOfArrayOfNumberOnly Class Doc Comment @@ -45,26 +45,26 @@ class ArrayOfArrayOfNumberOnly implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ArrayOfArrayOfNumberOnly'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'array_array_number' => 'float[][]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'array_array_number' => null ]; @@ -158,6 +158,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -173,11 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['array_array_number'] = isset( - $data['array_array_number'] - ) - ? $data['array_array_number'] - : null; + $this->container['array_array_number'] = isset($data['array_array_number']) ? $data['array_array_number'] : null; } /** @@ -203,6 +203,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets array_array_number * @@ -247,9 +248,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -294,3 +293,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index a8b278b07fc7..d0a9aeb1d496 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * ArrayOfNumberOnly Class Doc Comment @@ -45,26 +45,26 @@ class ArrayOfNumberOnly implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ArrayOfNumberOnly'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'array_number' => 'float[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'array_number' => null ]; @@ -158,6 +158,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -173,9 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['array_number'] = isset($data['array_number']) - ? $data['array_number'] - : null; + $this->container['array_number'] = isset($data['array_number']) ? $data['array_number'] : null; } /** @@ -201,6 +203,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets array_number * @@ -245,9 +248,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -292,3 +293,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index e29c8ca7d320..ee79f972a4ca 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * ArrayTest Class Doc Comment @@ -45,17 +45,17 @@ class ArrayTest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ArrayTest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'array_of_string' => 'string[]', 'array_array_of_integer' => 'int[][]', @@ -63,10 +63,10 @@ class ArrayTest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'array_of_string' => null, 'array_array_of_integer' => 'int64', @@ -168,6 +168,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -183,19 +187,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['array_of_string'] = isset($data['array_of_string']) - ? $data['array_of_string'] - : null; - $this->container['array_array_of_integer'] = isset( - $data['array_array_of_integer'] - ) - ? $data['array_array_of_integer'] - : null; - $this->container['array_array_of_model'] = isset( - $data['array_array_of_model'] - ) - ? $data['array_array_of_model'] - : null; + $this->container['array_of_string'] = isset($data['array_of_string']) ? $data['array_of_string'] : null; + $this->container['array_array_of_integer'] = isset($data['array_array_of_integer']) ? $data['array_array_of_integer'] : null; + $this->container['array_array_of_model'] = isset($data['array_array_of_model']) ? $data['array_array_of_model'] : null; } /** @@ -221,6 +215,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets array_of_string * @@ -313,9 +308,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -360,3 +353,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index f57eb1428ceb..ce4ab13c1136 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Capitalization Class Doc Comment @@ -45,17 +45,17 @@ class Capitalization implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Capitalization'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'small_camel' => 'string', 'capital_camel' => 'string', @@ -66,10 +66,10 @@ class Capitalization implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'small_camel' => null, 'capital_camel' => null, @@ -183,6 +183,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -198,26 +202,12 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['small_camel'] = isset($data['small_camel']) - ? $data['small_camel'] - : null; - $this->container['capital_camel'] = isset($data['capital_camel']) - ? $data['capital_camel'] - : null; - $this->container['small_snake'] = isset($data['small_snake']) - ? $data['small_snake'] - : null; - $this->container['capital_snake'] = isset($data['capital_snake']) - ? $data['capital_snake'] - : null; - $this->container['sca_eth_flow_points'] = isset( - $data['sca_eth_flow_points'] - ) - ? $data['sca_eth_flow_points'] - : null; - $this->container['att_name'] = isset($data['att_name']) - ? $data['att_name'] - : null; + $this->container['small_camel'] = isset($data['small_camel']) ? $data['small_camel'] : null; + $this->container['capital_camel'] = isset($data['capital_camel']) ? $data['capital_camel'] : null; + $this->container['small_snake'] = isset($data['small_snake']) ? $data['small_snake'] : null; + $this->container['capital_snake'] = isset($data['capital_snake']) ? $data['capital_snake'] : null; + $this->container['sca_eth_flow_points'] = isset($data['sca_eth_flow_points']) ? $data['sca_eth_flow_points'] : null; + $this->container['att_name'] = isset($data['att_name']) ? $data['att_name'] : null; } /** @@ -243,6 +233,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets small_camel * @@ -407,9 +398,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -454,3 +443,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index d9da31e1978a..4fab7da51f95 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,7 +28,7 @@ */ namespace OpenAPI\Client\Model; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Cat Class Doc Comment @@ -38,31 +38,31 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class Cat extends Animal +class Cat extends Animal { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Cat'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'declawed' => 'bool' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'declawed' => null ]; @@ -156,6 +156,11 @@ public function getModelName() return self::$openAPIModelName; } + + + + + /** * Constructor * @@ -166,9 +171,7 @@ public function __construct(array $data = null) { parent::__construct($data); - $this->container['declawed'] = isset($data['declawed']) - ? $data['declawed'] - : null; + $this->container['declawed'] = isset($data['declawed']) ? $data['declawed'] : null; } /** @@ -194,6 +197,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets declawed * @@ -238,9 +242,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -285,3 +287,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 05a35bd6bdac..2aef04e5885d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Category Class Doc Comment @@ -45,27 +45,27 @@ class Category implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Category'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'name' => null @@ -163,6 +163,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -179,9 +183,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['name'] = isset($data['name']) - ? $data['name'] - : 'default-name'; + $this->container['name'] = isset($data['name']) ? $data['name'] : 'default-name'; } /** @@ -210,6 +212,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets id * @@ -278,9 +281,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -325,3 +326,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 43f1526ca485..1dd178336841 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * ClassModel Class Doc Comment @@ -46,26 +46,26 @@ class ClassModel implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ClassModel'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ '_class' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ '_class' => null ]; @@ -159,6 +159,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -174,9 +178,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['_class'] = isset($data['_class']) - ? $data['_class'] - : null; + $this->container['_class'] = isset($data['_class']) ? $data['_class'] : null; } /** @@ -202,6 +204,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets _class * @@ -246,9 +249,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -293,3 +294,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 5aede04df0b9..cb97b431e181 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Client Class Doc Comment @@ -45,26 +45,26 @@ class Client implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Client'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'client' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'client' => null ]; @@ -158,6 +158,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -173,9 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['client'] = isset($data['client']) - ? $data['client'] - : null; + $this->container['client'] = isset($data['client']) ? $data['client'] : null; } /** @@ -201,6 +203,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets client * @@ -245,9 +248,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -292,3 +293,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index a80567f4efd6..78fe83b1b36c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,7 +28,7 @@ */ namespace OpenAPI\Client\Model; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Dog Class Doc Comment @@ -38,31 +38,31 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class Dog extends Animal +class Dog extends Animal { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Dog'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'breed' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'breed' => null ]; @@ -156,6 +156,11 @@ public function getModelName() return self::$openAPIModelName; } + + + + + /** * Constructor * @@ -166,9 +171,7 @@ public function __construct(array $data = null) { parent::__construct($data); - $this->container['breed'] = isset($data['breed']) - ? $data['breed'] - : null; + $this->container['breed'] = isset($data['breed']) ? $data['breed'] : null; } /** @@ -194,6 +197,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets breed * @@ -238,9 +242,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -285,3 +287,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 21d1e01bbc28..011df11fea7a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * EnumArrays Class Doc Comment @@ -45,27 +45,27 @@ class EnumArrays implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'EnumArrays'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'just_symbol' => 'string', 'array_enum' => 'string[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'just_symbol' => null, 'array_enum' => null @@ -167,7 +167,9 @@ public function getModelName() const JUST_SYMBOL_DOLLAR = '$'; const ARRAY_ENUM_FISH = 'fish'; const ARRAY_ENUM_CRAB = 'crab'; + + /** * Gets allowable values of the enum * @@ -177,10 +179,10 @@ public function getJustSymbolAllowableValues() { return [ self::JUST_SYMBOL_GREATER_THAN_OR_EQUAL_TO, - self::JUST_SYMBOL_DOLLAR + self::JUST_SYMBOL_DOLLAR, ]; } - + /** * Gets allowable values of the enum * @@ -188,8 +190,12 @@ public function getJustSymbolAllowableValues() */ public function getArrayEnumAllowableValues() { - return [self::ARRAY_ENUM_FISH, self::ARRAY_ENUM_CRAB]; + return [ + self::ARRAY_ENUM_FISH, + self::ARRAY_ENUM_CRAB, + ]; } + /** * Associative array for storing property values @@ -206,12 +212,8 @@ public function getArrayEnumAllowableValues() */ public function __construct(array $data = null) { - $this->container['just_symbol'] = isset($data['just_symbol']) - ? $data['just_symbol'] - : null; - $this->container['array_enum'] = isset($data['array_enum']) - ? $data['array_enum'] - : null; + $this->container['just_symbol'] = isset($data['just_symbol']) ? $data['just_symbol'] : null; + $this->container['array_enum'] = isset($data['array_enum']) ? $data['array_enum'] : null; } /** @@ -224,10 +226,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getJustSymbolAllowableValues(); - if ( - !is_null($this->container['just_symbol']) && - !in_array($this->container['just_symbol'], $allowedValues, true) - ) { + if (!is_null($this->container['just_symbol']) && !in_array($this->container['just_symbol'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'just_symbol', must be one of '%s'", implode("', '", $allowedValues) @@ -248,6 +247,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets just_symbol * @@ -268,10 +268,7 @@ public function getJustSymbol() public function setJustSymbol($just_symbol) { $allowedValues = $this->getJustSymbolAllowableValues(); - if ( - !is_null($just_symbol) && - !in_array($just_symbol, $allowedValues, true) - ) { + if (!is_null($just_symbol) && !in_array($just_symbol, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'just_symbol', must be one of '%s'", @@ -337,9 +334,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -384,3 +379,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 09ed61247966..f7b87a413025 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,7 +28,7 @@ */ namespace OpenAPI\Client\Model; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * EnumClass Class Doc Comment @@ -46,13 +46,19 @@ class EnumClass const ABC = '_abc'; const EFG = '-efg'; const XYZ = '(xyz)'; - + /** * Gets allowable values of the enum * @return string[] */ public static function getAllowableEnumValues() { - return [self::ABC, self::EFG, self::XYZ]; + return [ + self::ABC, + self::EFG, + self::XYZ, + ]; } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index 490a0e6d7bdc..d0bd84745ed0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * EnumTest Class Doc Comment @@ -45,17 +45,17 @@ class EnumTest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Enum_Test'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'enum_string' => 'string', 'enum_string_required' => 'string', @@ -65,10 +65,10 @@ class EnumTest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'enum_string' => null, 'enum_string_required' => null, @@ -188,7 +188,9 @@ public function getModelName() const ENUM_INTEGER_MINUS_1 = -1; const ENUM_NUMBER_1_DOT_1 = 1.1; const ENUM_NUMBER_MINUS_1_DOT_2 = -1.2; + + /** * Gets allowable values of the enum * @@ -199,10 +201,10 @@ public function getEnumStringAllowableValues() return [ self::ENUM_STRING_UPPER, self::ENUM_STRING_LOWER, - self::ENUM_STRING_EMPTY + self::ENUM_STRING_EMPTY, ]; } - + /** * Gets allowable values of the enum * @@ -213,10 +215,10 @@ public function getEnumStringRequiredAllowableValues() return [ self::ENUM_STRING_REQUIRED_UPPER, self::ENUM_STRING_REQUIRED_LOWER, - self::ENUM_STRING_REQUIRED_EMPTY + self::ENUM_STRING_REQUIRED_EMPTY, ]; } - + /** * Gets allowable values of the enum * @@ -224,9 +226,12 @@ public function getEnumStringRequiredAllowableValues() */ public function getEnumIntegerAllowableValues() { - return [self::ENUM_INTEGER_1, self::ENUM_INTEGER_MINUS_1]; + return [ + self::ENUM_INTEGER_1, + self::ENUM_INTEGER_MINUS_1, + ]; } - + /** * Gets allowable values of the enum * @@ -234,8 +239,12 @@ public function getEnumIntegerAllowableValues() */ public function getEnumNumberAllowableValues() { - return [self::ENUM_NUMBER_1_DOT_1, self::ENUM_NUMBER_MINUS_1_DOT_2]; + return [ + self::ENUM_NUMBER_1_DOT_1, + self::ENUM_NUMBER_MINUS_1_DOT_2, + ]; } + /** * Associative array for storing property values @@ -252,23 +261,11 @@ public function getEnumNumberAllowableValues() */ public function __construct(array $data = null) { - $this->container['enum_string'] = isset($data['enum_string']) - ? $data['enum_string'] - : null; - $this->container['enum_string_required'] = isset( - $data['enum_string_required'] - ) - ? $data['enum_string_required'] - : null; - $this->container['enum_integer'] = isset($data['enum_integer']) - ? $data['enum_integer'] - : null; - $this->container['enum_number'] = isset($data['enum_number']) - ? $data['enum_number'] - : null; - $this->container['outer_enum'] = isset($data['outer_enum']) - ? $data['outer_enum'] - : null; + $this->container['enum_string'] = isset($data['enum_string']) ? $data['enum_string'] : null; + $this->container['enum_string_required'] = isset($data['enum_string_required']) ? $data['enum_string_required'] : null; + $this->container['enum_integer'] = isset($data['enum_integer']) ? $data['enum_integer'] : null; + $this->container['enum_number'] = isset($data['enum_number']) ? $data['enum_number'] : null; + $this->container['outer_enum'] = isset($data['outer_enum']) ? $data['outer_enum'] : null; } /** @@ -281,10 +278,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getEnumStringAllowableValues(); - if ( - !is_null($this->container['enum_string']) && - !in_array($this->container['enum_string'], $allowedValues, true) - ) { + if (!is_null($this->container['enum_string']) && !in_array($this->container['enum_string'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'enum_string', must be one of '%s'", implode("', '", $allowedValues) @@ -295,14 +289,7 @@ public function listInvalidProperties() $invalidProperties[] = "'enum_string_required' can't be null"; } $allowedValues = $this->getEnumStringRequiredAllowableValues(); - if ( - !is_null($this->container['enum_string_required']) && - !in_array( - $this->container['enum_string_required'], - $allowedValues, - true - ) - ) { + if (!is_null($this->container['enum_string_required']) && !in_array($this->container['enum_string_required'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'enum_string_required', must be one of '%s'", implode("', '", $allowedValues) @@ -310,10 +297,7 @@ public function listInvalidProperties() } $allowedValues = $this->getEnumIntegerAllowableValues(); - if ( - !is_null($this->container['enum_integer']) && - !in_array($this->container['enum_integer'], $allowedValues, true) - ) { + if (!is_null($this->container['enum_integer']) && !in_array($this->container['enum_integer'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'enum_integer', must be one of '%s'", implode("', '", $allowedValues) @@ -321,10 +305,7 @@ public function listInvalidProperties() } $allowedValues = $this->getEnumNumberAllowableValues(); - if ( - !is_null($this->container['enum_number']) && - !in_array($this->container['enum_number'], $allowedValues, true) - ) { + if (!is_null($this->container['enum_number']) && !in_array($this->container['enum_number'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'enum_number', must be one of '%s'", implode("', '", $allowedValues) @@ -345,6 +326,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets enum_string * @@ -365,10 +347,7 @@ public function getEnumString() public function setEnumString($enum_string) { $allowedValues = $this->getEnumStringAllowableValues(); - if ( - !is_null($enum_string) && - !in_array($enum_string, $allowedValues, true) - ) { + if (!is_null($enum_string) && !in_array($enum_string, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_string', must be one of '%s'", @@ -434,10 +413,7 @@ public function getEnumInteger() public function setEnumInteger($enum_integer) { $allowedValues = $this->getEnumIntegerAllowableValues(); - if ( - !is_null($enum_integer) && - !in_array($enum_integer, $allowedValues, true) - ) { + if (!is_null($enum_integer) && !in_array($enum_integer, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_integer', must be one of '%s'", @@ -470,10 +446,7 @@ public function getEnumNumber() public function setEnumNumber($enum_number) { $allowedValues = $this->getEnumNumberAllowableValues(); - if ( - !is_null($enum_number) && - !in_array($enum_number, $allowedValues, true) - ) { + if (!is_null($enum_number) && !in_array($enum_number, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'enum_number', must be one of '%s'", @@ -530,9 +503,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -577,3 +548,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 130f07026ec3..4c1da430ad59 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * File Class Doc Comment @@ -46,26 +46,26 @@ class File implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'File'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'source_uri' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'source_uri' => null ]; @@ -159,6 +159,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -174,9 +178,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['source_uri'] = isset($data['source_uri']) - ? $data['source_uri'] - : null; + $this->container['source_uri'] = isset($data['source_uri']) ? $data['source_uri'] : null; } /** @@ -202,6 +204,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets source_uri * @@ -246,9 +249,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -293,3 +294,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 9ab0f24e4fe8..2e44e4148073 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * FileSchemaTestClass Class Doc Comment @@ -45,27 +45,27 @@ class FileSchemaTestClass implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'FileSchemaTestClass'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'file' => '\OpenAPI\Client\Model\File', 'files' => '\OpenAPI\Client\Model\File[]' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'file' => null, 'files' => null @@ -163,6 +163,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -179,9 +183,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['file'] = isset($data['file']) ? $data['file'] : null; - $this->container['files'] = isset($data['files']) - ? $data['files'] - : null; + $this->container['files'] = isset($data['files']) ? $data['files'] : null; } /** @@ -207,6 +209,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets file * @@ -275,9 +278,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -322,3 +323,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index f5ca5008fa12..8c1ee70299b5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * FormatTest Class Doc Comment @@ -45,17 +45,17 @@ class FormatTest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'format_test'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'integer' => 'int', 'int32' => 'int', @@ -73,10 +73,10 @@ class FormatTest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'integer' => null, 'int32' => 'int32', @@ -218,6 +218,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -233,39 +237,19 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['integer'] = isset($data['integer']) - ? $data['integer'] - : null; - $this->container['int32'] = isset($data['int32']) - ? $data['int32'] - : null; - $this->container['int64'] = isset($data['int64']) - ? $data['int64'] - : null; - $this->container['number'] = isset($data['number']) - ? $data['number'] - : null; - $this->container['float'] = isset($data['float']) - ? $data['float'] - : null; - $this->container['double'] = isset($data['double']) - ? $data['double'] - : null; - $this->container['string'] = isset($data['string']) - ? $data['string'] - : null; + $this->container['integer'] = isset($data['integer']) ? $data['integer'] : null; + $this->container['int32'] = isset($data['int32']) ? $data['int32'] : null; + $this->container['int64'] = isset($data['int64']) ? $data['int64'] : null; + $this->container['number'] = isset($data['number']) ? $data['number'] : null; + $this->container['float'] = isset($data['float']) ? $data['float'] : null; + $this->container['double'] = isset($data['double']) ? $data['double'] : null; + $this->container['string'] = isset($data['string']) ? $data['string'] : null; $this->container['byte'] = isset($data['byte']) ? $data['byte'] : null; - $this->container['binary'] = isset($data['binary']) - ? $data['binary'] - : null; + $this->container['binary'] = isset($data['binary']) ? $data['binary'] : null; $this->container['date'] = isset($data['date']) ? $data['date'] : null; - $this->container['date_time'] = isset($data['date_time']) - ? $data['date_time'] - : null; + $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; - $this->container['password'] = isset($data['password']) - ? $data['password'] - : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; } /** @@ -277,102 +261,58 @@ public function listInvalidProperties() { $invalidProperties = []; - if ( - !is_null($this->container['integer']) && - $this->container['integer'] > 100 - ) { - $invalidProperties[] = - "invalid value for 'integer', must be smaller than or equal to 100."; + if (!is_null($this->container['integer']) && ($this->container['integer'] > 100)) { + $invalidProperties[] = "invalid value for 'integer', must be smaller than or equal to 100."; } - if ( - !is_null($this->container['integer']) && - $this->container['integer'] < 10 - ) { - $invalidProperties[] = - "invalid value for 'integer', must be bigger than or equal to 10."; + if (!is_null($this->container['integer']) && ($this->container['integer'] < 10)) { + $invalidProperties[] = "invalid value for 'integer', must be bigger than or equal to 10."; } - if ( - !is_null($this->container['int32']) && - $this->container['int32'] > 200 - ) { - $invalidProperties[] = - "invalid value for 'int32', must be smaller than or equal to 200."; + if (!is_null($this->container['int32']) && ($this->container['int32'] > 200)) { + $invalidProperties[] = "invalid value for 'int32', must be smaller than or equal to 200."; } - if ( - !is_null($this->container['int32']) && - $this->container['int32'] < 20 - ) { - $invalidProperties[] = - "invalid value for 'int32', must be bigger than or equal to 20."; + if (!is_null($this->container['int32']) && ($this->container['int32'] < 20)) { + $invalidProperties[] = "invalid value for 'int32', must be bigger than or equal to 20."; } if ($this->container['number'] === null) { $invalidProperties[] = "'number' can't be null"; } - if ($this->container['number'] > 543.2) { - $invalidProperties[] = - "invalid value for 'number', must be smaller than or equal to 543.2."; + if (($this->container['number'] > 543.2)) { + $invalidProperties[] = "invalid value for 'number', must be smaller than or equal to 543.2."; } - if ($this->container['number'] < 32.1) { - $invalidProperties[] = - "invalid value for 'number', must be bigger than or equal to 32.1."; + if (($this->container['number'] < 32.1)) { + $invalidProperties[] = "invalid value for 'number', must be bigger than or equal to 32.1."; } - if ( - !is_null($this->container['float']) && - $this->container['float'] > 987.6 - ) { - $invalidProperties[] = - "invalid value for 'float', must be smaller than or equal to 987.6."; + if (!is_null($this->container['float']) && ($this->container['float'] > 987.6)) { + $invalidProperties[] = "invalid value for 'float', must be smaller than or equal to 987.6."; } - if ( - !is_null($this->container['float']) && - $this->container['float'] < 54.3 - ) { - $invalidProperties[] = - "invalid value for 'float', must be bigger than or equal to 54.3."; + if (!is_null($this->container['float']) && ($this->container['float'] < 54.3)) { + $invalidProperties[] = "invalid value for 'float', must be bigger than or equal to 54.3."; } - if ( - !is_null($this->container['double']) && - $this->container['double'] > 123.4 - ) { - $invalidProperties[] = - "invalid value for 'double', must be smaller than or equal to 123.4."; + if (!is_null($this->container['double']) && ($this->container['double'] > 123.4)) { + $invalidProperties[] = "invalid value for 'double', must be smaller than or equal to 123.4."; } - if ( - !is_null($this->container['double']) && - $this->container['double'] < 67.8 - ) { - $invalidProperties[] = - "invalid value for 'double', must be bigger than or equal to 67.8."; + if (!is_null($this->container['double']) && ($this->container['double'] < 67.8)) { + $invalidProperties[] = "invalid value for 'double', must be bigger than or equal to 67.8."; } - if ( - !is_null($this->container['string']) && - !preg_match("/[a-z]/i", $this->container['string']) - ) { - $invalidProperties[] = - "invalid value for 'string', must be conform to the pattern /[a-z]/i."; + if (!is_null($this->container['string']) && !preg_match("/[a-z]/i", $this->container['string'])) { + $invalidProperties[] = "invalid value for 'string', must be conform to the pattern /[a-z]/i."; } if ($this->container['byte'] === null) { $invalidProperties[] = "'byte' can't be null"; } - if ( - !preg_match( - "/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", - $this->container['byte'] - ) - ) { - $invalidProperties[] = - "invalid value for 'byte', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; + if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['byte'])) { + $invalidProperties[] = "invalid value for 'byte', must be conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."; } if ($this->container['date'] === null) { @@ -381,14 +321,12 @@ public function listInvalidProperties() if ($this->container['password'] === null) { $invalidProperties[] = "'password' can't be null"; } - if (mb_strlen($this->container['password']) > 64) { - $invalidProperties[] = - "invalid value for 'password', the character length must be smaller than or equal to 64."; + if ((mb_strlen($this->container['password']) > 64)) { + $invalidProperties[] = "invalid value for 'password', the character length must be smaller than or equal to 64."; } - if (mb_strlen($this->container['password']) < 10) { - $invalidProperties[] = - "invalid value for 'password', the character length must be bigger than or equal to 10."; + if ((mb_strlen($this->container['password']) < 10)) { + $invalidProperties[] = "invalid value for 'password', the character length must be bigger than or equal to 10."; } return $invalidProperties; @@ -405,6 +343,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets integer * @@ -424,15 +363,12 @@ public function getInteger() */ public function setInteger($integer) { - if (!is_null($integer) && $integer > 100) { - throw new \InvalidArgumentException( - 'invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.' - ); + + if (!is_null($integer) && ($integer > 100)) { + throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.'); } - if (!is_null($integer) && $integer < 10) { - throw new \InvalidArgumentException( - 'invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.' - ); + if (!is_null($integer) && ($integer < 10)) { + throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.'); } $this->container['integer'] = $integer; @@ -459,15 +395,12 @@ public function getInt32() */ public function setInt32($int32) { - if (!is_null($int32) && $int32 > 200) { - throw new \InvalidArgumentException( - 'invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.' - ); + + if (!is_null($int32) && ($int32 > 200)) { + throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.'); } - if (!is_null($int32) && $int32 < 20) { - throw new \InvalidArgumentException( - 'invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.' - ); + if (!is_null($int32) && ($int32 < 20)) { + throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.'); } $this->container['int32'] = $int32; @@ -518,15 +451,12 @@ public function getNumber() */ public function setNumber($number) { - if ($number > 543.2) { - throw new \InvalidArgumentException( - 'invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.' - ); + + if (($number > 543.2)) { + throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.'); } - if ($number < 32.1) { - throw new \InvalidArgumentException( - 'invalid value for $number when calling FormatTest., must be bigger than or equal to 32.1.' - ); + if (($number < 32.1)) { + throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be bigger than or equal to 32.1.'); } $this->container['number'] = $number; @@ -553,15 +483,12 @@ public function getFloat() */ public function setFloat($float) { - if (!is_null($float) && $float > 987.6) { - throw new \InvalidArgumentException( - 'invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.' - ); + + if (!is_null($float) && ($float > 987.6)) { + throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.'); } - if (!is_null($float) && $float < 54.3) { - throw new \InvalidArgumentException( - 'invalid value for $float when calling FormatTest., must be bigger than or equal to 54.3.' - ); + if (!is_null($float) && ($float < 54.3)) { + throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be bigger than or equal to 54.3.'); } $this->container['float'] = $float; @@ -588,15 +515,12 @@ public function getDouble() */ public function setDouble($double) { - if (!is_null($double) && $double > 123.4) { - throw new \InvalidArgumentException( - 'invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.' - ); + + if (!is_null($double) && ($double > 123.4)) { + throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.'); } - if (!is_null($double) && $double < 67.8) { - throw new \InvalidArgumentException( - 'invalid value for $double when calling FormatTest., must be bigger than or equal to 67.8.' - ); + if (!is_null($double) && ($double < 67.8)) { + throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be bigger than or equal to 67.8.'); } $this->container['double'] = $double; @@ -623,10 +547,9 @@ public function getString() */ public function setString($string) { - if (!is_null($string) && !preg_match("/[a-z]/i", $string)) { - throw new \InvalidArgumentException( - "invalid value for $string when calling FormatTest., must conform to the pattern /[a-z]/i." - ); + + if (!is_null($string) && (!preg_match("/[a-z]/i", $string))) { + throw new \InvalidArgumentException("invalid value for $string when calling FormatTest., must conform to the pattern /[a-z]/i."); } $this->container['string'] = $string; @@ -653,15 +576,9 @@ public function getByte() */ public function setByte($byte) { - if ( - !preg_match( - "/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", - $byte - ) - ) { - throw new \InvalidArgumentException( - "invalid value for $byte when calling FormatTest., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/." - ); + + if ((!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $byte))) { + throw new \InvalidArgumentException("invalid value for $byte when calling FormatTest., must conform to the pattern /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/."); } $this->container['byte'] = $byte; @@ -784,15 +701,11 @@ public function getPassword() */ public function setPassword($password) { - if (mb_strlen($password) > 64) { - throw new \InvalidArgumentException( - 'invalid length for $password when calling FormatTest., must be smaller than or equal to 64.' - ); + if ((mb_strlen($password) > 64)) { + throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be smaller than or equal to 64.'); } - if (mb_strlen($password) < 10) { - throw new \InvalidArgumentException( - 'invalid length for $password when calling FormatTest., must be bigger than or equal to 10.' - ); + if ((mb_strlen($password) < 10)) { + throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be bigger than or equal to 10.'); } $this->container['password'] = $password; @@ -820,9 +733,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -867,3 +778,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 6377959d9028..fa7dc269837a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * HasOnlyReadOnly Class Doc Comment @@ -45,27 +45,27 @@ class HasOnlyReadOnly implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'hasOnlyReadOnly'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bar' => 'string', 'foo' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'bar' => null, 'foo' => null @@ -163,6 +163,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -205,6 +209,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets bar * @@ -273,9 +278,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -320,3 +323,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index bc04b9f94057..ded302c8b29a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * MapTest Class Doc Comment @@ -45,17 +45,17 @@ class MapTest implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MapTest'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'map_map_of_string' => 'map[string,map[string,string]]', 'map_of_enum_string' => 'map[string,string]', @@ -64,10 +64,10 @@ class MapTest implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'map_map_of_string' => null, 'map_of_enum_string' => null, @@ -175,7 +175,9 @@ public function getModelName() const MAP_OF_ENUM_STRING_UPPER = 'UPPER'; const MAP_OF_ENUM_STRING_LOWER = 'lower'; + + /** * Gets allowable values of the enum * @@ -183,8 +185,12 @@ public function getModelName() */ public function getMapOfEnumStringAllowableValues() { - return [self::MAP_OF_ENUM_STRING_UPPER, self::MAP_OF_ENUM_STRING_LOWER]; + return [ + self::MAP_OF_ENUM_STRING_UPPER, + self::MAP_OF_ENUM_STRING_LOWER, + ]; } + /** * Associative array for storing property values @@ -201,22 +207,10 @@ public function getMapOfEnumStringAllowableValues() */ public function __construct(array $data = null) { - $this->container['map_map_of_string'] = isset( - $data['map_map_of_string'] - ) - ? $data['map_map_of_string'] - : null; - $this->container['map_of_enum_string'] = isset( - $data['map_of_enum_string'] - ) - ? $data['map_of_enum_string'] - : null; - $this->container['direct_map'] = isset($data['direct_map']) - ? $data['direct_map'] - : null; - $this->container['indirect_map'] = isset($data['indirect_map']) - ? $data['indirect_map'] - : null; + $this->container['map_map_of_string'] = isset($data['map_map_of_string']) ? $data['map_map_of_string'] : null; + $this->container['map_of_enum_string'] = isset($data['map_of_enum_string']) ? $data['map_of_enum_string'] : null; + $this->container['direct_map'] = isset($data['direct_map']) ? $data['direct_map'] : null; + $this->container['indirect_map'] = isset($data['indirect_map']) ? $data['indirect_map'] : null; } /** @@ -242,6 +236,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets map_map_of_string * @@ -286,10 +281,7 @@ public function getMapOfEnumString() public function setMapOfEnumString($map_of_enum_string) { $allowedValues = $this->getMapOfEnumStringAllowableValues(); - if ( - !is_null($map_of_enum_string) && - array_diff($map_of_enum_string, $allowedValues) - ) { + if (!is_null($map_of_enum_string) && array_diff($map_of_enum_string, $allowedValues)) { throw new \InvalidArgumentException( sprintf( "Invalid value for 'map_of_enum_string', must be one of '%s'", @@ -370,9 +362,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -417,3 +407,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index d2ee654e3b04..eb49dc7a7e8d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * MixedPropertiesAndAdditionalPropertiesClass Class Doc Comment @@ -40,24 +40,22 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class MixedPropertiesAndAdditionalPropertiesClass implements - ModelInterface, - ArrayAccess +class MixedPropertiesAndAdditionalPropertiesClass implements ModelInterface, ArrayAccess { const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'MixedPropertiesAndAdditionalPropertiesClass'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'uuid' => 'string', 'date_time' => '\DateTime', @@ -65,10 +63,10 @@ class MixedPropertiesAndAdditionalPropertiesClass implements ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'uuid' => 'uuid', 'date_time' => 'date-time', @@ -170,6 +168,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -186,9 +188,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; - $this->container['date_time'] = isset($data['date_time']) - ? $data['date_time'] - : null; + $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; $this->container['map'] = isset($data['map']) ? $data['map'] : null; } @@ -215,6 +215,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets uuid * @@ -307,9 +308,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -354,3 +353,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 282c36aec245..9d0eb4fe6ce1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Model200Response Class Doc Comment @@ -46,27 +46,27 @@ class Model200Response implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = '200_response'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'int', 'class' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => 'int32', 'class' => null @@ -164,6 +164,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -180,9 +184,7 @@ public function getModelName() public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['class'] = isset($data['class']) - ? $data['class'] - : null; + $this->container['class'] = isset($data['class']) ? $data['class'] : null; } /** @@ -208,6 +210,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -276,9 +279,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -323,3 +324,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 69c6a9182008..b6dc03437bd5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index 6dbcca3e4350..0f626833f819 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * ModelList Class Doc Comment @@ -45,26 +45,26 @@ class ModelList implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'List'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ '_123_list' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ '_123_list' => null ]; @@ -158,6 +158,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -173,9 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['_123_list'] = isset($data['_123_list']) - ? $data['_123_list'] - : null; + $this->container['_123_list'] = isset($data['_123_list']) ? $data['_123_list'] : null; } /** @@ -201,6 +203,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets _123_list * @@ -245,9 +248,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -292,3 +293,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 67e49b03aa10..9012d5dc1611 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * ModelReturn Class Doc Comment @@ -46,26 +46,26 @@ class ModelReturn implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Return'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'return' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'return' => 'int32' ]; @@ -159,6 +159,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -174,9 +178,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['return'] = isset($data['return']) - ? $data['return'] - : null; + $this->container['return'] = isset($data['return']) ? $data['return'] : null; } /** @@ -202,6 +204,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets return * @@ -246,9 +249,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -293,3 +294,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 70624fffa89c..4cfdbd8ef86d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Name Class Doc Comment @@ -46,17 +46,17 @@ class Name implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Name'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'name' => 'int', 'snake_case' => 'int', @@ -65,10 +65,10 @@ class Name implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'name' => 'int32', 'snake_case' => 'int32', @@ -174,6 +174,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -190,15 +194,9 @@ public function getModelName() public function __construct(array $data = null) { $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['snake_case'] = isset($data['snake_case']) - ? $data['snake_case'] - : null; - $this->container['property'] = isset($data['property']) - ? $data['property'] - : null; - $this->container['_123_number'] = isset($data['_123_number']) - ? $data['_123_number'] - : null; + $this->container['snake_case'] = isset($data['snake_case']) ? $data['snake_case'] : null; + $this->container['property'] = isset($data['property']) ? $data['property'] : null; + $this->container['_123_number'] = isset($data['_123_number']) ? $data['_123_number'] : null; } /** @@ -227,6 +225,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets name * @@ -343,9 +342,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -390,3 +387,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index eb7a3385d14d..5d958aceaee7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * NumberOnly Class Doc Comment @@ -45,26 +45,26 @@ class NumberOnly implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'NumberOnly'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'just_number' => 'float' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'just_number' => null ]; @@ -158,6 +158,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -173,9 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['just_number'] = isset($data['just_number']) - ? $data['just_number'] - : null; + $this->container['just_number'] = isset($data['just_number']) ? $data['just_number'] : null; } /** @@ -201,6 +203,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets just_number * @@ -245,9 +248,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -292,3 +293,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 503265d6b2b4..3e094149d12a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Order Class Doc Comment @@ -45,17 +45,17 @@ class Order implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Order'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'pet_id' => 'int', @@ -66,10 +66,10 @@ class Order implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'pet_id' => 'int64', @@ -186,7 +186,9 @@ public function getModelName() const STATUS_PLACED = 'placed'; const STATUS_APPROVED = 'approved'; const STATUS_DELIVERED = 'delivered'; + + /** * Gets allowable values of the enum * @@ -197,9 +199,10 @@ public function getStatusAllowableValues() return [ self::STATUS_PLACED, self::STATUS_APPROVED, - self::STATUS_DELIVERED + self::STATUS_DELIVERED, ]; } + /** * Associative array for storing property values @@ -217,21 +220,11 @@ public function getStatusAllowableValues() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['pet_id'] = isset($data['pet_id']) - ? $data['pet_id'] - : null; - $this->container['quantity'] = isset($data['quantity']) - ? $data['quantity'] - : null; - $this->container['ship_date'] = isset($data['ship_date']) - ? $data['ship_date'] - : null; - $this->container['status'] = isset($data['status']) - ? $data['status'] - : null; - $this->container['complete'] = isset($data['complete']) - ? $data['complete'] - : false; + $this->container['pet_id'] = isset($data['pet_id']) ? $data['pet_id'] : null; + $this->container['quantity'] = isset($data['quantity']) ? $data['quantity'] : null; + $this->container['ship_date'] = isset($data['ship_date']) ? $data['ship_date'] : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; + $this->container['complete'] = isset($data['complete']) ? $data['complete'] : false; } /** @@ -244,10 +237,7 @@ public function listInvalidProperties() $invalidProperties = []; $allowedValues = $this->getStatusAllowableValues(); - if ( - !is_null($this->container['status']) && - !in_array($this->container['status'], $allowedValues, true) - ) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -268,6 +258,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets id * @@ -441,9 +432,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -488,3 +477,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 01e31bdaaabb..f151c8979e96 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * OuterComposite Class Doc Comment @@ -45,17 +45,17 @@ class OuterComposite implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'OuterComposite'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'my_number' => 'float', 'my_string' => 'string', @@ -63,10 +63,10 @@ class OuterComposite implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'my_number' => null, 'my_string' => null, @@ -168,6 +168,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -183,15 +187,9 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['my_number'] = isset($data['my_number']) - ? $data['my_number'] - : null; - $this->container['my_string'] = isset($data['my_string']) - ? $data['my_string'] - : null; - $this->container['my_boolean'] = isset($data['my_boolean']) - ? $data['my_boolean'] - : null; + $this->container['my_number'] = isset($data['my_number']) ? $data['my_number'] : null; + $this->container['my_string'] = isset($data['my_string']) ? $data['my_string'] : null; + $this->container['my_boolean'] = isset($data['my_boolean']) ? $data['my_boolean'] : null; } /** @@ -217,6 +215,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets my_number * @@ -309,9 +308,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -356,3 +353,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index f2a6f105fd35..2e69bda233a3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,7 +28,7 @@ */ namespace OpenAPI\Client\Model; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * OuterEnum Class Doc Comment @@ -46,13 +46,19 @@ class OuterEnum const PLACED = 'placed'; const APPROVED = 'approved'; const DELIVERED = 'delivered'; - + /** * Gets allowable values of the enum * @return string[] */ public static function getAllowableEnumValues() { - return [self::PLACED, self::APPROVED, self::DELIVERED]; + return [ + self::PLACED, + self::APPROVED, + self::DELIVERED, + ]; } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index c1a0f6bdf5a7..a6ad7fb147f5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Pet Class Doc Comment @@ -45,17 +45,17 @@ class Pet implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Pet'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'category' => '\OpenAPI\Client\Model\Category', @@ -66,10 +66,10 @@ class Pet implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'category' => null, @@ -186,7 +186,9 @@ public function getModelName() const STATUS_AVAILABLE = 'available'; const STATUS_PENDING = 'pending'; const STATUS_SOLD = 'sold'; + + /** * Gets allowable values of the enum * @@ -197,9 +199,10 @@ public function getStatusAllowableValues() return [ self::STATUS_AVAILABLE, self::STATUS_PENDING, - self::STATUS_SOLD + self::STATUS_SOLD, ]; } + /** * Associative array for storing property values @@ -217,17 +220,11 @@ public function getStatusAllowableValues() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['category'] = isset($data['category']) - ? $data['category'] - : null; + $this->container['category'] = isset($data['category']) ? $data['category'] : null; $this->container['name'] = isset($data['name']) ? $data['name'] : null; - $this->container['photo_urls'] = isset($data['photo_urls']) - ? $data['photo_urls'] - : null; + $this->container['photo_urls'] = isset($data['photo_urls']) ? $data['photo_urls'] : null; $this->container['tags'] = isset($data['tags']) ? $data['tags'] : null; - $this->container['status'] = isset($data['status']) - ? $data['status'] - : null; + $this->container['status'] = isset($data['status']) ? $data['status'] : null; } /** @@ -246,10 +243,7 @@ public function listInvalidProperties() $invalidProperties[] = "'photo_urls' can't be null"; } $allowedValues = $this->getStatusAllowableValues(); - if ( - !is_null($this->container['status']) && - !in_array($this->container['status'], $allowedValues, true) - ) { + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( "invalid value for 'status', must be one of '%s'", implode("', '", $allowedValues) @@ -270,6 +264,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets id * @@ -443,9 +438,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -490,3 +483,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 14391760c7af..074ae0bd39da 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * ReadOnlyFirst Class Doc Comment @@ -45,27 +45,27 @@ class ReadOnlyFirst implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'ReadOnlyFirst'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'bar' => 'string', 'baz' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'bar' => null, 'baz' => null @@ -163,6 +163,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -205,6 +209,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets bar * @@ -273,9 +278,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -320,3 +323,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 59b4ac06fa54..aeb5e92acc45 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * SpecialModelName Class Doc Comment @@ -45,26 +45,26 @@ class SpecialModelName implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = '$special[model.name]'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'special_property_name' => 'int' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'special_property_name' => 'int64' ]; @@ -158,6 +158,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -173,11 +177,7 @@ public function getModelName() */ public function __construct(array $data = null) { - $this->container['special_property_name'] = isset( - $data['special_property_name'] - ) - ? $data['special_property_name'] - : null; + $this->container['special_property_name'] = isset($data['special_property_name']) ? $data['special_property_name'] : null; } /** @@ -203,6 +203,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets special_property_name * @@ -247,9 +248,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -294,3 +293,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php index 6aca95bc790c..782833285722 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/StringBooleanMap.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * StringBooleanMap Class Doc Comment @@ -45,25 +45,29 @@ class StringBooleanMap implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'StringBooleanMap'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = []; + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPIFormats = []; + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPIFormats = [ + + ]; /** * Array of property to type mappings. Used for (de)serialization @@ -91,21 +95,27 @@ public static function openAPIFormats() * * @var string[] */ - protected static $attributeMap = []; + protected static $attributeMap = [ + + ]; /** * Array of attributes to setter functions (for deserialization of responses) * * @var string[] */ - protected static $setters = []; + protected static $setters = [ + + ]; /** * Array of attributes to getter functions (for serialization of requests) * * @var string[] */ - protected static $getters = []; + protected static $getters = [ + + ]; /** * Array of attributes where the key is the local name, @@ -148,6 +158,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -209,9 +223,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -256,3 +268,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index ac364bf31343..357d10022569 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * Tag Class Doc Comment @@ -45,27 +45,27 @@ class Tag implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'Tag'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'name' => 'string' ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'name' => null @@ -163,6 +163,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -205,6 +209,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets id * @@ -273,9 +278,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -320,3 +323,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index 378ea0c78c66..a49732d42f09 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -30,7 +30,7 @@ namespace OpenAPI\Client\Model; use \ArrayAccess; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\ObjectSerializer; /** * User Class Doc Comment @@ -45,17 +45,17 @@ class User implements ModelInterface, ArrayAccess const DISCRIMINATOR = null; /** - * The original name of the model. - * - * @var string - */ + * The original name of the model. + * + * @var string + */ protected static $openAPIModelName = 'User'; /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPITypes = [ 'id' => 'int', 'username' => 'string', @@ -68,10 +68,10 @@ class User implements ModelInterface, ArrayAccess ]; /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - */ + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ protected static $openAPIFormats = [ 'id' => 'int64', 'username' => null, @@ -193,6 +193,10 @@ public function getModelName() return self::$openAPIModelName; } + + + + /** * Associative array for storing property values * @@ -209,27 +213,13 @@ public function getModelName() public function __construct(array $data = null) { $this->container['id'] = isset($data['id']) ? $data['id'] : null; - $this->container['username'] = isset($data['username']) - ? $data['username'] - : null; - $this->container['first_name'] = isset($data['first_name']) - ? $data['first_name'] - : null; - $this->container['last_name'] = isset($data['last_name']) - ? $data['last_name'] - : null; - $this->container['email'] = isset($data['email']) - ? $data['email'] - : null; - $this->container['password'] = isset($data['password']) - ? $data['password'] - : null; - $this->container['phone'] = isset($data['phone']) - ? $data['phone'] - : null; - $this->container['user_status'] = isset($data['user_status']) - ? $data['user_status'] - : null; + $this->container['username'] = isset($data['username']) ? $data['username'] : null; + $this->container['first_name'] = isset($data['first_name']) ? $data['first_name'] : null; + $this->container['last_name'] = isset($data['last_name']) ? $data['last_name'] : null; + $this->container['email'] = isset($data['email']) ? $data['email'] : null; + $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['phone'] = isset($data['phone']) ? $data['phone'] : null; + $this->container['user_status'] = isset($data['user_status']) ? $data['user_status'] : null; } /** @@ -255,6 +245,7 @@ public function valid() return count($this->listInvalidProperties()) === 0; } + /** * Gets id * @@ -467,9 +458,7 @@ public function offsetExists($offset) */ public function offsetGet($offset) { - return isset($this->container[$offset]) - ? $this->container[$offset] - : null; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -514,3 +503,5 @@ public function __toString() ); } } + + diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 403dbb9ec0dc..77b1d70cea04 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -50,17 +50,12 @@ class ObjectSerializer * * @return string|object serialized form of $data */ - public static function sanitizeForSerialization( - $data, - $type = null, - $format = null - ) { + public static function sanitizeForSerialization($data, $type = null, $format = null) + { if (is_scalar($data) || null === $data) { return $data; } elseif ($data instanceof \DateTime) { - return $format === 'date' - ? $data->format('Y-m-d') - : $data->format(\DateTime::ATOM); + return ($format === 'date') ? $data->format('Y-m-d') : $data->format(\DateTime::ATOM); } elseif (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); @@ -73,60 +68,25 @@ public static function sanitizeForSerialization( foreach ($data::openAPITypes() as $property => $openAPIType) { $getter = $data::getters()[$property]; $value = $data->$getter(); - if ( - $value !== null && - !in_array( - $openAPIType, - [ - 'DateTime', - 'bool', - 'boolean', - 'byte', - 'double', - 'float', - 'int', - 'integer', - 'mixed', - 'number', - 'object', - 'string', - 'void' - ], - true - ) && - method_exists($openAPIType, 'getAllowableEnumValues') && - !in_array( - $value, - $openAPIType::getAllowableEnumValues(), - true - ) - ) { - $imploded = implode( - "', '", - $openAPIType::getAllowableEnumValues() - ); - throw new \InvalidArgumentException( - "Invalid value for enum '$openAPIType', must be one of: '$imploded'" - ); + if ($value !== null + && !in_array($openAPIType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($openAPIType, 'getAllowableEnumValues') + && !in_array($value, $openAPIType::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $openAPIType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); } if ($value !== null) { - $values[ - $data::attributeMap()[$property] - ] = self::sanitizeForSerialization( - $value, - $openAPIType, - $formats[$property] - ); + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); } } } else { - foreach ($data as $property => $value) { + foreach($data as $property => $value) { $values[$property] = self::sanitizeForSerialization($value); } } - return (object) $values; + return (object)$values; } else { - return (string) $data; + return (string)$data; } } @@ -222,8 +182,7 @@ public static function toFormValue($value) */ public static function toString($value) { - if ($value instanceof \DateTime) { - // datetime in ISO8601 format + if ($value instanceof \DateTime) { // datetime in ISO8601 format return $value->format(\DateTime::ATOM); } else { return $value; @@ -240,19 +199,12 @@ public static function toString($value) * * @return string */ - public static function serializeCollection( - array $collection, - $collectionFormat, - $allowCollectionFormatMulti = false - ) { - if ($allowCollectionFormatMulti && 'multi' === $collectionFormat) { + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { // http_build_query() almost does the job for us. We just // need to fix the result of multidimensional arrays. - return preg_replace( - '/%5B[0-9]+%5D=/', - '=', - http_build_query($collection, '', '&') - ); + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); } switch ($collectionFormat) { case 'pipes': @@ -265,7 +217,7 @@ public static function serializeCollection( return implode(' ', $collection); case 'csv': - // Deliberate fall through. CSV is default format. + // Deliberate fall through. CSV is default format. default: return implode(',', $collection); } @@ -285,8 +237,7 @@ public static function deserialize($data, $class, $httpHeaders = null) { if (null === $data) { return null; - } elseif (substr($class, 0, 4) === 'map[') { - // for associative array e.g. map[string,int] + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $data = is_string($data) ? json_decode($data) : $data; settype($data, 'array'); $inner = substr($class, 4, -1); @@ -295,11 +246,7 @@ public static function deserialize($data, $class, $httpHeaders = null) $subClass_array = explode(',', $inner, 2); $subClass = $subClass_array[1]; foreach ($data as $key => $value) { - $deserialized[$key] = self::deserialize( - $value, - $subClass, - null - ); + $deserialized[$key] = self::deserialize($value, $subClass, null); } } return $deserialized; @@ -326,54 +273,22 @@ public static function deserialize($data, $class, $httpHeaders = null) } else { return null; } - } elseif ( - in_array( - $class, - [ - 'DateTime', - 'bool', - 'boolean', - 'byte', - 'double', - 'float', - 'int', - 'integer', - 'mixed', - 'number', - 'object', - 'string', - 'void' - ], - true - ) - ) { + } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { settype($data, $class); return $data; } elseif ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if ( - array_key_exists('Content-Disposition', $httpHeaders) && - preg_match( - '/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', - $httpHeaders['Content-Disposition'], - $match - ) - ) { - $filename = - Configuration::getDefaultConfiguration()->getTempFolderPath() . - DIRECTORY_SEPARATOR . - self::sanitizeFilename($match[1]); + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); } else { - $filename = tempnam( - Configuration::getDefaultConfiguration()->getTempFolderPath(), - '' - ); + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); } $file = fopen($filename, 'w'); - while (($chunk = $data->read(200))) { + while ($chunk = $data->read(200)) { fwrite($file, $chunk); } fclose($file); @@ -382,21 +297,15 @@ public static function deserialize($data, $class, $httpHeaders = null) } elseif (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); - throw new \InvalidArgumentException( - "Invalid value for enum '$class', must be one of: '$imploded'" - ); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); } return $data; } else { $data = is_string($data) ? json_decode($data) : $data; // If a discriminator is defined and points to a valid subclass, use it. $discriminator = $class::DISCRIMINATOR; - if ( - !empty($discriminator) && - isset($data->$discriminator) && - is_string($data->$discriminator) - ) { - $subclass = '\OpenAPI\Client\Model\\' . $data->$discriminator; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\OpenAPI\Client\Model\\' . $data->{$discriminator}; if (is_subclass_of($subclass, $class)) { $class = $subclass; } @@ -405,18 +314,13 @@ public static function deserialize($data, $class, $httpHeaders = null) foreach ($instance::openAPITypes() as $property => $type) { $propertySetter = $instance::setters()[$property]; - if ( - !isset($propertySetter) || - !isset($data->{$instance::attributeMap()[$property]}) - ) { + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { continue; } $propertyValue = $data->{$instance::attributeMap()[$property]}; if (isset($propertyValue)) { - $instance->$propertySetter( - self::deserialize($propertyValue, $type, null) - ); + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); } } return $instance; diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php index 65c28be5c112..2880f5ba9b12 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/AnotherFakeApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use OpenAPI\Client\Configuration; -use OpenAPI\Client\ApiException; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\Configuration; +use \OpenAPI\Client\ApiException; +use \OpenAPI\Client\ObjectSerializer; /** * AnotherFakeApiTest Class Doc Comment @@ -42,6 +42,7 @@ */ class AnotherFakeApiTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php index 326b48238d16..c8a1b219b3a9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use OpenAPI\Client\Configuration; -use OpenAPI\Client\ApiException; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\Configuration; +use \OpenAPI\Client\ApiException; +use \OpenAPI\Client\ObjectSerializer; /** * FakeApiTest Class Doc Comment @@ -42,6 +42,7 @@ */ class FakeApiTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php index c72c5d54e0fb..718fbcb30e9e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/FakeClassnameTags123ApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use OpenAPI\Client\Configuration; -use OpenAPI\Client\ApiException; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\Configuration; +use \OpenAPI\Client\ApiException; +use \OpenAPI\Client\ObjectSerializer; /** * FakeClassnameTags123ApiTest Class Doc Comment @@ -42,6 +42,7 @@ */ class FakeClassnameTags123ApiTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php index c5189f841eb3..40e20ba9f2f1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/PetApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use OpenAPI\Client\Configuration; -use OpenAPI\Client\ApiException; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\Configuration; +use \OpenAPI\Client\ApiException; +use \OpenAPI\Client\ObjectSerializer; /** * PetApiTest Class Doc Comment @@ -42,6 +42,7 @@ */ class PetApiTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php index 7cf1da1bbc33..fa689746517c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/StoreApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use OpenAPI\Client\Configuration; -use OpenAPI\Client\ApiException; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\Configuration; +use \OpenAPI\Client\ApiException; +use \OpenAPI\Client\ObjectSerializer; /** * StoreApiTest Class Doc Comment @@ -42,6 +42,7 @@ */ class StoreApiTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php index acaabeeb1e74..a904c3bfe062 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Api/UserApiTest.php @@ -15,7 +15,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -28,9 +28,9 @@ namespace OpenAPI\Client; -use OpenAPI\Client\Configuration; -use OpenAPI\Client\ApiException; -use OpenAPI\Client\ObjectSerializer; +use \OpenAPI\Client\Configuration; +use \OpenAPI\Client\ApiException; +use \OpenAPI\Client\ObjectSerializer; /** * UserApiTest Class Doc Comment @@ -42,6 +42,7 @@ */ class UserApiTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test cases */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php index d253cb7e2245..dfae0c32c4c9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class AdditionalPropertiesClassTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php index ca36a90ad2d7..ac52c8db220b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalFarmTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class AnimalFarmTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php index a7162d3423e2..b8c08fc9a923 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/AnimalTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class AnimalTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php index ea63b31267b8..942391c06b0e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ApiResponseTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ApiResponseTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php index 18203666b3e5..2a1ae856c0d1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfArrayOfNumberOnlyTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ArrayOfArrayOfNumberOnlyTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php index 75bc397d51d3..2728b43e7ab9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayOfNumberOnlyTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ArrayOfNumberOnlyTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php index 8da5687d6f43..fce5ac1a44a9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ArrayTestTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ArrayTestTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php index 188ca81d79ad..ded18109da5c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CapitalizationTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class CapitalizationTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php index 49dbc357e51e..de5fb181c6d2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CatTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class CatTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php index bb50f085458b..421c8d2fae76 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/CategoryTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class CategoryTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php index ba8d22a7e147..02997e5c669f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClassModelTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ClassModelTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php index a9a103064c95..2e02a439db00 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ClientTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ClientTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php index 880038b13242..d39130d1b3ac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/DogTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class DogTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php index 08e6ea80c47a..edec02ad0af8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumArraysTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class EnumArraysTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php index 1689b4e68db9..f0575cdbe96d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumClassTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class EnumClassTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php index 6a01b4e2f28a..e968f550bdeb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/EnumTestTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class EnumTestTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php index 6670ebc88b24..68b2bb73f160 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileSchemaTestClassTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class FileSchemaTestClassTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php index 574d04b3b517..ee9aab521737 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FileTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class FileTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php index 4331a61a0346..bb4992a126b6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/FormatTestTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class FormatTestTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php index 6099e3885611..552ebf8b435b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/HasOnlyReadOnlyTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class HasOnlyReadOnlyTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php index 0093cd0ac378..cdf7cbbce514 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MapTestTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class MapTestTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php index edcca2f85dc3..2830f1165f99 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/MixedPropertiesAndAdditionalPropertiesClassTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -38,9 +38,9 @@ * @author OpenAPI Generator team * @link https://openapi-generator.tech */ -class MixedPropertiesAndAdditionalPropertiesClassTest extends - \PHPUnit_Framework_TestCase +class MixedPropertiesAndAdditionalPropertiesClassTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php index bb9d5f019676..ee972620fc13 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/Model200ResponseTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class Model200ResponseTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php index 8c5d4fcebc4f..9786a3f7dae6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelListTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ModelListTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php index 6b92c6c195ff..fc7147e7265b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ModelReturnTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ModelReturnTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php index 53e726a8c5ff..39045f66a0b9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NameTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class NameTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php index bb47fbb9a3d6..2d0f99e11e29 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/NumberOnlyTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class NumberOnlyTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php index fb4d262d57c1..33e14de9e05d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OrderTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class OrderTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php index 4ba25e254d43..9735a5612bfb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterCompositeTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class OuterCompositeTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php index e99fbe006066..be04ee705cfb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/OuterEnumTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class OuterEnumTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php index c55dd6e19390..ce886a65f60a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/PetTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class PetTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php index cbee4c517f10..35128f767980 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/ReadOnlyFirstTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class ReadOnlyFirstTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php index be5e0529cdfd..0d7fb2d540e6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/SpecialModelNameTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class SpecialModelNameTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php index 125910a1a393..990cf5d8e3c2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/StringBooleanMapTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class StringBooleanMapTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php index fc98cc8fac92..72ed9d787f41 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/TagTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class TagTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */ diff --git a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php index 2872cbdc9953..28ea7bc47c3d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/test/Model/UserTest.php @@ -16,7 +16,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 - * + * * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 3.3.3-SNAPSHOT */ @@ -40,6 +40,7 @@ */ class UserTest extends \PHPUnit_Framework_TestCase { + /** * Setup before running any test case */