From 1f02fd281f30a644eb4e9d4ddfcb8c73b92247fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Sat, 14 May 2016 13:04:23 +0200 Subject: [PATCH] [PHP] Regenerate petstore sample --- .../petstore/php/SwaggerClient-php/README.md | 14 +- .../php/SwaggerClient-php/lib/Api/FakeApi.php | 15 +- .../php/SwaggerClient-php/lib/Api/PetApi.php | 156 ++++++++++-------- .../SwaggerClient-php/lib/Api/StoreApi.php | 90 +++++----- .../php/SwaggerClient-php/lib/Api/UserApi.php | 130 ++++++++------- .../php/SwaggerClient-php/lib/ApiClient.php | 33 ++-- .../SwaggerClient-php/lib/ApiException.php | 2 +- .../SwaggerClient-php/lib/Configuration.php | 11 +- .../SwaggerClient-php/lib/Model/Animal.php | 26 +-- .../lib/Model/AnimalFarm.php | 22 +-- .../lib/Model/ApiResponse.php | 28 ++-- .../php/SwaggerClient-php/lib/Model/Cat.php | 24 +-- .../SwaggerClient-php/lib/Model/Category.php | 26 +-- .../php/SwaggerClient-php/lib/Model/Dog.php | 24 +-- .../SwaggerClient-php/lib/Model/EnumClass.php | 22 +-- .../SwaggerClient-php/lib/Model/EnumTest.php | 28 ++-- .../lib/Model/FormatTest.php | 48 +++--- .../lib/Model/Model200Response.php | 23 +-- .../lib/Model/ModelReturn.php | 23 +-- .../php/SwaggerClient-php/lib/Model/Name.php | 29 ++-- .../php/SwaggerClient-php/lib/Model/Order.php | 32 ++-- .../php/SwaggerClient-php/lib/Model/Pet.php | 32 ++-- .../lib/Model/SpecialModelName.php | 24 +-- .../php/SwaggerClient-php/lib/Model/Tag.php | 26 +-- .../php/SwaggerClient-php/lib/Model/User.php | 36 ++-- .../lib/ObjectSerializer.php | 10 +- .../lib/Tests/AnimalFarmTest.php | 73 -------- .../lib/Tests/AnimalTest.php | 73 -------- .../lib/Tests/ApiResponseTest.php | 73 -------- .../SwaggerClient-php/lib/Tests/CatTest.php | 73 -------- .../lib/Tests/CategoryTest.php | 73 -------- .../SwaggerClient-php/lib/Tests/DogTest.php | 73 -------- .../lib/Tests/EnumClassTest.php | 73 -------- .../lib/Tests/EnumTestTest.php | 73 -------- .../lib/Tests/FormatTestTest.php | 73 -------- .../lib/Tests/Model200ResponseTest.php | 73 -------- .../lib/Tests/ModelReturnTest.php | 73 -------- .../SwaggerClient-php/lib/Tests/NameTest.php | 73 -------- .../SwaggerClient-php/lib/Tests/OrderTest.php | 73 -------- .../SwaggerClient-php/lib/Tests/PetTest.php | 73 -------- .../lib/Tests/SpecialModelNameTest.php | 73 -------- .../SwaggerClient-php/lib/Tests/TagTest.php | 73 -------- .../SwaggerClient-php/lib/Tests/UserTest.php | 73 -------- .../test/Api/FakeApiTest.php | 15 +- .../SwaggerClient-php/test/Api/PetApiTest.php | 50 +++--- .../test/Api/StoreApiTest.php | 30 ++-- .../test/Api/UserApiTest.php | 50 +++--- .../test/Model/AnimalFarmTest.php | 14 +- .../test/Model/AnimalTest.php | 14 +- .../test/Model/ApiResponseTest.php | 14 +- .../SwaggerClient-php/test/Model/CatTest.php | 14 +- .../test/Model/CategoryTest.php | 14 +- .../SwaggerClient-php/test/Model/DogTest.php | 14 +- .../test/Model/EnumClassTest.php | 14 +- .../test/Model/EnumTestTest.php | 14 +- .../test/Model/FormatTestTest.php | 14 +- .../test/Model/Model200ResponseTest.php | 12 +- .../test/Model/ModelReturnTest.php | 12 +- .../SwaggerClient-php/test/Model/NameTest.php | 12 +- .../test/Model/OrderTest.php | 14 +- .../SwaggerClient-php/test/Model/PetTest.php | 14 +- .../test/Model/SpecialModelNameTest.php | 14 +- .../SwaggerClient-php/test/Model/TagTest.php | 14 +- .../SwaggerClient-php/test/Model/UserTest.php | 14 +- 64 files changed, 723 insertions(+), 1829 deletions(-) delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/AnimalFarmTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/AnimalTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/ApiResponseTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/CatTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/CategoryTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/DogTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/EnumClassTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/EnumTestTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/FormatTestTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/Model200ResponseTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/ModelReturnTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/NameTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/OrderTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/SpecialModelNameTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/TagTest.php delete mode 100644 samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserTest.php diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 6385bef4e6b..9da8dacc922 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git - API version: 1.0.0 - Package version: -- Build date: 2016-05-14T17:06:01.056+08:00 +- Build date: 2016-05-14T13:02:51.476+02:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -134,12 +134,6 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## petstore_auth - **Type**: OAuth @@ -149,6 +143,12 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## Author diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index 794725eff23..63abb0c94b6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -62,7 +62,7 @@ class FakeApi * * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ - function __construct(\Swagger\Client\ApiClient $apiClient = null) + public function __construct(\Swagger\Client\ApiClient $apiClient = null) { if ($apiClient == null) { $apiClient = new ApiClient(); @@ -98,7 +98,7 @@ class FakeApi /** * Operation testEndpointParameters * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . * * @param float $number None (required) * @param double $double None (required) @@ -126,7 +126,7 @@ class FakeApi /** * Operation testEndpointParametersWithHttpInfo * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . * * @param float $number None (required) * @param double $double None (required) @@ -276,14 +276,15 @@ class FakeApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'POST', - $queryParams, $httpBody, + $resourcePath, + 'POST', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; 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 30a718c247d..402d727c5bf 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -62,7 +62,7 @@ class PetApi * * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ - function __construct(\Swagger\Client\ApiClient $apiClient = null) + public function __construct(\Swagger\Client\ApiClient $apiClient = null) { if ($apiClient == null) { $apiClient = new ApiClient(); @@ -98,7 +98,7 @@ class PetApi /** * Operation addPet * - * Add a new pet to the store + * Add a new pet to the store. * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * @@ -115,7 +115,7 @@ class PetApi /** * Operation addPetWithHttpInfo * - * Add a new pet to the store + * Add a new pet to the store. * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * @@ -169,14 +169,15 @@ class PetApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'POST', - $queryParams, $httpBody, + $resourcePath, + 'POST', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -185,7 +186,7 @@ class PetApi /** * Operation deletePet * - * Deletes a pet + * Deletes a pet. * * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) @@ -203,7 +204,7 @@ class PetApi /** * Operation deletePetWithHttpInfo * - * Deletes a pet + * Deletes a pet. * * @param int $pet_id Pet id to delete (required) * @param string $api_key (optional) @@ -264,14 +265,15 @@ class PetApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'DELETE', - $queryParams, $httpBody, + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -280,7 +282,7 @@ class PetApi /** * Operation findPetsByStatus * - * Finds Pets by status + * Finds Pets by status. * * @param string[] $status Status values that need to be considered for filter (required) * @@ -297,7 +299,7 @@ class PetApi /** * Operation findPetsByStatusWithHttpInfo * - * Finds Pets by status + * Finds Pets by status. * * @param string[] $status Status values that need to be considered for filter (required) * @@ -353,21 +355,24 @@ class PetApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'GET', - $queryParams, $httpBody, - $headerParams, '\Swagger\Client\Model\Pet[]' + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\Pet[]' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; @@ -376,7 +381,7 @@ class PetApi /** * Operation findPetsByTags * - * Finds Pets by tags + * Finds Pets by tags. * * @param string[] $tags Tags to filter by (required) * @@ -393,7 +398,7 @@ class PetApi /** * Operation findPetsByTagsWithHttpInfo * - * Finds Pets by tags + * Finds Pets by tags. * * @param string[] $tags Tags to filter by (required) * @@ -449,21 +454,24 @@ class PetApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'GET', - $queryParams, $httpBody, - $headerParams, '\Swagger\Client\Model\Pet[]' + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\Pet[]' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; @@ -472,7 +480,7 @@ class PetApi /** * Operation getPetById * - * Find pet by ID + * Find pet by ID. * * @param int $pet_id ID of pet to return (required) * @@ -489,7 +497,7 @@ class PetApi /** * Operation getPetByIdWithHttpInfo * - * Find pet by ID + * Find pet by ID. * * @param int $pet_id ID of pet to return (required) * @@ -548,21 +556,24 @@ class PetApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'GET', - $queryParams, $httpBody, - $headerParams, '\Swagger\Client\Model\Pet' + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\Pet' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Pet', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; @@ -571,7 +582,7 @@ class PetApi /** * Operation updatePet * - * Update an existing pet + * Update an existing pet. * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * @@ -588,7 +599,7 @@ class PetApi /** * Operation updatePetWithHttpInfo * - * Update an existing pet + * Update an existing pet. * * @param \Swagger\Client\Model\Pet $body Pet object that needs to be added to the store (required) * @@ -642,14 +653,15 @@ class PetApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'PUT', - $queryParams, $httpBody, + $resourcePath, + 'PUT', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -658,7 +670,7 @@ class PetApi /** * Operation updatePetWithForm * - * Updates a pet in the store with form data + * Updates a pet in the store with form data. * * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) @@ -677,7 +689,7 @@ class PetApi /** * Operation updatePetWithFormWithHttpInfo * - * Updates a pet in the store with form data + * Updates a pet in the store with form data. * * @param int $pet_id ID of pet that needs to be updated (required) * @param string $name Updated name of the pet (optional) @@ -742,14 +754,15 @@ class PetApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'POST', - $queryParams, $httpBody, + $resourcePath, + 'POST', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -758,7 +771,7 @@ class PetApi /** * Operation uploadFile * - * uploads an image + * uploads an image. * * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) @@ -777,7 +790,7 @@ class PetApi /** * Operation uploadFileWithHttpInfo * - * uploads an image + * uploads an image. * * @param int $pet_id ID of pet to update (required) * @param string $additional_metadata Additional data to pass to server (optional) @@ -829,7 +842,7 @@ class PetApi if (function_exists('curl_file_create')) { $formParams['file'] = curl_file_create($this->apiClient->getSerializer()->toFormValue($file)); } else { - $formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file); + $formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file); } } @@ -848,21 +861,24 @@ class PetApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'POST', - $queryParams, $httpBody, - $headerParams, '\Swagger\Client\Model\ApiResponse' + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\ApiResponse' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\ApiResponse', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\ApiResponse', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\ApiResponse', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index d05646adb68..cfc6ddba361 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -62,7 +62,7 @@ class StoreApi * * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ - function __construct(\Swagger\Client\ApiClient $apiClient = null) + public function __construct(\Swagger\Client\ApiClient $apiClient = null) { if ($apiClient == null) { $apiClient = new ApiClient(); @@ -98,7 +98,7 @@ class StoreApi /** * Operation deleteOrder * - * Delete purchase order by ID + * Delete purchase order by ID. * * @param string $order_id ID of the order that needs to be deleted (required) * @@ -115,7 +115,7 @@ class StoreApi /** * Operation deleteOrderWithHttpInfo * - * Delete purchase order by ID + * Delete purchase order by ID. * * @param string $order_id ID of the order that needs to be deleted (required) * @@ -171,14 +171,15 @@ class StoreApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'DELETE', - $queryParams, $httpBody, + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -187,7 +188,7 @@ class StoreApi /** * Operation getInventory * - * Returns pet inventories by status + * Returns pet inventories by status. * * * @return map[string,int] @@ -203,7 +204,7 @@ class StoreApi /** * Operation getInventoryWithHttpInfo * - * Returns pet inventories by status + * Returns pet inventories by status. * * * @return Array of map[string,int], HTTP status code, HTTP response headers (array of strings) @@ -249,21 +250,24 @@ class StoreApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'GET', - $queryParams, $httpBody, - $headerParams, 'map[string,int]' + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + 'map[string,int]' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, 'map[string,int]', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; @@ -272,7 +276,7 @@ class StoreApi /** * Operation getOrderById * - * Find purchase order by ID + * Find purchase order by ID. * * @param int $order_id ID of pet that needs to be fetched (required) * @@ -289,7 +293,7 @@ class StoreApi /** * Operation getOrderByIdWithHttpInfo * - * Find purchase order by ID + * Find purchase order by ID. * * @param int $order_id ID of pet that needs to be fetched (required) * @@ -348,21 +352,24 @@ class StoreApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'GET', - $queryParams, $httpBody, - $headerParams, '\Swagger\Client\Model\Order' + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\Order' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; @@ -371,7 +378,7 @@ class StoreApi /** * Operation placeOrder * - * Place an order for a pet + * Place an order for a pet. * * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * @@ -388,7 +395,7 @@ class StoreApi /** * Operation placeOrderWithHttpInfo * - * Place an order for a pet + * Place an order for a pet. * * @param \Swagger\Client\Model\Order $body order placed for purchasing the pet (required) * @@ -437,21 +444,24 @@ class StoreApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'POST', - $queryParams, $httpBody, - $headerParams, '\Swagger\Client\Model\Order' + $resourcePath, + 'POST', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\Order' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index aa57591b9e4..7d3188747a5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -62,7 +62,7 @@ class UserApi * * @param \Swagger\Client\ApiClient|null $apiClient The api client to use */ - function __construct(\Swagger\Client\ApiClient $apiClient = null) + public function __construct(\Swagger\Client\ApiClient $apiClient = null) { if ($apiClient == null) { $apiClient = new ApiClient(); @@ -98,7 +98,7 @@ class UserApi /** * Operation createUser * - * Create user + * Create user. * * @param \Swagger\Client\Model\User $body Created user object (required) * @@ -115,7 +115,7 @@ class UserApi /** * Operation createUserWithHttpInfo * - * Create user + * Create user. * * @param \Swagger\Client\Model\User $body Created user object (required) * @@ -164,14 +164,15 @@ class UserApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'POST', - $queryParams, $httpBody, + $resourcePath, + 'POST', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -180,7 +181,7 @@ class UserApi /** * Operation createUsersWithArrayInput * - * Creates list of users with given input array + * Creates list of users with given input array. * * @param \Swagger\Client\Model\User[] $body List of user object (required) * @@ -197,7 +198,7 @@ class UserApi /** * Operation createUsersWithArrayInputWithHttpInfo * - * Creates list of users with given input array + * Creates list of users with given input array. * * @param \Swagger\Client\Model\User[] $body List of user object (required) * @@ -246,14 +247,15 @@ class UserApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'POST', - $queryParams, $httpBody, + $resourcePath, + 'POST', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -262,7 +264,7 @@ class UserApi /** * Operation createUsersWithListInput * - * Creates list of users with given input array + * Creates list of users with given input array. * * @param \Swagger\Client\Model\User[] $body List of user object (required) * @@ -279,7 +281,7 @@ class UserApi /** * Operation createUsersWithListInputWithHttpInfo * - * Creates list of users with given input array + * Creates list of users with given input array. * * @param \Swagger\Client\Model\User[] $body List of user object (required) * @@ -328,14 +330,15 @@ class UserApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'POST', - $queryParams, $httpBody, + $resourcePath, + 'POST', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -344,7 +347,7 @@ class UserApi /** * Operation deleteUser * - * Delete user + * Delete user. * * @param string $username The name that needs to be deleted (required) * @@ -361,7 +364,7 @@ class UserApi /** * Operation deleteUserWithHttpInfo * - * Delete user + * Delete user. * * @param string $username The name that needs to be deleted (required) * @@ -413,14 +416,15 @@ class UserApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'DELETE', - $queryParams, $httpBody, + $resourcePath, + 'DELETE', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -429,7 +433,7 @@ class UserApi /** * Operation getUserByName * - * Get user by user name + * Get user by user name. * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * @@ -446,7 +450,7 @@ class UserApi /** * Operation getUserByNameWithHttpInfo * - * Get user by user name + * Get user by user name. * * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * @@ -498,21 +502,24 @@ class UserApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'GET', - $queryParams, $httpBody, - $headerParams, '\Swagger\Client\Model\User' + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + '\Swagger\Client\Model\User' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\User', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; @@ -521,7 +528,7 @@ class UserApi /** * Operation loginUser * - * Logs user into the system + * Logs user into the system. * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) @@ -539,7 +546,7 @@ class UserApi /** * Operation loginUserWithHttpInfo * - * Logs user into the system + * Logs user into the system. * * @param string $username The user name for login (required) * @param string $password The password for login in clear text (required) @@ -596,21 +603,24 @@ class UserApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'GET', - $queryParams, $httpBody, - $headerParams, 'string' + $resourcePath, + 'GET', + $queryParams, + $httpBody, + $headerParams, + 'string' ); if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader); - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); - $e->setResponseObject($data); - break; + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); + $e->setResponseObject($data); + break; } throw $e; @@ -619,7 +629,7 @@ class UserApi /** * Operation logoutUser * - * Logs out current logged in user session + * Logs out current logged in user session. * * * @return void @@ -635,7 +645,7 @@ class UserApi /** * Operation logoutUserWithHttpInfo * - * Logs out current logged in user session + * Logs out current logged in user session. * * * @return Array of null, HTTP status code, HTTP response headers (array of strings) @@ -674,14 +684,15 @@ class UserApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'GET', - $queryParams, $httpBody, + $resourcePath, + 'GET', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; @@ -690,7 +701,7 @@ class UserApi /** * Operation updateUser * - * Updated user + * Updated user. * * @param string $username name that need to be deleted (required) * @param \Swagger\Client\Model\User $body Updated user object (required) @@ -708,7 +719,7 @@ class UserApi /** * Operation updateUserWithHttpInfo * - * Updated user + * Updated user. * * @param string $username name that need to be deleted (required) * @param \Swagger\Client\Model\User $body Updated user object (required) @@ -770,14 +781,15 @@ class UserApi // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( - $resourcePath, 'PUT', - $queryParams, $httpBody, + $resourcePath, + 'PUT', + $queryParams, + $httpBody, $headerParams ); - return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { - switch ($e->getCode()) { + switch ($e->getCode()) { } throw $e; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php index 227d6b0d086..6370b9be7a5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php @@ -237,7 +237,7 @@ class ApiClient // Handle the response if ($response_info['http_code'] == 0) { throw new ApiException("API call to $url timed out: ".serialize($response_info), 0, null, null); - } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) { + } elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299) { // return raw body if response is a file if ($responseType == '\SplFileObject' || $responseType == 'string') { return array($http_body, $response_info['http_code'], $http_header); @@ -255,7 +255,9 @@ class ApiClient throw new ApiException( "[".$response_info['http_code']."] Error connecting to the API ($url)", - $response_info['http_code'], $http_header, $data + $response_info['http_code'], + $http_header, + $data ); } return array($data, $response_info['http_code'], $http_header); @@ -310,31 +312,26 @@ class ApiClient $headers = array(); $key = ''; - foreach(explode("\n", $raw_headers) as $h) - { + foreach (explode("\n", $raw_headers) as $h) { $h = explode(':', $h, 2); - if (isset($h[1])) - { - if (!isset($headers[$h[0]])) + if (isset($h[1])) { + if (!isset($headers[$h[0]])) { $headers[$h[0]] = trim($h[1]); - elseif (is_array($headers[$h[0]])) - { + } elseif (is_array($headers[$h[0]])) { $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); - } - else - { + } else { $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); } $key = $h[0]; - } - else - { - if (substr($h[0], 0, 1) == "\t") + } else { + if (substr($h[0], 0, 1) == "\t") { $headers[$key] .= "\r\n\t".trim($h[0]); - elseif (!$key) - $headers[0] = trim($h[0]);trim($h[0]); + } elseif (!$key) { + $headers[0] = trim($h[0]); + } + trim($h[0]); } } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php index 370e3f8796b..94421bac149 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiException.php @@ -75,7 +75,7 @@ class ApiException extends Exception * @param string $responseHeaders HTTP response header * @param mixed $responseBody HTTP body of the server response either as Json or string */ - public function __construct($message="", $code=0, $responseHeaders=null, $responseBody=null) + public function __construct($message = "", $code = 0, $responseHeaders = null, $responseBody = null) { parent::__construct($message, $code); $this->responseHeaders = $responseHeaders; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index ab6ebd899ac..33bf0e93651 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -47,7 +47,7 @@ namespace Swagger\Client; class Configuration { - private static $_defaultConfiguration = null; + private static $defaultConfiguration = null; /** * Associate array to store API key(s) @@ -487,11 +487,11 @@ class Configuration */ public static function getDefaultConfiguration() { - if (self::$_defaultConfiguration == null) { - self::$_defaultConfiguration = new Configuration(); + if (self::$defaultConfiguration == null) { + self::$defaultConfiguration = new Configuration(); } - return self::$_defaultConfiguration; + return self::$defaultConfiguration; } /** @@ -503,7 +503,7 @@ class Configuration */ public static function setDefaultConfiguration(Configuration $config) { - self::$_defaultConfiguration = $config; + self::$defaultConfiguration = $config; } /** @@ -522,5 +522,4 @@ class Configuration return $report; } - } 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 732153c3aab..6b05974a644 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -39,7 +39,6 @@ use \ArrayAccess; * Animal Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,18 +50,19 @@ class Animal implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Animal'; + protected static $swaggerModelName = 'Animal'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'class_name' => 'string', 'color' => 'string' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -70,12 +70,13 @@ class Animal implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'class_name' => 'className', 'color' => 'color' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -83,12 +84,13 @@ class Animal implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'class_name' => 'setClassName', 'color' => 'setColor' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -96,12 +98,12 @@ class Animal implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'class_name' => 'getClassName', 'color' => 'getColor' ); - static function getters() + public static function getters() { return self::$getters; } @@ -170,7 +172,7 @@ class Animal implements ArrayAccess /** * Sets class_name - * @param string $class_name + * @param string $class_name * @return $this */ public function setClassName($class_name) @@ -191,7 +193,7 @@ class Animal implements ArrayAccess /** * Sets color - * @param string $color + * @param string $color * @return $this */ public function setColor($color) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php index a3f43300e72..a699455bcf9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php @@ -39,7 +39,6 @@ use \ArrayAccess; * AnimalFarm Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,17 +50,18 @@ class AnimalFarm implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'AnimalFarm'; + protected static $swaggerModelName = 'AnimalFarm'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -69,11 +69,12 @@ class AnimalFarm implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -81,11 +82,12 @@ class AnimalFarm implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -93,11 +95,11 @@ class AnimalFarm implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( ); - static function getters() + public static function getters() { return self::$getters; } 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 b2a8628df50..53ced7e8810 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -39,7 +39,6 @@ use \ArrayAccess; * ApiResponse Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,19 +50,20 @@ class ApiResponse implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'ApiResponse'; + protected static $swaggerModelName = 'ApiResponse'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'code' => 'int', 'type' => 'string', 'message' => 'string' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -71,13 +71,14 @@ class ApiResponse implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'code' => 'code', 'type' => 'type', 'message' => 'message' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -85,13 +86,14 @@ class ApiResponse implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'code' => 'setCode', 'type' => 'setType', 'message' => 'setMessage' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -99,13 +101,13 @@ class ApiResponse implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'code' => 'getCode', 'type' => 'getType', 'message' => 'getMessage' ); - static function getters() + public static function getters() { return self::$getters; } @@ -165,7 +167,7 @@ class ApiResponse implements ArrayAccess /** * Sets code - * @param int $code + * @param int $code * @return $this */ public function setCode($code) @@ -186,7 +188,7 @@ class ApiResponse implements ArrayAccess /** * Sets type - * @param string $type + * @param string $type * @return $this */ public function setType($type) @@ -207,7 +209,7 @@ class ApiResponse implements ArrayAccess /** * Sets message - * @param string $message + * @param string $message * @return $this */ public function setMessage($message) 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 0c9f1c3652f..9eb4de596d8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -39,7 +39,6 @@ use \ArrayAccess; * Cat Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,17 +50,18 @@ class Cat extends Animal implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Cat'; + protected static $swaggerModelName = 'Cat'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'declawed' => 'bool' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes + parent::swaggerTypes(); } @@ -69,11 +69,12 @@ class Cat extends Animal implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'declawed' => 'declawed' ); - static function attributeMap() { + public static function attributeMap() + { return parent::attributeMap() + self::$attributeMap; } @@ -81,11 +82,12 @@ class Cat extends Animal implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'declawed' => 'setDeclawed' ); - static function setters() { + public static function setters() + { return parent::setters() + self::$setters; } @@ -93,11 +95,11 @@ class Cat extends Animal implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'declawed' => 'getDeclawed' ); - static function getters() + public static function getters() { return parent::getters() + self::$getters; } @@ -157,7 +159,7 @@ class Cat extends Animal implements ArrayAccess /** * Sets declawed - * @param bool $declawed + * @param bool $declawed * @return $this */ public function setDeclawed($declawed) 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 720e17a6200..8e3c5e6fb5e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -39,7 +39,6 @@ use \ArrayAccess; * Category Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,18 +50,19 @@ class Category implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Category'; + protected static $swaggerModelName = 'Category'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'id' => 'int', 'name' => 'string' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -70,12 +70,13 @@ class Category implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'id' => 'id', 'name' => 'name' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -83,12 +84,13 @@ class Category implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'id' => 'setId', 'name' => 'setName' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -96,12 +98,12 @@ class Category implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'id' => 'getId', 'name' => 'getName' ); - static function getters() + public static function getters() { return self::$getters; } @@ -160,7 +162,7 @@ class Category implements ArrayAccess /** * Sets id - * @param int $id + * @param int $id * @return $this */ public function setId($id) @@ -181,7 +183,7 @@ class Category implements ArrayAccess /** * Sets name - * @param string $name + * @param string $name * @return $this */ public function setName($name) 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 7e162508f5f..9212a8c5d3b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -39,7 +39,6 @@ use \ArrayAccess; * Dog Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,17 +50,18 @@ class Dog extends Animal implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Dog'; + protected static $swaggerModelName = 'Dog'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'breed' => 'string' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes + parent::swaggerTypes(); } @@ -69,11 +69,12 @@ class Dog extends Animal implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'breed' => 'breed' ); - static function attributeMap() { + public static function attributeMap() + { return parent::attributeMap() + self::$attributeMap; } @@ -81,11 +82,12 @@ class Dog extends Animal implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'breed' => 'setBreed' ); - static function setters() { + public static function setters() + { return parent::setters() + self::$setters; } @@ -93,11 +95,11 @@ class Dog extends Animal implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'breed' => 'getBreed' ); - static function getters() + public static function getters() { return parent::getters() + self::$getters; } @@ -157,7 +159,7 @@ class Dog extends Animal implements ArrayAccess /** * Sets breed - * @param string $breed + * @param string $breed * @return $this */ public function setBreed($breed) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php index a4f045db926..71fb3357d14 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php @@ -39,7 +39,6 @@ use \ArrayAccess; * EnumClass Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,17 +50,18 @@ class EnumClass implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'EnumClass'; + protected static $swaggerModelName = 'EnumClass'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -69,11 +69,12 @@ class EnumClass implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -81,11 +82,12 @@ class EnumClass implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -93,11 +95,11 @@ class EnumClass implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( ); - static function getters() + public static function getters() { return self::$getters; } 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 e1cf6f4a0b2..77751f9c43f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -39,7 +39,6 @@ use \ArrayAccess; * EnumTest Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,19 +50,20 @@ class EnumTest implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Enum_Test'; + protected static $swaggerModelName = 'Enum_Test'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'enum_string' => 'string', 'enum_integer' => 'int', 'enum_number' => 'double' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -71,13 +71,14 @@ class EnumTest implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'enum_string' => 'enum_string', 'enum_integer' => 'enum_integer', 'enum_number' => 'enum_number' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -85,13 +86,14 @@ class EnumTest implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'enum_string' => 'setEnumString', 'enum_integer' => 'setEnumInteger', 'enum_number' => 'setEnumNumber' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -99,13 +101,13 @@ class EnumTest implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'enum_string' => 'getEnumString', 'enum_integer' => 'getEnumInteger', 'enum_number' => 'getEnumNumber' ); - static function getters() + public static function getters() { return self::$getters; } @@ -231,7 +233,7 @@ class EnumTest implements ArrayAccess /** * Sets enum_string - * @param string $enum_string + * @param string $enum_string * @return $this */ public function setEnumString($enum_string) @@ -256,7 +258,7 @@ class EnumTest implements ArrayAccess /** * Sets enum_integer - * @param int $enum_integer + * @param int $enum_integer * @return $this */ public function setEnumInteger($enum_integer) @@ -281,7 +283,7 @@ class EnumTest implements ArrayAccess /** * Sets enum_number - * @param double $enum_number + * @param double $enum_number * @return $this */ public function setEnumNumber($enum_number) 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 7cbfc09c168..07148e70189 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -39,7 +39,6 @@ use \ArrayAccess; * FormatTest Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,13 +50,13 @@ class FormatTest implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'format_test'; + protected static $swaggerModelName = 'format_test'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'integer' => 'int', 'int32' => 'int', 'int64' => 'int', @@ -73,7 +72,8 @@ class FormatTest implements ArrayAccess 'password' => 'string' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -81,7 +81,7 @@ class FormatTest implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'integer' => 'integer', 'int32' => 'int32', 'int64' => 'int64', @@ -97,7 +97,8 @@ class FormatTest implements ArrayAccess 'password' => 'password' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -105,7 +106,7 @@ class FormatTest implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'integer' => 'setInteger', 'int32' => 'setInt32', 'int64' => 'setInt64', @@ -121,7 +122,8 @@ class FormatTest implements ArrayAccess 'password' => 'setPassword' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -129,7 +131,7 @@ class FormatTest implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'integer' => 'getInteger', 'int32' => 'getInt32', 'int64' => 'getInt64', @@ -145,7 +147,7 @@ class FormatTest implements ArrayAccess 'password' => 'getPassword' ); - static function getters() + public static function getters() { return self::$getters; } @@ -317,7 +319,7 @@ class FormatTest implements ArrayAccess /** * Sets integer - * @param int $integer + * @param int $integer * @return $this */ public function setInteger($integer) @@ -345,7 +347,7 @@ class FormatTest implements ArrayAccess /** * Sets int32 - * @param int $int32 + * @param int $int32 * @return $this */ public function setInt32($int32) @@ -373,7 +375,7 @@ class FormatTest implements ArrayAccess /** * Sets int64 - * @param int $int64 + * @param int $int64 * @return $this */ public function setInt64($int64) @@ -394,7 +396,7 @@ class FormatTest implements ArrayAccess /** * Sets number - * @param float $number + * @param float $number * @return $this */ public function setNumber($number) @@ -422,7 +424,7 @@ class FormatTest implements ArrayAccess /** * Sets float - * @param float $float + * @param float $float * @return $this */ public function setFloat($float) @@ -450,7 +452,7 @@ class FormatTest implements ArrayAccess /** * Sets double - * @param double $double + * @param double $double * @return $this */ public function setDouble($double) @@ -478,7 +480,7 @@ class FormatTest implements ArrayAccess /** * Sets string - * @param string $string + * @param string $string * @return $this */ public function setString($string) @@ -503,7 +505,7 @@ class FormatTest implements ArrayAccess /** * Sets byte - * @param string $byte + * @param string $byte * @return $this */ public function setByte($byte) @@ -524,7 +526,7 @@ class FormatTest implements ArrayAccess /** * Sets binary - * @param string $binary + * @param string $binary * @return $this */ public function setBinary($binary) @@ -545,7 +547,7 @@ class FormatTest implements ArrayAccess /** * Sets date - * @param \DateTime $date + * @param \DateTime $date * @return $this */ public function setDate($date) @@ -566,7 +568,7 @@ class FormatTest implements ArrayAccess /** * Sets date_time - * @param \DateTime $date_time + * @param \DateTime $date_time * @return $this */ public function setDateTime($date_time) @@ -587,7 +589,7 @@ class FormatTest implements ArrayAccess /** * Sets uuid - * @param string $uuid + * @param string $uuid * @return $this */ public function setUuid($uuid) @@ -608,7 +610,7 @@ class FormatTest implements ArrayAccess /** * Sets password - * @param string $password + * @param string $password * @return $this */ public function setPassword($password) 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 989602fa2c5..88a28981f29 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -51,17 +51,18 @@ class Model200Response implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = '200_response'; + protected static $swaggerModelName = '200_response'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'name' => 'int' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -69,11 +70,12 @@ class Model200Response implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'name' => 'name' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -81,11 +83,12 @@ class Model200Response implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'name' => 'setName' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -93,11 +96,11 @@ class Model200Response implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'name' => 'getName' ); - static function getters() + public static function getters() { return self::$getters; } @@ -155,7 +158,7 @@ class Model200Response implements ArrayAccess /** * Sets name - * @param int $name + * @param int $name * @return $this */ public function setName($name) 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 64a19e20cf8..d1b188ff231 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -51,17 +51,18 @@ class ModelReturn implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Return'; + protected static $swaggerModelName = 'Return'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'return' => 'int' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -69,11 +70,12 @@ class ModelReturn implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'return' => 'return' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -81,11 +83,12 @@ class ModelReturn implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'return' => 'setReturn' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -93,11 +96,11 @@ class ModelReturn implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'return' => 'getReturn' ); - static function getters() + public static function getters() { return self::$getters; } @@ -155,7 +158,7 @@ class ModelReturn implements ArrayAccess /** * Sets return - * @param int $return + * @param int $return * @return $this */ public function setReturn($return) 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 4caea36ff6d..294d45dffe3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -51,20 +51,21 @@ class Name implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Name'; + protected static $swaggerModelName = 'Name'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'name' => 'int', 'snake_case' => 'int', 'property' => 'string', '_123_number' => 'int' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -72,14 +73,15 @@ class Name implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'name' => 'name', 'snake_case' => 'snake_case', 'property' => 'property', '_123_number' => '123Number' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -87,14 +89,15 @@ class Name implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'name' => 'setName', 'snake_case' => 'setSnakeCase', 'property' => 'setProperty', '_123_number' => 'set123Number' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -102,14 +105,14 @@ class Name implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'name' => 'getName', 'snake_case' => 'getSnakeCase', 'property' => 'getProperty', '_123_number' => 'get123Number' ); - static function getters() + public static function getters() { return self::$getters; } @@ -176,7 +179,7 @@ class Name implements ArrayAccess /** * Sets name - * @param int $name + * @param int $name * @return $this */ public function setName($name) @@ -197,7 +200,7 @@ class Name implements ArrayAccess /** * Sets snake_case - * @param int $snake_case + * @param int $snake_case * @return $this */ public function setSnakeCase($snake_case) @@ -218,7 +221,7 @@ class Name implements ArrayAccess /** * Sets property - * @param string $property + * @param string $property * @return $this */ public function setProperty($property) @@ -239,7 +242,7 @@ class Name implements ArrayAccess /** * Sets _123_number - * @param int $_123_number + * @param int $_123_number * @return $this */ public function set123Number($_123_number) 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 ff4feaecd85..3bd377eae71 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -39,7 +39,6 @@ use \ArrayAccess; * Order Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,13 +50,13 @@ class Order implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Order'; + protected static $swaggerModelName = 'Order'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'id' => 'int', 'pet_id' => 'int', 'quantity' => 'int', @@ -66,7 +65,8 @@ class Order implements ArrayAccess 'complete' => 'bool' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -74,7 +74,7 @@ class Order implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'id' => 'id', 'pet_id' => 'petId', 'quantity' => 'quantity', @@ -83,7 +83,8 @@ class Order implements ArrayAccess 'complete' => 'complete' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -91,7 +92,7 @@ class Order implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'id' => 'setId', 'pet_id' => 'setPetId', 'quantity' => 'setQuantity', @@ -100,7 +101,8 @@ class Order implements ArrayAccess 'complete' => 'setComplete' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -108,7 +110,7 @@ class Order implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'id' => 'getId', 'pet_id' => 'getPetId', 'quantity' => 'getQuantity', @@ -117,7 +119,7 @@ class Order implements ArrayAccess 'complete' => 'getComplete' ); - static function getters() + public static function getters() { return self::$getters; } @@ -204,7 +206,7 @@ class Order implements ArrayAccess /** * Sets id - * @param int $id + * @param int $id * @return $this */ public function setId($id) @@ -225,7 +227,7 @@ class Order implements ArrayAccess /** * Sets pet_id - * @param int $pet_id + * @param int $pet_id * @return $this */ public function setPetId($pet_id) @@ -246,7 +248,7 @@ class Order implements ArrayAccess /** * Sets quantity - * @param int $quantity + * @param int $quantity * @return $this */ public function setQuantity($quantity) @@ -267,7 +269,7 @@ class Order implements ArrayAccess /** * Sets ship_date - * @param \DateTime $ship_date + * @param \DateTime $ship_date * @return $this */ public function setShipDate($ship_date) @@ -313,7 +315,7 @@ class Order implements ArrayAccess /** * Sets complete - * @param bool $complete + * @param bool $complete * @return $this */ public function setComplete($complete) 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 f7e489f30ce..378c979629c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -39,7 +39,6 @@ use \ArrayAccess; * Pet Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,13 +50,13 @@ class Pet implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Pet'; + protected static $swaggerModelName = 'Pet'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'id' => 'int', 'category' => '\Swagger\Client\Model\Category', 'name' => 'string', @@ -66,7 +65,8 @@ class Pet implements ArrayAccess 'status' => 'string' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -74,7 +74,7 @@ class Pet implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'id' => 'id', 'category' => 'category', 'name' => 'name', @@ -83,7 +83,8 @@ class Pet implements ArrayAccess 'status' => 'status' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -91,7 +92,7 @@ class Pet implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'id' => 'setId', 'category' => 'setCategory', 'name' => 'setName', @@ -100,7 +101,8 @@ class Pet implements ArrayAccess 'status' => 'setStatus' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -108,7 +110,7 @@ class Pet implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'id' => 'getId', 'category' => 'getCategory', 'name' => 'getName', @@ -117,7 +119,7 @@ class Pet implements ArrayAccess 'status' => 'getStatus' ); - static function getters() + public static function getters() { return self::$getters; } @@ -216,7 +218,7 @@ class Pet implements ArrayAccess /** * Sets id - * @param int $id + * @param int $id * @return $this */ public function setId($id) @@ -237,7 +239,7 @@ class Pet implements ArrayAccess /** * Sets category - * @param \Swagger\Client\Model\Category $category + * @param \Swagger\Client\Model\Category $category * @return $this */ public function setCategory($category) @@ -258,7 +260,7 @@ class Pet implements ArrayAccess /** * Sets name - * @param string $name + * @param string $name * @return $this */ public function setName($name) @@ -279,7 +281,7 @@ class Pet implements ArrayAccess /** * Sets photo_urls - * @param string[] $photo_urls + * @param string[] $photo_urls * @return $this */ public function setPhotoUrls($photo_urls) @@ -300,7 +302,7 @@ class Pet implements ArrayAccess /** * Sets tags - * @param \Swagger\Client\Model\Tag[] $tags + * @param \Swagger\Client\Model\Tag[] $tags * @return $this */ public function setTags($tags) 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 00d6d960e07..025ee4b7b3b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -39,7 +39,6 @@ use \ArrayAccess; * SpecialModelName Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,17 +50,18 @@ class SpecialModelName implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = '$special[model.name]'; + protected static $swaggerModelName = '$special[model.name]'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'special_property_name' => 'int' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -69,11 +69,12 @@ class SpecialModelName implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'special_property_name' => '$special[property.name]' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -81,11 +82,12 @@ class SpecialModelName implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'special_property_name' => 'setSpecialPropertyName' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -93,11 +95,11 @@ class SpecialModelName implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'special_property_name' => 'getSpecialPropertyName' ); - static function getters() + public static function getters() { return self::$getters; } @@ -155,7 +157,7 @@ class SpecialModelName implements ArrayAccess /** * Sets special_property_name - * @param int $special_property_name + * @param int $special_property_name * @return $this */ public function setSpecialPropertyName($special_property_name) 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 19f44cc9456..8fba6e43dd8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -39,7 +39,6 @@ use \ArrayAccess; * Tag Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,18 +50,19 @@ class Tag implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'Tag'; + protected static $swaggerModelName = 'Tag'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'id' => 'int', 'name' => 'string' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -70,12 +70,13 @@ class Tag implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'id' => 'id', 'name' => 'name' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -83,12 +84,13 @@ class Tag implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'id' => 'setId', 'name' => 'setName' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -96,12 +98,12 @@ class Tag implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'id' => 'getId', 'name' => 'getName' ); - static function getters() + public static function getters() { return self::$getters; } @@ -160,7 +162,7 @@ class Tag implements ArrayAccess /** * Sets id - * @param int $id + * @param int $id * @return $this */ public function setId($id) @@ -181,7 +183,7 @@ class Tag implements ArrayAccess /** * Sets name - * @param string $name + * @param string $name * @return $this */ public function setName($name) 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 5de8893be43..04b4f749437 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -39,7 +39,6 @@ use \ArrayAccess; * User Class Doc Comment * * @category Class - * @description * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -51,13 +50,13 @@ class User implements ArrayAccess * The original name of the model. * @var string */ - static $swaggerModelName = 'User'; + protected static $swaggerModelName = 'User'; /** * Array of property to type mappings. Used for (de)serialization * @var string[] */ - static $swaggerTypes = array( + protected static $swaggerTypes = array( 'id' => 'int', 'username' => 'string', 'first_name' => 'string', @@ -68,7 +67,8 @@ class User implements ArrayAccess 'user_status' => 'int' ); - static function swaggerTypes() { + public static function swaggerTypes() + { return self::$swaggerTypes; } @@ -76,7 +76,7 @@ class User implements ArrayAccess * Array of attributes where the key is the local name, and the value is the original name * @var string[] */ - static $attributeMap = array( + protected static $attributeMap = array( 'id' => 'id', 'username' => 'username', 'first_name' => 'firstName', @@ -87,7 +87,8 @@ class User implements ArrayAccess 'user_status' => 'userStatus' ); - static function attributeMap() { + public static function attributeMap() + { return self::$attributeMap; } @@ -95,7 +96,7 @@ class User implements ArrayAccess * Array of attributes to setter functions (for deserialization of responses) * @var string[] */ - static $setters = array( + protected static $setters = array( 'id' => 'setId', 'username' => 'setUsername', 'first_name' => 'setFirstName', @@ -106,7 +107,8 @@ class User implements ArrayAccess 'user_status' => 'setUserStatus' ); - static function setters() { + public static function setters() + { return self::$setters; } @@ -114,7 +116,7 @@ class User implements ArrayAccess * Array of attributes to getter functions (for serialization of requests) * @var string[] */ - static $getters = array( + protected static $getters = array( 'id' => 'getId', 'username' => 'getUsername', 'first_name' => 'getFirstName', @@ -125,7 +127,7 @@ class User implements ArrayAccess 'user_status' => 'getUserStatus' ); - static function getters() + public static function getters() { return self::$getters; } @@ -190,7 +192,7 @@ class User implements ArrayAccess /** * Sets id - * @param int $id + * @param int $id * @return $this */ public function setId($id) @@ -211,7 +213,7 @@ class User implements ArrayAccess /** * Sets username - * @param string $username + * @param string $username * @return $this */ public function setUsername($username) @@ -232,7 +234,7 @@ class User implements ArrayAccess /** * Sets first_name - * @param string $first_name + * @param string $first_name * @return $this */ public function setFirstName($first_name) @@ -253,7 +255,7 @@ class User implements ArrayAccess /** * Sets last_name - * @param string $last_name + * @param string $last_name * @return $this */ public function setLastName($last_name) @@ -274,7 +276,7 @@ class User implements ArrayAccess /** * Sets email - * @param string $email + * @param string $email * @return $this */ public function setEmail($email) @@ -295,7 +297,7 @@ class User implements ArrayAccess /** * Sets password - * @param string $password + * @param string $password * @return $this */ public function setPassword($password) @@ -316,7 +318,7 @@ class User implements ArrayAccess /** * Sets phone - * @param string $phone + * @param string $phone * @return $this */ public function setPhone($phone) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index fa3abe1a22a..6d656ac2b97 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -185,7 +185,7 @@ class ObjectSerializer * * @return string */ - public function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti=false) + public function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) { if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { // http_build_query() almost does the job for us. We just @@ -219,7 +219,7 @@ class ObjectSerializer * * @return object an instance of $class */ - public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null) + public static function deserialize($data, $class, $httpHeaders = null, $discriminator = null) { if (null === $data) { return null; @@ -256,12 +256,13 @@ class ObjectSerializer } else { return null; } - } elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) { + } elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) { settype($data, $class); return $data; } elseif ($class === '\SplFileObject') { // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . sanitizeFilename($match[1]); } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); @@ -274,7 +275,6 @@ class ObjectSerializer } return $deserialized; - } else { // If a discriminator is defined and points to a valid subclass, use it. if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/AnimalFarmTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/AnimalFarmTest.php deleted file mode 100644 index 61797bfd16c..00000000000 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/AnimalFarmTest.php +++ /dev/null @@ -1,73 +0,0 @@ -