From 02ac7d93c59593333df0217981a538ec410f6ef8 Mon Sep 17 00:00:00 2001 From: wing328 Date: Tue, 29 Mar 2016 20:59:56 +0800 Subject: [PATCH 1/2] minor php code improvement --- .../src/main/resources/php/ApiClient.mustache | 32 +++---- .../resources/php/ObjectSerializer.mustache | 32 ++++--- .../src/main/resources/php/api.mustache | 10 +-- .../src/main/resources/php/model.mustache | 6 +- .../petstore/php/SwaggerClient-php/README.md | 4 +- .../php/SwaggerClient-php/lib/Api/PetApi.php | 86 +++++++++---------- .../SwaggerClient-php/lib/Api/StoreApi.php | 56 ++++++------ .../php/SwaggerClient-php/lib/Api/UserApi.php | 56 ++++++------ .../php/SwaggerClient-php/lib/ApiClient.php | 32 +++---- .../SwaggerClient-php/lib/Model/Animal.php | 6 +- .../php/SwaggerClient-php/lib/Model/Cat.php | 6 +- .../SwaggerClient-php/lib/Model/Category.php | 6 +- .../php/SwaggerClient-php/lib/Model/Dog.php | 6 +- .../lib/Model/InlineResponse200.php | 6 +- .../lib/Model/Model200Response.php | 6 +- .../lib/Model/ModelReturn.php | 6 +- .../php/SwaggerClient-php/lib/Model/Name.php | 6 +- .../php/SwaggerClient-php/lib/Model/Order.php | 6 +- .../php/SwaggerClient-php/lib/Model/Pet.php | 6 +- .../lib/Model/SpecialModelName.php | 6 +- .../php/SwaggerClient-php/lib/Model/Tag.php | 6 +- .../php/SwaggerClient-php/lib/Model/User.php | 6 +- .../lib/ObjectSerializer.php | 32 ++++--- 23 files changed, 206 insertions(+), 218 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache index 891149d8f55..7945137c664 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache @@ -259,7 +259,7 @@ class ApiClient * * @return string Accept (e.g. application/json) */ - public static function selectHeaderAccept($accept) + public function selectHeaderAccept($accept) { if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { return null; @@ -277,7 +277,7 @@ class ApiClient * * @return string Content-Type (e.g. application/json) */ - public static function selectHeaderContentType($content_type) + public function selectHeaderContentType($content_type) { if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { return 'application/json'; @@ -299,9 +299,9 @@ class ApiClient { // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 $headers = array(); - $key = ''; // [+] + $key = ''; - foreach(explode("\n", $raw_headers) as $i => $h) + foreach(explode("\n", $raw_headers) as $h) { $h = explode(':', $h, 2); @@ -311,26 +311,22 @@ class ApiClient $headers[$h[0]] = trim($h[1]); elseif (is_array($headers[$h[0]])) { - // $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); // [-] - // $headers[$h[0]] = $tmp; // [-] - $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); // [+] + $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); } else { - // $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [-] - // $headers[$h[0]] = $tmp; // [-] - $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [+] + $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); } - $key = $h[0]; // [+] + $key = $h[0]; + } + 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]); } - 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]); // [+] - } // [+] } return $headers; diff --git a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache index 759bf3c6bfb..34d79b0ae39 100644 --- a/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ObjectSerializer.mustache @@ -55,14 +55,14 @@ class ObjectSerializer public static function sanitizeForSerialization($data) { if (is_scalar($data) || null === $data) { - $sanitized = $data; + return $data; } elseif ($data instanceof \DateTime) { - $sanitized = $data->format(\DateTime::ATOM); + return $data->format(\DateTime::ATOM); } elseif (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } - $sanitized = $data; + return $data; } elseif (is_object($data)) { $values = array(); foreach (array_keys($data::swaggerTypes()) as $property) { @@ -71,12 +71,10 @@ class ObjectSerializer $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); } } - $sanitized = (object)$values; + return (object)$values; } else { - $sanitized = (string)$data; + return (string)$data; } - - return $sanitized; } /** @@ -224,7 +222,7 @@ class ObjectSerializer public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null) { if (null === $data) { - $deserialized = null; + return null; } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $inner = substr($class, 4, -1); $deserialized = array(); @@ -235,16 +233,17 @@ class ObjectSerializer $deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator); } } + return $deserialized; } elseif (strcasecmp(substr($class, -2), '[]') == 0) { $subClass = substr($class, 0, -2); $values = array(); foreach ($data as $key => $value) { $values[] = self::deserialize($value, $subClass, null, $discriminator); } - $deserialized = $values; + return $values; } elseif ($class === 'object') { settype($data, 'array'); - $deserialized = $data; + return $data; } elseif ($class === '\DateTime') { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return @@ -253,13 +252,13 @@ class ObjectSerializer // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - $deserialized = new \DateTime($data); + return new \DateTime($data); } else { - $deserialized = null; + return null; } } elseif (in_array($class, array({{&primitives}}))) { settype($data, $class); - $deserialized = $data; + 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)) { @@ -270,7 +269,8 @@ class ObjectSerializer $deserialized = new \SplFileObject($filename, "w"); $byte_written = $deserialized->fwrite($data); error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile()); - + 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})) { @@ -292,9 +292,7 @@ class ObjectSerializer $instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator)); } } - $deserialized = $instance; + return $instance; } - - return $deserialized; } } diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index adbbd8e1fe2..2692ba66f94 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -102,7 +102,7 @@ use \{{invokerPackage}}\ObjectSerializer; */ public function {{operationId}}({{#allParams}}${{paramName}}{{^required}} = null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { - list($response, $statusCode, $httpHeader) = $this->{{operationId}}WithHttpInfo ({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + list($response) = $this->{{operationId}}WithHttpInfo ({{#allParams}}${{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); return $response; } @@ -130,11 +130,11 @@ use \{{invokerPackage}}\ObjectSerializer; $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}})); + $_header_accept = $this->apiClient->selectHeaderAccept(array({{#produces}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/produces}})); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}})); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array({{#consumes}}'{{mediaType}}'{{#hasMore}},{{/hasMore}}{{/consumes}})); {{#queryParams}}// query params {{#collectionFormat}} @@ -223,14 +223,14 @@ use \{{invokerPackage}}\ObjectSerializer; return array(null, $statusCode, $httpHeader); } - return array(\{{invokerPackage}}\ObjectSerializer::deserialize($response, '{{returnType}}', $httpHeader{{#discriminator}}, '{{discriminator}}'{{/discriminator}}), $statusCode, $httpHeader); + return array($this->apiClient->getSerializer()->deserialize($response, '{{returnType}}', $httpHeader{{#discriminator}}, '{{discriminator}}'{{/discriminator}}), $statusCode, $httpHeader); {{/returnType}}{{^returnType}} return array(null, $statusCode, $httpHeader); {{/returnType}} } catch (ApiException $e) { switch ($e->getCode()) { {{#responses}}{{#dataType}} {{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} - $data = \{{invokerPackage}}\ObjectSerializer::deserialize($e->getResponseBody(), '{{dataType}}', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '{{dataType}}', $e->getResponseHeaders()); $e->setResponseObject($data); break;{{/dataType}}{{/responses}} } diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index b58af994c24..f19787f50b0 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -192,11 +192,11 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\{{invokerPackage}}\ObjectSerializer::sanitizeForSerialization($this)); } } {{/model}} diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 79dbf6ee5bf..17175dcb303 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -3,9 +3,9 @@ This is a sample server Petstore server. You can find out more about Swagger at This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: -- API version: 1.0.0 +- API verion: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-03-30T20:57:56.803+08:00 +- Build date: 2016-03-29T20:55:19.032+08:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements 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 5c2c0564c70..cf3d8e49d76 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -102,7 +102,7 @@ class PetApi */ public function addPet($body = null) { - list($response, $statusCode, $httpHeader) = $this->addPetWithHttpInfo ($body); + list($response) = $this->addPetWithHttpInfo ($body); return $response; } @@ -126,11 +126,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/xml')); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml')); @@ -186,7 +186,7 @@ class PetApi */ public function addPetUsingByteArray($body = null) { - list($response, $statusCode, $httpHeader) = $this->addPetUsingByteArrayWithHttpInfo ($body); + list($response) = $this->addPetUsingByteArrayWithHttpInfo ($body); return $response; } @@ -210,11 +210,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/xml')); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml')); @@ -271,7 +271,7 @@ class PetApi */ public function deletePet($pet_id, $api_key = null) { - list($response, $statusCode, $httpHeader) = $this->deletePetWithHttpInfo ($pet_id, $api_key); + list($response) = $this->deletePetWithHttpInfo ($pet_id, $api_key); return $response; } @@ -300,11 +300,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // header params @@ -368,7 +368,7 @@ class PetApi */ public function findPetsByStatus($status = null) { - list($response, $statusCode, $httpHeader) = $this->findPetsByStatusWithHttpInfo ($status); + list($response) = $this->findPetsByStatusWithHttpInfo ($status); return $response; } @@ -392,11 +392,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // query params @@ -439,12 +439,12 @@ class PetApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $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 = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -464,7 +464,7 @@ class PetApi */ public function findPetsByTags($tags = null) { - list($response, $statusCode, $httpHeader) = $this->findPetsByTagsWithHttpInfo ($tags); + list($response) = $this->findPetsByTagsWithHttpInfo ($tags); return $response; } @@ -488,11 +488,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // query params @@ -535,12 +535,12 @@ class PetApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Pet[]', $httpHeader), $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 = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -560,7 +560,7 @@ class PetApi */ public function getPetById($pet_id) { - list($response, $statusCode, $httpHeader) = $this->getPetByIdWithHttpInfo ($pet_id); + list($response) = $this->getPetByIdWithHttpInfo ($pet_id); return $response; } @@ -588,11 +588,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -642,12 +642,12 @@ class PetApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Pet', $httpHeader), $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 = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -667,7 +667,7 @@ class PetApi */ public function getPetByIdInObject($pet_id) { - list($response, $statusCode, $httpHeader) = $this->getPetByIdInObjectWithHttpInfo ($pet_id); + list($response) = $this->getPetByIdInObjectWithHttpInfo ($pet_id); return $response; } @@ -695,11 +695,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -749,12 +749,12 @@ class PetApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\InlineResponse200', $httpHeader), $statusCode, $httpHeader); + return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\InlineResponse200', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\InlineResponse200', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\InlineResponse200', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -774,7 +774,7 @@ class PetApi */ public function petPetIdtestingByteArraytrueGet($pet_id) { - list($response, $statusCode, $httpHeader) = $this->petPetIdtestingByteArraytrueGetWithHttpInfo ($pet_id); + list($response) = $this->petPetIdtestingByteArraytrueGetWithHttpInfo ($pet_id); return $response; } @@ -802,11 +802,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -856,12 +856,12 @@ class PetApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader); + return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -881,7 +881,7 @@ class PetApi */ public function updatePet($body = null) { - list($response, $statusCode, $httpHeader) = $this->updatePetWithHttpInfo ($body); + list($response) = $this->updatePetWithHttpInfo ($body); return $response; } @@ -905,11 +905,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','application/xml')); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/json','application/xml')); @@ -967,7 +967,7 @@ class PetApi */ public function updatePetWithForm($pet_id, $name = null, $status = null) { - list($response, $statusCode, $httpHeader) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status); + list($response) = $this->updatePetWithFormWithHttpInfo ($pet_id, $name, $status); return $response; } @@ -997,11 +997,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/x-www-form-urlencoded')); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('application/x-www-form-urlencoded')); @@ -1075,7 +1075,7 @@ class PetApi */ public function uploadFile($pet_id, $additional_metadata = null, $file = null) { - list($response, $statusCode, $httpHeader) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file); + list($response) = $this->uploadFileWithHttpInfo ($pet_id, $additional_metadata, $file); return $response; } @@ -1105,11 +1105,11 @@ class PetApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('multipart/form-data')); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array('multipart/form-data')); 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 b510b4a3b6e..7b3e01ab1a6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -102,7 +102,7 @@ class StoreApi */ public function deleteOrder($order_id) { - list($response, $statusCode, $httpHeader) = $this->deleteOrderWithHttpInfo ($order_id); + list($response) = $this->deleteOrderWithHttpInfo ($order_id); return $response; } @@ -130,11 +130,11 @@ class StoreApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -189,7 +189,7 @@ class StoreApi */ public function findOrdersByStatus($status = null) { - list($response, $statusCode, $httpHeader) = $this->findOrdersByStatusWithHttpInfo ($status); + list($response) = $this->findOrdersByStatusWithHttpInfo ($status); return $response; } @@ -213,11 +213,11 @@ class StoreApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // query params @@ -265,12 +265,12 @@ class StoreApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Order[]', $httpHeader), $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 = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order[]', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order[]', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -289,7 +289,7 @@ class StoreApi */ public function getInventory() { - list($response, $statusCode, $httpHeader) = $this->getInventoryWithHttpInfo (); + list($response) = $this->getInventoryWithHttpInfo (); return $response; } @@ -312,11 +312,11 @@ class StoreApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -353,12 +353,12 @@ class StoreApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, 'map[string,int]', $httpHeader), $statusCode, $httpHeader); + return array($this->apiClient->getSerializer()->deserialize($response, 'map[string,int]', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -377,7 +377,7 @@ class StoreApi */ public function getInventoryInObject() { - list($response, $statusCode, $httpHeader) = $this->getInventoryInObjectWithHttpInfo (); + list($response) = $this->getInventoryInObjectWithHttpInfo (); return $response; } @@ -400,11 +400,11 @@ class StoreApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -441,12 +441,12 @@ class StoreApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader); + return array($this->apiClient->getSerializer()->deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -466,7 +466,7 @@ class StoreApi */ public function getOrderById($order_id) { - list($response, $statusCode, $httpHeader) = $this->getOrderByIdWithHttpInfo ($order_id); + list($response) = $this->getOrderByIdWithHttpInfo ($order_id); return $response; } @@ -494,11 +494,11 @@ class StoreApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -550,12 +550,12 @@ class StoreApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $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 = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -575,7 +575,7 @@ class StoreApi */ public function placeOrder($body = null) { - list($response, $statusCode, $httpHeader) = $this->placeOrderWithHttpInfo ($body); + list($response) = $this->placeOrderWithHttpInfo ($body); return $response; } @@ -599,11 +599,11 @@ class StoreApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -651,12 +651,12 @@ class StoreApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\Order', $httpHeader), $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 = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); $e->setResponseObject($data); break; } 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 259581ee2f5..644185bbd83 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -102,7 +102,7 @@ class UserApi */ public function createUser($body = null) { - list($response, $statusCode, $httpHeader) = $this->createUserWithHttpInfo ($body); + list($response) = $this->createUserWithHttpInfo ($body); return $response; } @@ -126,11 +126,11 @@ class UserApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -181,7 +181,7 @@ class UserApi */ public function createUsersWithArrayInput($body = null) { - list($response, $statusCode, $httpHeader) = $this->createUsersWithArrayInputWithHttpInfo ($body); + list($response) = $this->createUsersWithArrayInputWithHttpInfo ($body); return $response; } @@ -205,11 +205,11 @@ class UserApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -260,7 +260,7 @@ class UserApi */ public function createUsersWithListInput($body = null) { - list($response, $statusCode, $httpHeader) = $this->createUsersWithListInputWithHttpInfo ($body); + list($response) = $this->createUsersWithListInputWithHttpInfo ($body); return $response; } @@ -284,11 +284,11 @@ class UserApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -339,7 +339,7 @@ class UserApi */ public function deleteUser($username) { - list($response, $statusCode, $httpHeader) = $this->deleteUserWithHttpInfo ($username); + list($response) = $this->deleteUserWithHttpInfo ($username); return $response; } @@ -367,11 +367,11 @@ class UserApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -431,7 +431,7 @@ class UserApi */ public function getUserByName($username) { - list($response, $statusCode, $httpHeader) = $this->getUserByNameWithHttpInfo ($username); + list($response) = $this->getUserByNameWithHttpInfo ($username); return $response; } @@ -459,11 +459,11 @@ class UserApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -501,12 +501,12 @@ class UserApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, '\Swagger\Client\Model\User', $httpHeader), $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 = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -527,7 +527,7 @@ class UserApi */ public function loginUser($username = null, $password = null) { - list($response, $statusCode, $httpHeader) = $this->loginUserWithHttpInfo ($username, $password); + list($response) = $this->loginUserWithHttpInfo ($username, $password); return $response; } @@ -552,11 +552,11 @@ class UserApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // query params @@ -594,12 +594,12 @@ class UserApi return array(null, $statusCode, $httpHeader); } - return array(\Swagger\Client\ObjectSerializer::deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader); + return array($this->apiClient->getSerializer()->deserialize($response, 'string', $httpHeader), $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { case 200: - $data = \Swagger\Client\ObjectSerializer::deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); + $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); $e->setResponseObject($data); break; } @@ -618,7 +618,7 @@ class UserApi */ public function logoutUser() { - list($response, $statusCode, $httpHeader) = $this->logoutUserWithHttpInfo (); + list($response) = $this->logoutUserWithHttpInfo (); return $response; } @@ -641,11 +641,11 @@ class UserApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); @@ -693,7 +693,7 @@ class UserApi */ public function updateUser($username, $body = null) { - list($response, $statusCode, $httpHeader) = $this->updateUserWithHttpInfo ($username, $body); + list($response) = $this->updateUserWithHttpInfo ($username, $body); return $response; } @@ -722,11 +722,11 @@ class UserApi $queryParams = array(); $headerParams = array(); $formParams = array(); - $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'application/xml')); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/json', 'application/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } - $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php index df38b989f88..65ee9d27f29 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php @@ -259,7 +259,7 @@ class ApiClient * * @return string Accept (e.g. application/json) */ - public static function selectHeaderAccept($accept) + public function selectHeaderAccept($accept) { if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) { return null; @@ -277,7 +277,7 @@ class ApiClient * * @return string Content-Type (e.g. application/json) */ - public static function selectHeaderContentType($content_type) + public function selectHeaderContentType($content_type) { if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) { return 'application/json'; @@ -299,9 +299,9 @@ class ApiClient { // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 $headers = array(); - $key = ''; // [+] + $key = ''; - foreach(explode("\n", $raw_headers) as $i => $h) + foreach(explode("\n", $raw_headers) as $h) { $h = explode(':', $h, 2); @@ -311,26 +311,22 @@ class ApiClient $headers[$h[0]] = trim($h[1]); elseif (is_array($headers[$h[0]])) { - // $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); // [-] - // $headers[$h[0]] = $tmp; // [-] - $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); // [+] + $headers[$h[0]] = array_merge($headers[$h[0]], array(trim($h[1]))); } else { - // $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [-] - // $headers[$h[0]] = $tmp; // [-] - $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [+] + $headers[$h[0]] = array_merge(array($headers[$h[0]]), array(trim($h[1]))); } - $key = $h[0]; // [+] + $key = $h[0]; + } + 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]); } - 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]); // [+] - } // [+] } return $headers; 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 eaaa566f3be..079bb4ff200 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -182,10 +182,10 @@ class Animal implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 962f8ec00b6..485ddcffaf0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -182,10 +182,10 @@ class Cat extends Animal implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 65d736ce9d9..5c66c05557f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -214,10 +214,10 @@ class Category implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 2aef5757fe3..f9e6b293c6b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -182,10 +182,10 @@ class Dog extends Animal implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php index 8efea4018b1..5273465225d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php @@ -345,10 +345,10 @@ class InlineResponse200 implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 57cb31c084b..9bbfb46c0b5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -182,10 +182,10 @@ class Model200Response implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 fd8d1479ca0..6910c8e38df 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -182,10 +182,10 @@ class ModelReturn implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 9b52f9a6c00..2c4037d8b6a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -214,10 +214,10 @@ class Name implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 1c114a8392c..02fab9a6ea8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -345,10 +345,10 @@ class Order implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 39735aaa428..b0c4e98bc63 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -345,10 +345,10 @@ class Pet implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 0ce073a43aa..3fada1bc95f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -182,10 +182,10 @@ class SpecialModelName implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 129206e9650..5b050c211b2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -214,10 +214,10 @@ class Tag implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($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 662983d61b9..fdfe945eae9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -406,10 +406,10 @@ class User implements ArrayAccess */ public function __toString() { - if (defined('JSON_PRETTY_PRINT')) { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); - } else { - return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } + + return json_encode(\Swagger\Client\ObjectSerializer::sanitizeForSerialization($this)); } } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index e0a0efc03ca..3adaa899f5f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -55,14 +55,14 @@ class ObjectSerializer public static function sanitizeForSerialization($data) { if (is_scalar($data) || null === $data) { - $sanitized = $data; + return $data; } elseif ($data instanceof \DateTime) { - $sanitized = $data->format(\DateTime::ATOM); + return $data->format(\DateTime::ATOM); } elseif (is_array($data)) { foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } - $sanitized = $data; + return $data; } elseif (is_object($data)) { $values = array(); foreach (array_keys($data::swaggerTypes()) as $property) { @@ -71,12 +71,10 @@ class ObjectSerializer $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); } } - $sanitized = (object)$values; + return (object)$values; } else { - $sanitized = (string)$data; + return (string)$data; } - - return $sanitized; } /** @@ -224,7 +222,7 @@ class ObjectSerializer public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null) { if (null === $data) { - $deserialized = null; + return null; } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] $inner = substr($class, 4, -1); $deserialized = array(); @@ -235,16 +233,17 @@ class ObjectSerializer $deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator); } } + return $deserialized; } elseif (strcasecmp(substr($class, -2), '[]') == 0) { $subClass = substr($class, 0, -2); $values = array(); foreach ($data as $key => $value) { $values[] = self::deserialize($value, $subClass, null, $discriminator); } - $deserialized = $values; + return $values; } elseif ($class === 'object') { settype($data, 'array'); - $deserialized = $data; + return $data; } elseif ($class === '\DateTime') { // Some API's return an invalid, empty string as a // date-time property. DateTime::__construct() will return @@ -253,13 +252,13 @@ class ObjectSerializer // be interpreted as a missing field/value. Let's handle // this graceful. if (!empty($data)) { - $deserialized = new \DateTime($data); + return new \DateTime($data); } else { - $deserialized = null; + return null; } } elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) { settype($data, $class); - $deserialized = $data; + 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)) { @@ -270,7 +269,8 @@ class ObjectSerializer $deserialized = new \SplFileObject($filename, "w"); $byte_written = $deserialized->fwrite($data); error_log("[INFO] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.\n", 3, Configuration::getDefaultConfiguration()->getDebugFile()); - + 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})) { @@ -292,9 +292,7 @@ class ObjectSerializer $instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator)); } } - $deserialized = $instance; + return $instance; } - - return $deserialized; } } From 290957f6c883f7ff45dbb93220752af177db7d1c Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 9 Apr 2016 18:05:40 +0800 Subject: [PATCH 2/2] update php sample --- .../petstore/php/SwaggerClient-php/README.md | 12 +-- .../php/SwaggerClient-php/docs/PetApi.md | 6 +- .../php/SwaggerClient-php/docs/StoreApi.md | 2 +- .../php/SwaggerClient-php/docs/UserApi.md | 4 +- .../php/SwaggerClient-php/lib/Api/PetApi.php | 96 ++++--------------- .../SwaggerClient-php/lib/Api/StoreApi.php | 49 +++------- .../php/SwaggerClient-php/lib/Api/UserApi.php | 66 ++++--------- .../SwaggerClient-php/lib/Model/Animal.php | 4 - .../php/SwaggerClient-php/lib/Model/Cat.php | 4 - .../SwaggerClient-php/lib/Model/Category.php | 6 -- .../php/SwaggerClient-php/lib/Model/Dog.php | 4 - .../lib/Model/InlineResponse200.php | 14 --- .../lib/Model/Model200Response.php | 6 +- .../lib/Model/ModelReturn.php | 6 +- .../php/SwaggerClient-php/lib/Model/Name.php | 8 +- .../php/SwaggerClient-php/lib/Model/Order.php | 14 --- .../php/SwaggerClient-php/lib/Model/Pet.php | 14 --- .../lib/Model/SpecialModelName.php | 4 - .../php/SwaggerClient-php/lib/Model/Tag.php | 6 -- .../php/SwaggerClient-php/lib/Model/User.php | 18 ---- .../lib/Tests/Model200ResponseTest.php | 2 +- .../lib/Tests/ModelReturnTest.php | 2 +- .../SwaggerClient-php/lib/Tests/NameTest.php | 2 +- .../lib/Tests/PetApiTest.php | 12 --- .../lib/Tests/StoreApiTest.php | 7 -- .../lib/Tests/UserApiTest.php | 9 -- 26 files changed, 63 insertions(+), 314 deletions(-) diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 17175dcb303..37f92af6e6f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -3,9 +3,9 @@ This is a sample server Petstore server. You can find out more about Swagger at This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: -- API verion: 1.0.0 +- API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-03-29T20:55:19.032+08:00 +- Build date: 2016-04-09T18:00:55.578+08:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -80,20 +80,20 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store +*PetApi* | [**addPetUsingByteArray**](docs/PetApi.md#addpetusingbytearray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status *PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags *PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' +*PetApi* | [**getPetByIdInObject**](docs/PetApi.md#getpetbyidinobject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' +*PetApi* | [**petPetIdtestingByteArraytrueGet**](docs/PetApi.md#petpetidtestingbytearraytrueget) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' *PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet *PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data *PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image *StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**findOrdersByStatus**](docs/StoreApi.md#findordersbystatus) | **GET** /store/findByStatus | Finds orders by status *StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' +*StoreApi* | [**getInventoryInObject**](docs/StoreApi.md#getinventoryinobject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' *StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID *StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet *UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/PetApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/PetApi.md index b21d4b595b1..9164cd27876 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/PetApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/PetApi.md @@ -5,13 +5,13 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**addPetUsingByteArray**](PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store +[**addPetUsingByteArray**](PetApi.md#addPetUsingByteArray) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags [**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**getPetByIdInObject**](PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' -[**petPetIdtestingByteArraytrueGet**](PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' +[**getPetByIdInObject**](PetApi.md#getPetByIdInObject) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID' +[**petPetIdtestingByteArraytrueGet**](PetApi.md#petPetIdtestingByteArraytrueGet) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID' [**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet [**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/StoreApi.md index a414755a82d..c60ac603299 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/StoreApi.md @@ -7,7 +7,7 @@ Method | HTTP request | Description [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status [**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getInventoryInObject**](StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' +[**getInventoryInObject**](StoreApi.md#getInventoryInObject) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' [**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md index 46f508fe293..e6a19891ba5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/UserApi.md @@ -207,7 +207,7 @@ Get user by user name require_once(__DIR__ . '/vendor/autoload.php'); $api_instance = new Swagger\Client\Api\UserApi(); -$username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. +$username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. try { $result = $api_instance->getUserByName($username); @@ -222,7 +222,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be fetched. Use user1 for testing. | + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | ### Return type 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 cf3d8e49d76..4661a5b3bd8 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -90,7 +90,6 @@ class PetApi return $this; } - /** * addPet * @@ -156,7 +155,6 @@ class PetApi if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -164,9 +162,8 @@ class PetApi $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -174,7 +171,6 @@ class PetApi throw $e; } } - /** * addPetUsingByteArray * @@ -205,7 +201,7 @@ class PetApi // parse inputs - $resourcePath = "/pet?testing_byte_array=true"; + $resourcePath = "/pet?testing_byte_array=true"; $httpBody = ''; $queryParams = array(); $headerParams = array(); @@ -240,7 +236,6 @@ class PetApi if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -248,9 +243,8 @@ class PetApi $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -258,7 +252,6 @@ class PetApi throw $e; } } - /** * deletePet * @@ -308,12 +301,10 @@ class PetApi // header params - if ($api_key !== null) { $headerParams['api_key'] = $this->apiClient->getSerializer()->toHeaderValue($api_key); } // path params - if ($pet_id !== null) { $resourcePath = str_replace( "{" . "petId" . "}", @@ -338,7 +329,6 @@ class PetApi if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -346,9 +336,8 @@ class PetApi $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -356,7 +345,6 @@ class PetApi throw $e; } } - /** * findPetsByStatus * @@ -399,11 +387,9 @@ class PetApi $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // query params - if (is_array($status)) { $status = $this->apiClient->getSerializer()->serializeCollection($status, 'multi', true); } - if ($status !== null) { $queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status); } @@ -426,7 +412,6 @@ class PetApi if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -434,14 +419,12 @@ class PetApi $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); @@ -452,7 +435,6 @@ class PetApi throw $e; } } - /** * findPetsByTags * @@ -495,11 +477,9 @@ class PetApi $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // query params - if (is_array($tags)) { $tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'multi', true); } - if ($tags !== null) { $queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags); } @@ -522,7 +502,6 @@ class PetApi if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -530,14 +509,12 @@ class PetApi $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet[]', $e->getResponseHeaders()); @@ -548,7 +525,6 @@ class PetApi throw $e; } } - /** * getPetById * @@ -597,7 +573,6 @@ class PetApi // path params - if ($pet_id !== null) { $resourcePath = str_replace( "{" . "petId" . "}", @@ -624,12 +599,11 @@ class PetApi $headerParams['api_key'] = $apiKey; } - + // this endpoint requires OAuth (access token) if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -637,14 +611,12 @@ class PetApi $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Pet', $e->getResponseHeaders()); @@ -655,7 +627,6 @@ class PetApi throw $e; } } - /** * getPetByIdInObject * @@ -690,7 +661,7 @@ class PetApi } // parse inputs - $resourcePath = "/pet/{petId}?response=inline_arbitrary_object"; + $resourcePath = "/pet/{petId}?response=inline_arbitrary_object"; $httpBody = ''; $queryParams = array(); $headerParams = array(); @@ -704,7 +675,6 @@ class PetApi // path params - if ($pet_id !== null) { $resourcePath = str_replace( "{" . "petId" . "}", @@ -731,12 +701,11 @@ class PetApi $headerParams['api_key'] = $apiKey; } - + // this endpoint requires OAuth (access token) if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -744,14 +713,12 @@ class PetApi $queryParams, $httpBody, $headerParams, '\Swagger\Client\Model\InlineResponse200' ); - if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, '\Swagger\Client\Model\InlineResponse200', $httpHeader), $statusCode, $httpHeader); - - } catch (ApiException $e) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\InlineResponse200', $e->getResponseHeaders()); @@ -762,7 +729,6 @@ class PetApi throw $e; } } - /** * petPetIdtestingByteArraytrueGet * @@ -797,7 +763,7 @@ class PetApi } // parse inputs - $resourcePath = "/pet/{petId}?testing_byte_array=true"; + $resourcePath = "/pet/{petId}?testing_byte_array=true"; $httpBody = ''; $queryParams = array(); $headerParams = array(); @@ -811,7 +777,6 @@ class PetApi // path params - if ($pet_id !== null) { $resourcePath = str_replace( "{" . "petId" . "}", @@ -838,12 +803,11 @@ class PetApi $headerParams['api_key'] = $apiKey; } - + // this endpoint requires OAuth (access token) if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -851,14 +815,12 @@ class PetApi $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); @@ -869,7 +831,6 @@ class PetApi throw $e; } } - /** * updatePet * @@ -935,7 +896,6 @@ class PetApi if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -943,9 +903,8 @@ class PetApi $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -953,7 +912,6 @@ class PetApi throw $e; } } - /** * updatePetWithForm * @@ -1006,7 +964,6 @@ class PetApi // path params - if ($pet_id !== null) { $resourcePath = str_replace( "{" . "petId" . "}", @@ -1019,16 +976,10 @@ class PetApi // form params if ($name !== null) { - - $formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name); - }// form params if ($status !== null) { - - $formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status); - } @@ -1043,7 +994,6 @@ class PetApi if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -1051,9 +1001,8 @@ class PetApi $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1061,7 +1010,6 @@ class PetApi throw $e; } } - /** * uploadFile * @@ -1114,7 +1062,6 @@ class PetApi // path params - if ($pet_id !== null) { $resourcePath = str_replace( "{" . "petId" . "}", @@ -1127,13 +1074,9 @@ class PetApi // form params if ($additional_metadata !== null) { - - $formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata); - }// form params if ($file !== null) { - // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax // See: https://wiki.php.net/rfc/curl-file-upload if (function_exists('curl_file_create')) { @@ -1141,8 +1084,6 @@ class PetApi } else { $formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file); } - - } @@ -1157,7 +1098,6 @@ class PetApi if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -1165,9 +1105,8 @@ class PetApi $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -1175,5 +1114,4 @@ class PetApi 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 7b3e01ab1a6..387cd476c55 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -90,7 +90,6 @@ class StoreApi return $this; } - /** * deleteOrder * @@ -139,7 +138,6 @@ class StoreApi // path params - if ($order_id !== null) { $resourcePath = str_replace( "{" . "orderId" . "}", @@ -159,17 +157,15 @@ class StoreApi } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } - - // make the API Call + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'DELETE', $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -177,7 +173,6 @@ class StoreApi throw $e; } } - /** * findOrdersByStatus * @@ -220,7 +215,6 @@ class StoreApi $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // query params - if ($status !== null) { $queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status); } @@ -245,14 +239,13 @@ class StoreApi $headerParams['x-test_api_client_id'] = $apiKey; } - + // this endpoint requires API key authentication $apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_secret'); if (strlen($apiKey) !== 0) { $headerParams['x-test_api_client_secret'] = $apiKey; } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -260,14 +253,12 @@ class StoreApi $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order[]', $e->getResponseHeaders()); @@ -278,7 +269,6 @@ class StoreApi throw $e; } } - /** * getInventory * @@ -340,7 +330,6 @@ class StoreApi $headerParams['api_key'] = $apiKey; } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -348,14 +337,12 @@ class StoreApi $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'map[string,int]', $e->getResponseHeaders()); @@ -366,7 +353,6 @@ class StoreApi throw $e; } } - /** * getInventoryInObject * @@ -395,7 +381,7 @@ class StoreApi // parse inputs - $resourcePath = "/store/inventory?response=arbitrary_object"; + $resourcePath = "/store/inventory?response=arbitrary_object"; $httpBody = ''; $queryParams = array(); $headerParams = array(); @@ -428,7 +414,6 @@ class StoreApi $headerParams['api_key'] = $apiKey; } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -436,14 +421,12 @@ class StoreApi $queryParams, $httpBody, $headerParams, 'object' ); - if (!$response) { return array(null, $statusCode, $httpHeader); } return array($this->apiClient->getSerializer()->deserialize($response, 'object', $httpHeader), $statusCode, $httpHeader); - - } catch (ApiException $e) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'object', $e->getResponseHeaders()); @@ -454,7 +437,6 @@ class StoreApi throw $e; } } - /** * getOrderById * @@ -503,7 +485,6 @@ class StoreApi // path params - if ($order_id !== null) { $resourcePath = str_replace( "{" . "orderId" . "}", @@ -530,14 +511,13 @@ class StoreApi $headerParams['test_api_key_header'] = $apiKey; } - + // this endpoint requires API key authentication $apiKey = $this->apiClient->getApiKeyWithPrefix('test_api_key_query'); if (strlen($apiKey) !== 0) { $queryParams['test_api_key_query'] = $apiKey; } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -545,14 +525,12 @@ class StoreApi $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); @@ -563,7 +541,6 @@ class StoreApi throw $e; } } - /** * placeOrder * @@ -631,14 +608,13 @@ class StoreApi $headerParams['x-test_api_client_id'] = $apiKey; } - + // this endpoint requires API key authentication $apiKey = $this->apiClient->getApiKeyWithPrefix('x-test_api_client_secret'); if (strlen($apiKey) !== 0) { $headerParams['x-test_api_client_secret'] = $apiKey; } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -646,14 +622,12 @@ class StoreApi $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\Order', $e->getResponseHeaders()); @@ -664,5 +638,4 @@ class StoreApi 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 644185bbd83..23f682e4943 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -90,7 +90,6 @@ class UserApi return $this; } - /** * createUser * @@ -151,17 +150,15 @@ class UserApi } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } - - // make the API Call + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'POST', $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -169,7 +166,6 @@ class UserApi throw $e; } } - /** * createUsersWithArrayInput * @@ -230,17 +226,15 @@ class UserApi } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } - - // make the API Call + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'POST', $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -248,7 +242,6 @@ class UserApi throw $e; } } - /** * createUsersWithListInput * @@ -309,17 +302,15 @@ class UserApi } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } - - // make the API Call + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'POST', $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -327,7 +318,6 @@ class UserApi throw $e; } } - /** * deleteUser * @@ -376,7 +366,6 @@ class UserApi // path params - if ($username !== null) { $resourcePath = str_replace( "{" . "username" . "}", @@ -401,7 +390,6 @@ class UserApi if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) { $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword()); } - // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( @@ -409,9 +397,8 @@ class UserApi $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -419,13 +406,12 @@ class UserApi throw $e; } } - /** * getUserByName * * Get user by user name * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * @return \Swagger\Client\Model\User * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -441,7 +427,7 @@ class UserApi * * Get user by user name * - * @param string $username The name that needs to be fetched. Use user1 for testing. (required) + * @param string $username The name that needs to be fetched. Use user1 for testing. (required) * @return Array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings) * @throws \Swagger\Client\ApiException on non-2xx response */ @@ -468,7 +454,6 @@ class UserApi // path params - if ($username !== null) { $resourcePath = str_replace( "{" . "username" . "}", @@ -488,22 +473,19 @@ class UserApi } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } - - // make the API Call + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), '\Swagger\Client\Model\User', $e->getResponseHeaders()); @@ -514,7 +496,6 @@ class UserApi throw $e; } } - /** * loginUser * @@ -559,11 +540,9 @@ class UserApi $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); // query params - if ($username !== null) { $queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username); }// query params - if ($password !== null) { $queryParams['password'] = $this->apiClient->getSerializer()->toQueryValue($password); } @@ -581,22 +560,19 @@ class UserApi } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } - - // make the API Call + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $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) { + } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = $this->apiClient->getSerializer()->deserialize($e->getResponseBody(), 'string', $e->getResponseHeaders()); @@ -607,7 +583,6 @@ class UserApi throw $e; } } - /** * logoutUser * @@ -662,17 +637,15 @@ class UserApi } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } - - // make the API Call + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'GET', $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -680,7 +653,6 @@ class UserApi throw $e; } } - /** * updateUser * @@ -731,7 +703,6 @@ class UserApi // path params - if ($username !== null) { $resourcePath = str_replace( "{" . "username" . "}", @@ -755,17 +726,15 @@ class UserApi } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } - - // make the API Call + // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'PUT', $queryParams, $httpBody, $headerParams ); - + return array(null, $statusCode, $httpHeader); - } catch (ApiException $e) { switch ($e->getCode()) { } @@ -773,5 +742,4 @@ class UserApi throw $e; } } - } 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 079bb4ff200..c267c81b18e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -94,13 +94,11 @@ class Animal implements ArrayAccess return self::$getters; } - /** * $class_name * @var string */ protected $class_name; - /** * Constructor @@ -113,7 +111,6 @@ class Animal implements ArrayAccess $this->class_name = $data["class_name"]; } } - /** * Gets class_name * @return string @@ -134,7 +131,6 @@ class Animal implements ArrayAccess $this->class_name = $class_name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 485ddcffaf0..79acd0d1f22 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -94,13 +94,11 @@ class Cat extends Animal implements ArrayAccess return parent::getters() + self::$getters; } - /** * $declawed * @var bool */ protected $declawed; - /** * Constructor @@ -113,7 +111,6 @@ class Cat extends Animal implements ArrayAccess $this->declawed = $data["declawed"]; } } - /** * Gets declawed * @return bool @@ -134,7 +131,6 @@ class Cat extends Animal implements ArrayAccess $this->declawed = $declawed; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 5c66c05557f..0f359589d0e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -98,19 +98,16 @@ class Category implements ArrayAccess return self::$getters; } - /** * $id * @var int */ protected $id; - /** * $name * @var string */ protected $name; - /** * Constructor @@ -124,7 +121,6 @@ class Category implements ArrayAccess $this->name = $data["name"]; } } - /** * Gets id * @return int @@ -145,7 +141,6 @@ class Category implements ArrayAccess $this->id = $id; return $this; } - /** * Gets name * @return string @@ -166,7 +161,6 @@ class Category implements ArrayAccess $this->name = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 f9e6b293c6b..d12bde293fd 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -94,13 +94,11 @@ class Dog extends Animal implements ArrayAccess return parent::getters() + self::$getters; } - /** * $breed * @var string */ protected $breed; - /** * Constructor @@ -113,7 +111,6 @@ class Dog extends Animal implements ArrayAccess $this->breed = $data["breed"]; } } - /** * Gets breed * @return string @@ -134,7 +131,6 @@ class Dog extends Animal implements ArrayAccess $this->breed = $breed; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php index 5273465225d..c3bb9d03315 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/InlineResponse200.php @@ -114,43 +114,36 @@ class InlineResponse200 implements ArrayAccess return self::$getters; } - /** * $tags * @var \Swagger\Client\Model\Tag[] */ protected $tags; - /** * $id * @var int */ protected $id; - /** * $category * @var object */ protected $category; - /** * $status pet status in the store * @var string */ protected $status; - /** * $name * @var string */ protected $name; - /** * $photo_urls * @var string[] */ protected $photo_urls; - /** * Constructor @@ -168,7 +161,6 @@ class InlineResponse200 implements ArrayAccess $this->photo_urls = $data["photo_urls"]; } } - /** * Gets tags * @return \Swagger\Client\Model\Tag[] @@ -189,7 +181,6 @@ class InlineResponse200 implements ArrayAccess $this->tags = $tags; return $this; } - /** * Gets id * @return int @@ -210,7 +201,6 @@ class InlineResponse200 implements ArrayAccess $this->id = $id; return $this; } - /** * Gets category * @return object @@ -231,7 +221,6 @@ class InlineResponse200 implements ArrayAccess $this->category = $category; return $this; } - /** * Gets status * @return string @@ -255,7 +244,6 @@ class InlineResponse200 implements ArrayAccess $this->status = $status; return $this; } - /** * Gets name * @return string @@ -276,7 +264,6 @@ class InlineResponse200 implements ArrayAccess $this->name = $name; return $this; } - /** * Gets photo_urls * @return string[] @@ -297,7 +284,6 @@ class InlineResponse200 implements ArrayAccess $this->photo_urls = $photo_urls; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 9bbfb46c0b5..a2b4d7691ed 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -38,7 +38,7 @@ use \ArrayAccess; * Model200Response Class Doc Comment * * @category Class - * @description + * @description Model for testing model name starting with number * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -94,13 +94,11 @@ class Model200Response implements ArrayAccess return self::$getters; } - /** * $name * @var int */ protected $name; - /** * Constructor @@ -113,7 +111,6 @@ class Model200Response implements ArrayAccess $this->name = $data["name"]; } } - /** * Gets name * @return int @@ -134,7 +131,6 @@ class Model200Response implements ArrayAccess $this->name = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 6910c8e38df..d92e61cdcd6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -38,7 +38,7 @@ use \ArrayAccess; * ModelReturn Class Doc Comment * * @category Class - * @description + * @description Model for testing reserved words * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -94,13 +94,11 @@ class ModelReturn implements ArrayAccess return self::$getters; } - /** * $return * @var int */ protected $return; - /** * Constructor @@ -113,7 +111,6 @@ class ModelReturn implements ArrayAccess $this->return = $data["return"]; } } - /** * Gets return * @return int @@ -134,7 +131,6 @@ class ModelReturn implements ArrayAccess $this->return = $return; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 2c4037d8b6a..dbe1349ab88 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -38,7 +38,7 @@ use \ArrayAccess; * Name Class Doc Comment * * @category Class - * @description + * @description Model for testing model name same as property name * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 @@ -98,19 +98,16 @@ class Name implements ArrayAccess return self::$getters; } - /** * $name * @var int */ protected $name; - /** * $snake_case * @var int */ protected $snake_case; - /** * Constructor @@ -124,7 +121,6 @@ class Name implements ArrayAccess $this->snake_case = $data["snake_case"]; } } - /** * Gets name * @return int @@ -145,7 +141,6 @@ class Name implements ArrayAccess $this->name = $name; return $this; } - /** * Gets snake_case * @return int @@ -166,7 +161,6 @@ class Name implements ArrayAccess $this->snake_case = $snake_case; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 02fab9a6ea8..ae29bd61271 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -114,43 +114,36 @@ class Order implements ArrayAccess return self::$getters; } - /** * $id * @var int */ protected $id; - /** * $pet_id * @var int */ protected $pet_id; - /** * $quantity * @var int */ protected $quantity; - /** * $ship_date * @var \DateTime */ protected $ship_date; - /** * $status Order Status * @var string */ protected $status; - /** * $complete * @var bool */ protected $complete; - /** * Constructor @@ -168,7 +161,6 @@ class Order implements ArrayAccess $this->complete = $data["complete"]; } } - /** * Gets id * @return int @@ -189,7 +181,6 @@ class Order implements ArrayAccess $this->id = $id; return $this; } - /** * Gets pet_id * @return int @@ -210,7 +201,6 @@ class Order implements ArrayAccess $this->pet_id = $pet_id; return $this; } - /** * Gets quantity * @return int @@ -231,7 +221,6 @@ class Order implements ArrayAccess $this->quantity = $quantity; return $this; } - /** * Gets ship_date * @return \DateTime @@ -252,7 +241,6 @@ class Order implements ArrayAccess $this->ship_date = $ship_date; return $this; } - /** * Gets status * @return string @@ -276,7 +264,6 @@ class Order implements ArrayAccess $this->status = $status; return $this; } - /** * Gets complete * @return bool @@ -297,7 +284,6 @@ class Order implements ArrayAccess $this->complete = $complete; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 b0c4e98bc63..7a790869349 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -114,43 +114,36 @@ class Pet implements ArrayAccess return self::$getters; } - /** * $id * @var int */ protected $id; - /** * $category * @var \Swagger\Client\Model\Category */ protected $category; - /** * $name * @var string */ protected $name; - /** * $photo_urls * @var string[] */ protected $photo_urls; - /** * $tags * @var \Swagger\Client\Model\Tag[] */ protected $tags; - /** * $status pet status in the store * @var string */ protected $status; - /** * Constructor @@ -168,7 +161,6 @@ class Pet implements ArrayAccess $this->status = $data["status"]; } } - /** * Gets id * @return int @@ -189,7 +181,6 @@ class Pet implements ArrayAccess $this->id = $id; return $this; } - /** * Gets category * @return \Swagger\Client\Model\Category @@ -210,7 +201,6 @@ class Pet implements ArrayAccess $this->category = $category; return $this; } - /** * Gets name * @return string @@ -231,7 +221,6 @@ class Pet implements ArrayAccess $this->name = $name; return $this; } - /** * Gets photo_urls * @return string[] @@ -252,7 +241,6 @@ class Pet implements ArrayAccess $this->photo_urls = $photo_urls; return $this; } - /** * Gets tags * @return \Swagger\Client\Model\Tag[] @@ -273,7 +261,6 @@ class Pet implements ArrayAccess $this->tags = $tags; return $this; } - /** * Gets status * @return string @@ -297,7 +284,6 @@ class Pet implements ArrayAccess $this->status = $status; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 3fada1bc95f..25248d949cf 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -94,13 +94,11 @@ class SpecialModelName implements ArrayAccess return self::$getters; } - /** * $special_property_name * @var int */ protected $special_property_name; - /** * Constructor @@ -113,7 +111,6 @@ class SpecialModelName implements ArrayAccess $this->special_property_name = $data["special_property_name"]; } } - /** * Gets special_property_name * @return int @@ -134,7 +131,6 @@ class SpecialModelName implements ArrayAccess $this->special_property_name = $special_property_name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 5b050c211b2..8396a774e80 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -98,19 +98,16 @@ class Tag implements ArrayAccess return self::$getters; } - /** * $id * @var int */ protected $id; - /** * $name * @var string */ protected $name; - /** * Constructor @@ -124,7 +121,6 @@ class Tag implements ArrayAccess $this->name = $data["name"]; } } - /** * Gets id * @return int @@ -145,7 +141,6 @@ class Tag implements ArrayAccess $this->id = $id; return $this; } - /** * Gets name * @return string @@ -166,7 +161,6 @@ class Tag implements ArrayAccess $this->name = $name; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset 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 fdfe945eae9..6e5c7de36f3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -122,55 +122,46 @@ class User implements ArrayAccess return self::$getters; } - /** * $id * @var int */ protected $id; - /** * $username * @var string */ protected $username; - /** * $first_name * @var string */ protected $first_name; - /** * $last_name * @var string */ protected $last_name; - /** * $email * @var string */ protected $email; - /** * $password * @var string */ protected $password; - /** * $phone * @var string */ protected $phone; - /** * $user_status User Status * @var int */ protected $user_status; - /** * Constructor @@ -190,7 +181,6 @@ class User implements ArrayAccess $this->user_status = $data["user_status"]; } } - /** * Gets id * @return int @@ -211,7 +201,6 @@ class User implements ArrayAccess $this->id = $id; return $this; } - /** * Gets username * @return string @@ -232,7 +221,6 @@ class User implements ArrayAccess $this->username = $username; return $this; } - /** * Gets first_name * @return string @@ -253,7 +241,6 @@ class User implements ArrayAccess $this->first_name = $first_name; return $this; } - /** * Gets last_name * @return string @@ -274,7 +261,6 @@ class User implements ArrayAccess $this->last_name = $last_name; return $this; } - /** * Gets email * @return string @@ -295,7 +281,6 @@ class User implements ArrayAccess $this->email = $email; return $this; } - /** * Gets password * @return string @@ -316,7 +301,6 @@ class User implements ArrayAccess $this->password = $password; return $this; } - /** * Gets phone * @return string @@ -337,7 +321,6 @@ class User implements ArrayAccess $this->phone = $phone; return $this; } - /** * Gets user_status * @return int @@ -358,7 +341,6 @@ class User implements ArrayAccess $this->user_status = $user_status; return $this; } - /** * Returns true if offset exists. False otherwise. * @param integer $offset Offset diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/Model200ResponseTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/Model200ResponseTest.php index b9c7b167d54..40a5fe6d8b7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/Model200ResponseTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/Model200ResponseTest.php @@ -37,7 +37,7 @@ namespace Swagger\Client\Model; * Model200ResponseTest Class Doc Comment * * @category Class - * @description + * @description Model for testing model name starting with number * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/ModelReturnTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/ModelReturnTest.php index b42efd5ef57..1f3424acf71 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/ModelReturnTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/ModelReturnTest.php @@ -37,7 +37,7 @@ namespace Swagger\Client\Model; * ModelReturnTest Class Doc Comment * * @category Class - * @description + * @description Model for testing reserved words * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/NameTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/NameTest.php index 17a22692df8..c33395f2085 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/NameTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/NameTest.php @@ -37,7 +37,7 @@ namespace Swagger\Client\Model; * NameTest Class Doc Comment * * @category Class - * @description + * @description Model for testing model name same as property name * @package Swagger\Client * @author http://github.com/swagger-api/swagger-codegen * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetApiTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetApiTest.php index 6cc0a6e217f..f70ddf00107 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/PetApiTest.php @@ -64,7 +64,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase } - /** * Test case for addPet * @@ -74,7 +73,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_addPet() { } - /** * Test case for addPetUsingByteArray * @@ -84,7 +82,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_addPetUsingByteArray() { } - /** * Test case for deletePet * @@ -94,7 +91,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_deletePet() { } - /** * Test case for findPetsByStatus * @@ -104,7 +100,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_findPetsByStatus() { } - /** * Test case for findPetsByTags * @@ -114,7 +109,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_findPetsByTags() { } - /** * Test case for getPetById * @@ -124,7 +118,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_getPetById() { } - /** * Test case for getPetByIdInObject * @@ -134,7 +127,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_getPetByIdInObject() { } - /** * Test case for petPetIdtestingByteArraytrueGet * @@ -144,7 +136,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_petPetIdtestingByteArraytrueGet() { } - /** * Test case for updatePet * @@ -154,7 +145,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_updatePet() { } - /** * Test case for updatePetWithForm * @@ -164,7 +154,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_updatePetWithForm() { } - /** * Test case for uploadFile * @@ -174,5 +163,4 @@ class PetApiTest extends \PHPUnit_Framework_TestCase public function test_uploadFile() { } - } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/StoreApiTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/StoreApiTest.php index 0d6fdfd9d8c..2eaf5f5dd11 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/StoreApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/StoreApiTest.php @@ -64,7 +64,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase } - /** * Test case for deleteOrder * @@ -74,7 +73,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase public function test_deleteOrder() { } - /** * Test case for findOrdersByStatus * @@ -84,7 +82,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase public function test_findOrdersByStatus() { } - /** * Test case for getInventory * @@ -94,7 +91,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase public function test_getInventory() { } - /** * Test case for getInventoryInObject * @@ -104,7 +100,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase public function test_getInventoryInObject() { } - /** * Test case for getOrderById * @@ -114,7 +109,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase public function test_getOrderById() { } - /** * Test case for placeOrder * @@ -124,5 +118,4 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase public function test_placeOrder() { } - } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserApiTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserApiTest.php index 8eddc284528..5df577e6d9e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/UserApiTest.php @@ -64,7 +64,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase } - /** * Test case for createUser * @@ -74,7 +73,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase public function test_createUser() { } - /** * Test case for createUsersWithArrayInput * @@ -84,7 +82,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase public function test_createUsersWithArrayInput() { } - /** * Test case for createUsersWithListInput * @@ -94,7 +91,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase public function test_createUsersWithListInput() { } - /** * Test case for deleteUser * @@ -104,7 +100,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase public function test_deleteUser() { } - /** * Test case for getUserByName * @@ -114,7 +109,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase public function test_getUserByName() { } - /** * Test case for loginUser * @@ -124,7 +118,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase public function test_loginUser() { } - /** * Test case for logoutUser * @@ -134,7 +127,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase public function test_logoutUser() { } - /** * Test case for updateUser * @@ -144,5 +136,4 @@ class UserApiTest extends \PHPUnit_Framework_TestCase public function test_updateUser() { } - }