diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index a2247273df0..a360a0e87bf 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -84,7 +84,7 @@ use {{invokerPackage}}\ObjectSerializer; * {{/description}} {{#allParams}} - * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} + * @param {{dataType}} ${{paramName}}{{#description}} {{description}}{{/description}}{{^description}} {{paramName}}{{/description}} {{#required}}(required){{/required}}{{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}} * * @throws \{{invokerPackage}}\ApiException on non-2xx response diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache index 8305a7d293b..eab63f63a9c 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -335,7 +335,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa /** * Sets {{name}} * - * @param {{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}} + * @param {{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}}{{^description}} {{{name}}}{{/description}} * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 7e6e53dd932..83b6d6e01a1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -56,14 +56,14 @@ Please follow the [installation procedure](#installation--usage) and then run th fakeOuterBooleanSerialize($body); + $result = $api_instance->testSpecialTags($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling FakeApi->fakeOuterBooleanSerialize: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> @@ -75,6 +75,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**testSpecialTags**](docs/Api/AnotherFakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags *FakeApi* | [**fakeOuterBooleanSerialize**](docs/Api/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | *FakeApi* | [**fakeOuterCompositeSerialize**](docs/Api/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/Api/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | @@ -83,7 +84,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testEndpointParameters**](docs/Api/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/Api/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters *FakeApi* | [**testJsonFormData**](docs/Api/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -*Fake_classname_tags123Api* | [**testClassname**](docs/Api/Fake_classname_tags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case +*FakeClassnameTags123Api* | [**testClassname**](docs/Api/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *PetApi* | [**addPet**](docs/Api/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/Api/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/Api/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -104,7 +105,6 @@ Class | Method | HTTP request | Description *UserApi* | [**loginUser**](docs/Api/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system *UserApi* | [**logoutUser**](docs/Api/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session *UserApi* | [**updateUser**](docs/Api/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user -*AnotherfakeApi* | [**testSpecialTags**](docs/Api/AnotherfakeApi.md#testspecialtags) | **PATCH** /another-fake/dummy | To test special tags ## Documentation For Models diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md index 53bd4be8062..5b443618999 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/AnotherFakeApi.md @@ -1,10 +1,10 @@ -# Swagger\Client\AnotherfakeApi +# Swagger\Client\AnotherFakeApi All URIs are relative to *http://petstore.swagger.io:80/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**testSpecialTags**](AnotherfakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags +[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags # **testSpecialTags** @@ -19,14 +19,14 @@ To test special tags testSpecialTags($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling AnotherfakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling AnotherFakeApi->testSpecialTags: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md index 1691f3d27a8..20958d97da2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md @@ -259,7 +259,7 @@ $api_instance = new Swagger\Client\Api\FakeApi(new \Http\Adapter\Guzzle6\Client( $number = 3.4; // float | None $double = 1.2; // double | None $pattern_without_delimiter = "pattern_without_delimiter_example"; // string | None -$byte = "B"; // string | None +$byte = "byte_example"; // string | None $integer = 56; // int | None $int32 = 56; // int | None $int64 = 789; // int | None diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index a377df225db..9daa65eba7b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -87,7 +87,7 @@ This endpoint does not need any parameter. ### Return type -[**map[string,int]**](../Model/map.md) +**map[string,int]** ### Authorization diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php index 5e5ba412dd9..88ca1e9271f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -1,6 +1,6 @@ 299) { throw new ApiException( - "[$statusCode] Error connecting to the API ({$request->getUri()})", + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), $statusCode, $response->getHeaders(), $response->getBody() @@ -153,7 +159,11 @@ public function testClassnameWithHttpInfo($body) } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Client', $e->getResponseHeaders()); + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Client', + $e->getResponseHeaders() + ); $e->setResponseObject($data); break; } @@ -166,15 +176,19 @@ public function testClassnameWithHttpInfo($body) * * To test class name in snake case * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ public function testClassnameAsync($body) { - return $this->testClassnameAsyncWithHttpInfo($body)->then(function ($response) { - return $response[0]; - }); + return $this->testClassnameAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); } /** @@ -182,7 +196,8 @@ public function testClassnameAsync($body) * * To test class name in snake case * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ @@ -191,38 +206,48 @@ public function testClassnameAsyncWithHttpInfo($body) $returnType = '\Swagger\Client\Model\Client'; $request = $this->testClassnameRequest($body); - return $this->client->sendAsync($request)->then(function ($response) use ($returnType) { - $responseBody = $response->getBody(); - if ($returnType === '\SplFileObject') { - $content = $responseBody; //stream goes to serializer - } else { - $content = $responseBody->getContents(); - if ($returnType !== 'string') { - $content = json_decode($content); + return $this->client + ->sendAsync($request) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - "[$statusCode] Error connecting to the API ({$exception->getRequest()->getUri()})", - $statusCode, - $response->getHeaders(), - $response->getBody() ); - }); } /** * Create request for operation 'testClassname' * - * @param \Swagger\Client\Model\Client $body client model (required) + * @param \Swagger\Client\Model\Client $body client model (required) + * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ @@ -230,7 +255,9 @@ protected function testClassnameRequest($body) { // verify the required parameter 'body' is set if ($body === null) { - throw new \InvalidArgumentException('Missing the required parameter $body when calling testClassname'); + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling testClassname' + ); } $resourcePath = '/fake_classname_test'; @@ -272,13 +299,15 @@ protected function testClassnameRequest($body) 'contents' => $formParamValue ]; } - $httpBody = new MultipartStream($multipartContents); // for HTTP post (form) + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); // for HTTP post (form) + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } @@ -288,9 +317,6 @@ protected function testClassnameRequest($body) $queryParams['api_key_query'] = $apiKey; } - $query = \GuzzleHttp\Psr7\build_query($queryParams); - $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : ''); - $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); @@ -302,9 +328,10 @@ protected function testClassnameRequest($body) $headers ); + $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'PATCH', - $url, + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index 3214d9769e2..08b0596b7d5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -305,7 +305,7 @@ protected function addPetRequest($body) * Deletes a pet * * @param int $pet_id Pet id to delete (required) - * @param string $api_key (optional) + * @param string $api_key api_key (optional) * * @throws \Swagger\Client\ApiException on non-2xx response * @throws \InvalidArgumentException diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php index b7aa6634edb..1b0aed2b9dc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php @@ -223,7 +223,7 @@ public function getMapProperty() /** * Sets map_property * - * @param map[string,string] $map_property + * @param map[string,string] $map_property map_property * * @return $this */ @@ -247,7 +247,7 @@ public function getMapOfMapProperty() /** * Sets map_of_map_property * - * @param map[string,map[string,string]] $map_of_map_property + * @param map[string,map[string,string]] $map_of_map_property map_of_map_property * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php index ef8f4146bfc..016dd5f65c9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -233,7 +233,7 @@ public function getClassName() /** * Sets class_name * - * @param string $class_name + * @param string $class_name class_name * * @return $this */ @@ -257,7 +257,7 @@ public function getColor() /** * Sets color * - * @param string $color + * @param string $color color * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php index abdad1f0abf..5744956fe2a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -229,7 +229,7 @@ public function getCode() /** * Sets code * - * @param int $code + * @param int $code code * * @return $this */ @@ -253,7 +253,7 @@ public function getType() /** * Sets type * - * @param string $type + * @param string $type type * * @return $this */ @@ -277,7 +277,7 @@ public function getMessage() /** * Sets message * - * @param string $message + * @param string $message message * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index bbe57d45841..912e033cb0a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -217,7 +217,7 @@ public function getArrayArrayNumber() /** * Sets array_array_number * - * @param float[][] $array_array_number + * @param float[][] $array_array_number array_array_number * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php index 2469e34b7df..d15c791fc97 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayOfNumberOnly.php @@ -217,7 +217,7 @@ public function getArrayNumber() /** * Sets array_number * - * @param float[] $array_number + * @param float[] $array_number array_number * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php index fdd9c9e6238..0d5498db254 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ArrayTest.php @@ -229,7 +229,7 @@ public function getArrayOfString() /** * Sets array_of_string * - * @param string[] $array_of_string + * @param string[] $array_of_string array_of_string * * @return $this */ @@ -253,7 +253,7 @@ public function getArrayArrayOfInteger() /** * Sets array_array_of_integer * - * @param int[][] $array_array_of_integer + * @param int[][] $array_array_of_integer array_array_of_integer * * @return $this */ @@ -277,7 +277,7 @@ public function getArrayArrayOfModel() /** * Sets array_array_of_model * - * @param \Swagger\Client\Model\ReadOnlyFirst[][] $array_array_of_model + * @param \Swagger\Client\Model\ReadOnlyFirst[][] $array_array_of_model array_array_of_model * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php index 6beffb1c1e9..9c56f67aa5c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Capitalization.php @@ -247,7 +247,7 @@ public function getSmallCamel() /** * Sets small_camel * - * @param string $small_camel + * @param string $small_camel small_camel * * @return $this */ @@ -271,7 +271,7 @@ public function getCapitalCamel() /** * Sets capital_camel * - * @param string $capital_camel + * @param string $capital_camel capital_camel * * @return $this */ @@ -295,7 +295,7 @@ public function getSmallSnake() /** * Sets small_snake * - * @param string $small_snake + * @param string $small_snake small_snake * * @return $this */ @@ -319,7 +319,7 @@ public function getCapitalSnake() /** * Sets capital_snake * - * @param string $capital_snake + * @param string $capital_snake capital_snake * * @return $this */ @@ -343,7 +343,7 @@ public function getScaEthFlowPoints() /** * Sets sca_eth_flow_points * - * @param string $sca_eth_flow_points + * @param string $sca_eth_flow_points sca_eth_flow_points * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index 467d001fcf5..b7f63dab35b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -214,7 +214,7 @@ public function getDeclawed() /** * Sets declawed * - * @param bool $declawed + * @param bool $declawed declawed * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index 694f0f886fe..9f3cd6b4b76 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -223,7 +223,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -247,7 +247,7 @@ public function getName() /** * Sets name * - * @param string $name + * @param string $name name * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php index d3cffef6e30..901e3f7afdb 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ClassModel.php @@ -218,7 +218,7 @@ public function getClass() /** * Sets _class * - * @param string $_class + * @param string $_class _class * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php index 6fe33372b6b..737005b1d34 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Client.php @@ -217,7 +217,7 @@ public function getClient() /** * Sets client * - * @param string $client + * @param string $client client * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index 33f32068721..d49c050b366 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -214,7 +214,7 @@ public function getBreed() /** * Sets breed * - * @param string $breed + * @param string $breed breed * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php index d04608bd8dd..7d7ffaaea66 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumArrays.php @@ -265,7 +265,7 @@ public function getJustSymbol() /** * Sets just_symbol * - * @param string $just_symbol + * @param string $just_symbol just_symbol * * @return $this */ @@ -298,7 +298,7 @@ public function getArrayEnum() /** * Sets array_enum * - * @param string[] $array_enum + * @param string[] $array_enum array_enum * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php index 8b749a79e60..e47b3a303f8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -318,7 +318,7 @@ public function getEnumString() /** * Sets enum_string * - * @param string $enum_string + * @param string $enum_string enum_string * * @return $this */ @@ -351,7 +351,7 @@ public function getEnumInteger() /** * Sets enum_integer * - * @param int $enum_integer + * @param int $enum_integer enum_integer * * @return $this */ @@ -384,7 +384,7 @@ public function getEnumNumber() /** * Sets enum_number * - * @param double $enum_number + * @param double $enum_number enum_number * * @return $this */ @@ -417,7 +417,7 @@ public function getOuterEnum() /** * Sets outer_enum * - * @param \Swagger\Client\Model\OuterEnum $outer_enum + * @param \Swagger\Client\Model\OuterEnum $outer_enum outer_enum * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 338b19c1aa1..909cb9ecc37 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -310,6 +310,10 @@ public function listInvalidProperties() 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 ($this->container['date'] === null) { $invalidProperties[] = "'date' can't be null"; } @@ -375,6 +379,9 @@ public function valid() if ($this->container['byte'] === null) { return false; } + if (!preg_match("/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/", $this->container['byte'])) { + return false; + } if ($this->container['date'] === null) { return false; } @@ -404,7 +411,7 @@ public function getInteger() /** * Sets integer * - * @param int $integer + * @param int $integer integer * * @return $this */ @@ -436,7 +443,7 @@ public function getInt32() /** * Sets int32 * - * @param int $int32 + * @param int $int32 int32 * * @return $this */ @@ -468,7 +475,7 @@ public function getInt64() /** * Sets int64 * - * @param int $int64 + * @param int $int64 int64 * * @return $this */ @@ -492,7 +499,7 @@ public function getNumber() /** * Sets number * - * @param float $number + * @param float $number number * * @return $this */ @@ -524,7 +531,7 @@ public function getFloat() /** * Sets float * - * @param float $float + * @param float $float float * * @return $this */ @@ -556,7 +563,7 @@ public function getDouble() /** * Sets double * - * @param double $double + * @param double $double double * * @return $this */ @@ -588,7 +595,7 @@ public function getString() /** * Sets string * - * @param string $string + * @param string $string string * * @return $this */ @@ -617,12 +624,17 @@ public function getByte() /** * Sets byte * - * @param string $byte + * @param string $byte byte * * @return $this */ 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}=)?$/."); + } + $this->container['byte'] = $byte; return $this; @@ -641,7 +653,7 @@ public function getBinary() /** * Sets binary * - * @param string $binary + * @param string $binary binary * * @return $this */ @@ -665,7 +677,7 @@ public function getDate() /** * Sets date * - * @param \DateTime $date + * @param \DateTime $date date * * @return $this */ @@ -689,7 +701,7 @@ public function getDateTime() /** * Sets date_time * - * @param \DateTime $date_time + * @param \DateTime $date_time date_time * * @return $this */ @@ -713,7 +725,7 @@ public function getUuid() /** * Sets uuid * - * @param string $uuid + * @param string $uuid uuid * * @return $this */ @@ -737,7 +749,7 @@ public function getPassword() /** * Sets password * - * @param string $password + * @param string $password password * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php index 9deab454ca8..d45fcb7fbe4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/HasOnlyReadOnly.php @@ -223,7 +223,7 @@ public function getBar() /** * Sets bar * - * @param string $bar + * @param string $bar bar * * @return $this */ @@ -247,7 +247,7 @@ public function getFoo() /** * Sets foo * - * @param string $foo + * @param string $foo foo * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php index e2cd49676b5..be3206dd9b5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MapTest.php @@ -238,7 +238,7 @@ public function getMapMapOfString() /** * Sets map_map_of_string * - * @param map[string,map[string,string]] $map_map_of_string + * @param map[string,map[string,string]] $map_map_of_string map_map_of_string * * @return $this */ @@ -262,7 +262,7 @@ public function getMapOfEnumString() /** * Sets map_of_enum_string * - * @param map[string,string] $map_of_enum_string + * @param map[string,string] $map_of_enum_string map_of_enum_string * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 12cfd35160e..183f75381a8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -229,7 +229,7 @@ public function getUuid() /** * Sets uuid * - * @param string $uuid + * @param string $uuid uuid * * @return $this */ @@ -253,7 +253,7 @@ public function getDateTime() /** * Sets date_time * - * @param \DateTime $date_time + * @param \DateTime $date_time date_time * * @return $this */ @@ -277,7 +277,7 @@ public function getMap() /** * Sets map * - * @param map[string,\Swagger\Client\Model\Animal] $map + * @param map[string,\Swagger\Client\Model\Animal] $map map * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index ab75d0dee42..274368c3f06 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -224,7 +224,7 @@ public function getName() /** * Sets name * - * @param int $name + * @param int $name name * * @return $this */ @@ -248,7 +248,7 @@ public function getClass() /** * Sets class * - * @param string $class + * @param string $class class * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php index 29a20d70fb7..23adcb62ac7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelInterface.php @@ -18,7 +18,6 @@ * OpenAPI spec version: 1.0.0 * Contact: apiteam@swagger.io * Generated by: https://github.com/swagger-api/swagger-codegen.git - * */ /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php index 7c17be9b237..25b7d470e83 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelList.php @@ -217,7 +217,7 @@ public function get123List() /** * Sets _123_list * - * @param string $_123_list + * @param string $_123_list _123_list * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index fe1b72ec7ab..980992de818 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -218,7 +218,7 @@ public function getReturn() /** * Sets return * - * @param int $return + * @param int $return return * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index 90d8781e45a..c7604f6ca00 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -242,7 +242,7 @@ public function getName() /** * Sets name * - * @param int $name + * @param int $name name * * @return $this */ @@ -266,7 +266,7 @@ public function getSnakeCase() /** * Sets snake_case * - * @param int $snake_case + * @param int $snake_case snake_case * * @return $this */ @@ -290,7 +290,7 @@ public function getProperty() /** * Sets property * - * @param string $property + * @param string $property property * * @return $this */ @@ -314,7 +314,7 @@ public function get123Number() /** * Sets _123_number * - * @param int $_123_number + * @param int $_123_number _123_number * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php index f59fbfd6e1f..d19d010dbfc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/NumberOnly.php @@ -217,7 +217,7 @@ public function getJustNumber() /** * Sets just_number * - * @param float $just_number + * @param float $just_number just_number * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 5a70366e2d6..649eaace628 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -276,7 +276,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -300,7 +300,7 @@ public function getPetId() /** * Sets pet_id * - * @param int $pet_id + * @param int $pet_id pet_id * * @return $this */ @@ -324,7 +324,7 @@ public function getQuantity() /** * Sets quantity * - * @param int $quantity + * @param int $quantity quantity * * @return $this */ @@ -348,7 +348,7 @@ public function getShipDate() /** * Sets ship_date * - * @param \DateTime $ship_date + * @param \DateTime $ship_date ship_date * * @return $this */ @@ -405,7 +405,7 @@ public function getComplete() /** * Sets complete * - * @param bool $complete + * @param bool $complete complete * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php index 36c4a3856b3..a6b71edb108 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/OuterComposite.php @@ -229,7 +229,7 @@ public function getMyNumber() /** * Sets my_number * - * @param \Swagger\Client\Model\OuterNumber $my_number + * @param \Swagger\Client\Model\OuterNumber $my_number my_number * * @return $this */ @@ -253,7 +253,7 @@ public function getMyString() /** * Sets my_string * - * @param \Swagger\Client\Model\OuterString $my_string + * @param \Swagger\Client\Model\OuterString $my_string my_string * * @return $this */ @@ -277,7 +277,7 @@ public function getMyBoolean() /** * Sets my_boolean * - * @param \Swagger\Client\Model\OuterBoolean $my_boolean + * @param \Swagger\Client\Model\OuterBoolean $my_boolean my_boolean * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 382e5ee7672..30d04ccb2b0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -288,7 +288,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -312,7 +312,7 @@ public function getCategory() /** * Sets category * - * @param \Swagger\Client\Model\Category $category + * @param \Swagger\Client\Model\Category $category category * * @return $this */ @@ -336,7 +336,7 @@ public function getName() /** * Sets name * - * @param string $name + * @param string $name name * * @return $this */ @@ -360,7 +360,7 @@ public function getPhotoUrls() /** * Sets photo_urls * - * @param string[] $photo_urls + * @param string[] $photo_urls photo_urls * * @return $this */ @@ -384,7 +384,7 @@ public function getTags() /** * Sets tags * - * @param \Swagger\Client\Model\Tag[] $tags + * @param \Swagger\Client\Model\Tag[] $tags tags * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php index 36e14e910f1..f4931794d25 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php @@ -223,7 +223,7 @@ public function getBar() /** * Sets bar * - * @param string $bar + * @param string $bar bar * * @return $this */ @@ -247,7 +247,7 @@ public function getBaz() /** * Sets baz * - * @param string $baz + * @param string $baz baz * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index dba1e2d730e..7c69d553364 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -217,7 +217,7 @@ public function getSpecialPropertyName() /** * Sets special_property_name * - * @param int $special_property_name + * @param int $special_property_name special_property_name * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index d9ec6d40dcf..6223f4da216 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -223,7 +223,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -247,7 +247,7 @@ public function getName() /** * Sets name * - * @param string $name + * @param string $name name * * @return $this */ diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index 16553380b64..fef11caad56 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -259,7 +259,7 @@ public function getId() /** * Sets id * - * @param int $id + * @param int $id id * * @return $this */ @@ -283,7 +283,7 @@ public function getUsername() /** * Sets username * - * @param string $username + * @param string $username username * * @return $this */ @@ -307,7 +307,7 @@ public function getFirstName() /** * Sets first_name * - * @param string $first_name + * @param string $first_name first_name * * @return $this */ @@ -331,7 +331,7 @@ public function getLastName() /** * Sets last_name * - * @param string $last_name + * @param string $last_name last_name * * @return $this */ @@ -355,7 +355,7 @@ public function getEmail() /** * Sets email * - * @param string $email + * @param string $email email * * @return $this */ @@ -379,7 +379,7 @@ public function getPassword() /** * Sets password * - * @param string $password + * @param string $password password * * @return $this */ @@ -403,7 +403,7 @@ public function getPhone() /** * Sets phone * - * @param string $phone + * @param string $phone phone * * @return $this */