Merge pull request #2465 from wing328/php_improvement

[PHP] minor php code improvement
This commit is contained in:
wing328 2016-04-09 18:18:18 +08:00
commit 50bbd9818c
32 changed files with 266 additions and 529 deletions

View File

@ -259,7 +259,7 @@ class ApiClient
* *
* @return string Accept (e.g. application/json) * @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] === '')) { if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) {
return null; return null;
@ -277,7 +277,7 @@ class ApiClient
* *
* @return string Content-Type (e.g. application/json) * @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] === '')) { if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) {
return 'application/json'; return 'application/json';
@ -299,9 +299,9 @@ class ApiClient
{ {
// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
$headers = array(); $headers = array();
$key = ''; // [+] $key = '';
foreach(explode("\n", $raw_headers) as $i => $h) foreach(explode("\n", $raw_headers) as $h)
{ {
$h = explode(':', $h, 2); $h = explode(':', $h, 2);
@ -311,26 +311,22 @@ class ApiClient
$headers[$h[0]] = trim($h[1]); $headers[$h[0]] = trim($h[1]);
elseif (is_array($headers[$h[0]])) elseif (is_array($headers[$h[0]]))
{ {
// $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); // [-] $headers[$h[0]] = 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]))); // [+]
} }
else else
{ {
// $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [-] $headers[$h[0]] = 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]))); // [+]
} }
$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; return $headers;

View File

@ -55,14 +55,14 @@ class ObjectSerializer
public static function sanitizeForSerialization($data) public static function sanitizeForSerialization($data)
{ {
if (is_scalar($data) || null === $data) { if (is_scalar($data) || null === $data) {
$sanitized = $data; return $data;
} elseif ($data instanceof \DateTime) { } elseif ($data instanceof \DateTime) {
$sanitized = $data->format(\DateTime::ATOM); return $data->format(\DateTime::ATOM);
} elseif (is_array($data)) { } elseif (is_array($data)) {
foreach ($data as $property => $value) { foreach ($data as $property => $value) {
$data[$property] = self::sanitizeForSerialization($value); $data[$property] = self::sanitizeForSerialization($value);
} }
$sanitized = $data; return $data;
} elseif (is_object($data)) { } elseif (is_object($data)) {
$values = array(); $values = array();
foreach (array_keys($data::swaggerTypes()) as $property) { foreach (array_keys($data::swaggerTypes()) as $property) {
@ -71,12 +71,10 @@ class ObjectSerializer
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter());
} }
} }
$sanitized = (object)$values; return (object)$values;
} else { } 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) public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null)
{ {
if (null === $data) { if (null === $data) {
$deserialized = null; return null;
} elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int]
$inner = substr($class, 4, -1); $inner = substr($class, 4, -1);
$deserialized = array(); $deserialized = array();
@ -235,16 +233,17 @@ class ObjectSerializer
$deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator); $deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator);
} }
} }
return $deserialized;
} elseif (strcasecmp(substr($class, -2), '[]') == 0) { } elseif (strcasecmp(substr($class, -2), '[]') == 0) {
$subClass = substr($class, 0, -2); $subClass = substr($class, 0, -2);
$values = array(); $values = array();
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$values[] = self::deserialize($value, $subClass, null, $discriminator); $values[] = self::deserialize($value, $subClass, null, $discriminator);
} }
$deserialized = $values; return $values;
} elseif ($class === 'object') { } elseif ($class === 'object') {
settype($data, 'array'); settype($data, 'array');
$deserialized = $data; return $data;
} elseif ($class === '\DateTime') { } elseif ($class === '\DateTime') {
// Some API's return an invalid, empty string as a // Some API's return an invalid, empty string as a
// date-time property. DateTime::__construct() will return // date-time property. DateTime::__construct() will return
@ -253,13 +252,13 @@ class ObjectSerializer
// be interpreted as a missing field/value. Let's handle // be interpreted as a missing field/value. Let's handle
// this graceful. // this graceful.
if (!empty($data)) { if (!empty($data)) {
$deserialized = new \DateTime($data); return new \DateTime($data);
} else { } else {
$deserialized = null; return null;
} }
} elseif (in_array($class, array({{&primitives}}))) { } elseif (in_array($class, array({{&primitives}}))) {
settype($data, $class); settype($data, $class);
$deserialized = $data; return $data;
} elseif ($class === '\SplFileObject') { } elseif ($class === '\SplFileObject') {
// determine file name // determine file name
if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
@ -270,6 +269,7 @@ class ObjectSerializer
$deserialized = new \SplFileObject($filename, "w"); $deserialized = new \SplFileObject($filename, "w");
$byte_written = $deserialized->fwrite($data); $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()); 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 { } else {
// If a discriminator is defined and points to a valid subclass, use it. // If a discriminator is defined and points to a valid subclass, use it.
@ -292,9 +292,7 @@ class ObjectSerializer
$instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator)); $instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator));
} }
} }
$deserialized = $instance; return $instance;
} }
return $deserialized;
} }
} }

View File

@ -102,7 +102,7 @@ use \{{invokerPackage}}\ObjectSerializer;
*/ */
public function {{operationId}}({{#allParams}}${{paramName}}{{^required}} = null{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) 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; return $response;
} }
@ -130,11 +130,11 @@ use \{{invokerPackage}}\ObjectSerializer;
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_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 {{#queryParams}}// query params
{{#collectionFormat}} {{#collectionFormat}}
@ -223,14 +223,14 @@ use \{{invokerPackage}}\ObjectSerializer;
return array(null, $statusCode, $httpHeader); 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}} {{/returnType}}{{^returnType}}
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
{{/returnType}} {{/returnType}}
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { {{#responses}}{{#dataType}} switch ($e->getCode()) { {{#responses}}{{#dataType}}
{{^isWildcard}}case {{code}}:{{/isWildcard}}{{#isWildcard}}default:{{/isWildcard}} {{^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); $e->setResponseObject($data);
break;{{/dataType}}{{/responses}} break;{{/dataType}}{{/responses}}
} }

View File

@ -192,11 +192,11 @@ class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}implements ArrayA
*/ */
public function __toString() 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); 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}} {{/model}}

View File

@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
- API version: 1.0.0 - API version: 1.0.0
- Package version: 1.0.0 - Package version: 1.0.0
- Build date: 2016-03-30T20:57:56.803+08:00 - Build date: 2016-04-09T18:00:55.578+08:00
- Build package: class io.swagger.codegen.languages.PhpClientCodegen - Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements ## Requirements
@ -80,20 +80,20 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Class | Method | HTTP request | Description Class | Method | HTTP request | Description
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *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* | [**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* | [**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* | [**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* | [**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* | [**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* | [**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* | [**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* | [**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 *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* | [**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* | [**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* | [**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* | [**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 *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 *UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user

View File

@ -5,13 +5,13 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description Method | HTTP request | Description
------------- | ------------- | ------------- ------------- | ------------- | -------------
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store [**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 [**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status [**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags [**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID [**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' [**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' [**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 [**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 [**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 [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image

View File

@ -7,7 +7,7 @@ Method | HTTP request | Description
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID
[**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status [**findOrdersByStatus**](StoreApi.md#findOrdersByStatus) | **GET** /store/findByStatus | Finds orders by status
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories 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 [**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 [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet

View File

@ -222,7 +222,7 @@ try {
Name | Type | Description | Notes 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 ### Return type

View File

@ -90,7 +90,6 @@ class PetApi
return $this; return $this;
} }
/** /**
* addPet * addPet
* *
@ -102,7 +101,7 @@ class PetApi
*/ */
public function addPet($body = null) public function addPet($body = null)
{ {
list($response, $statusCode, $httpHeader) = $this->addPetWithHttpInfo ($body); list($response) = $this->addPetWithHttpInfo ($body);
return $response; return $response;
} }
@ -126,11 +125,11 @@ class PetApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_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'));
@ -156,7 +155,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -166,7 +164,6 @@ class PetApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -174,7 +171,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* addPetUsingByteArray * addPetUsingByteArray
* *
@ -186,7 +182,7 @@ class PetApi
*/ */
public function addPetUsingByteArray($body = null) public function addPetUsingByteArray($body = null)
{ {
list($response, $statusCode, $httpHeader) = $this->addPetUsingByteArrayWithHttpInfo ($body); list($response) = $this->addPetUsingByteArrayWithHttpInfo ($body);
return $response; return $response;
} }
@ -205,16 +201,16 @@ class PetApi
// parse inputs // parse inputs
$resourcePath = "/pet?testing_byte_array=true"; $resourcePath = "/pet?testing_byte_array=true";
$httpBody = ''; $httpBody = '';
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_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'));
@ -240,7 +236,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -250,7 +245,6 @@ class PetApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -258,7 +252,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* deletePet * deletePet
* *
@ -271,7 +264,7 @@ class PetApi
*/ */
public function deletePet($pet_id, $api_key = null) 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; return $response;
} }
@ -300,20 +293,18 @@ class PetApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// header params // header params
if ($api_key !== null) { if ($api_key !== null) {
$headerParams['api_key'] = $this->apiClient->getSerializer()->toHeaderValue($api_key); $headerParams['api_key'] = $this->apiClient->getSerializer()->toHeaderValue($api_key);
} }
// path params // path params
if ($pet_id !== null) { if ($pet_id !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "petId" . "}", "{" . "petId" . "}",
@ -338,7 +329,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -348,7 +338,6 @@ class PetApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -356,7 +345,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* findPetsByStatus * findPetsByStatus
* *
@ -368,7 +356,7 @@ class PetApi
*/ */
public function findPetsByStatus($status = null) public function findPetsByStatus($status = null)
{ {
list($response, $statusCode, $httpHeader) = $this->findPetsByStatusWithHttpInfo ($status); list($response) = $this->findPetsByStatusWithHttpInfo ($status);
return $response; return $response;
} }
@ -392,18 +380,16 @@ class PetApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// query params // query params
if (is_array($status)) { if (is_array($status)) {
$status = $this->apiClient->getSerializer()->serializeCollection($status, 'multi', true); $status = $this->apiClient->getSerializer()->serializeCollection($status, 'multi', true);
} }
if ($status !== null) { if ($status !== null) {
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status); $queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
} }
@ -426,7 +412,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -434,17 +419,15 @@ class PetApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Pet[]' $headerParams, '\Swagger\Client\Model\Pet[]'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -452,7 +435,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* findPetsByTags * findPetsByTags
* *
@ -464,7 +446,7 @@ class PetApi
*/ */
public function findPetsByTags($tags = null) public function findPetsByTags($tags = null)
{ {
list($response, $statusCode, $httpHeader) = $this->findPetsByTagsWithHttpInfo ($tags); list($response) = $this->findPetsByTagsWithHttpInfo ($tags);
return $response; return $response;
} }
@ -488,18 +470,16 @@ class PetApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// query params // query params
if (is_array($tags)) { if (is_array($tags)) {
$tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'multi', true); $tags = $this->apiClient->getSerializer()->serializeCollection($tags, 'multi', true);
} }
if ($tags !== null) { if ($tags !== null) {
$queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags); $queryParams['tags'] = $this->apiClient->getSerializer()->toQueryValue($tags);
} }
@ -522,7 +502,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -530,17 +509,15 @@ class PetApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Pet[]' $headerParams, '\Swagger\Client\Model\Pet[]'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -548,7 +525,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* getPetById * getPetById
* *
@ -560,7 +536,7 @@ class PetApi
*/ */
public function getPetById($pet_id) public function getPetById($pet_id)
{ {
list($response, $statusCode, $httpHeader) = $this->getPetByIdWithHttpInfo ($pet_id); list($response) = $this->getPetByIdWithHttpInfo ($pet_id);
return $response; return $response;
} }
@ -588,16 +564,15 @@ class PetApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
if ($pet_id !== null) { if ($pet_id !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "petId" . "}", "{" . "petId" . "}",
@ -629,7 +604,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -637,17 +611,15 @@ class PetApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Pet' $headerParams, '\Swagger\Client\Model\Pet'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -655,7 +627,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* getPetByIdInObject * getPetByIdInObject
* *
@ -667,7 +638,7 @@ class PetApi
*/ */
public function getPetByIdInObject($pet_id) public function getPetByIdInObject($pet_id)
{ {
list($response, $statusCode, $httpHeader) = $this->getPetByIdInObjectWithHttpInfo ($pet_id); list($response) = $this->getPetByIdInObjectWithHttpInfo ($pet_id);
return $response; return $response;
} }
@ -690,21 +661,20 @@ class PetApi
} }
// parse inputs // parse inputs
$resourcePath = "/pet/{petId}?response=inline_arbitrary_object"; $resourcePath = "/pet/{petId}?response=inline_arbitrary_object";
$httpBody = ''; $httpBody = '';
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
if ($pet_id !== null) { if ($pet_id !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "petId" . "}", "{" . "petId" . "}",
@ -736,7 +706,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -744,17 +713,15 @@ class PetApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\InlineResponse200' $headerParams, '\Swagger\Client\Model\InlineResponse200'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -762,7 +729,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* petPetIdtestingByteArraytrueGet * petPetIdtestingByteArraytrueGet
* *
@ -774,7 +740,7 @@ class PetApi
*/ */
public function petPetIdtestingByteArraytrueGet($pet_id) public function petPetIdtestingByteArraytrueGet($pet_id)
{ {
list($response, $statusCode, $httpHeader) = $this->petPetIdtestingByteArraytrueGetWithHttpInfo ($pet_id); list($response) = $this->petPetIdtestingByteArraytrueGetWithHttpInfo ($pet_id);
return $response; return $response;
} }
@ -797,21 +763,20 @@ class PetApi
} }
// parse inputs // parse inputs
$resourcePath = "/pet/{petId}?testing_byte_array=true"; $resourcePath = "/pet/{petId}?testing_byte_array=true";
$httpBody = ''; $httpBody = '';
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
if ($pet_id !== null) { if ($pet_id !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "petId" . "}", "{" . "petId" . "}",
@ -843,7 +808,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -851,17 +815,15 @@ class PetApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, 'string' $headerParams, 'string'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -869,7 +831,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* updatePet * updatePet
* *
@ -881,7 +842,7 @@ class PetApi
*/ */
public function updatePet($body = null) public function updatePet($body = null)
{ {
list($response, $statusCode, $httpHeader) = $this->updatePetWithHttpInfo ($body); list($response) = $this->updatePetWithHttpInfo ($body);
return $response; return $response;
} }
@ -905,11 +866,11 @@ class PetApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_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'));
@ -935,7 +896,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -945,7 +905,6 @@ class PetApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -953,7 +912,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* updatePetWithForm * updatePetWithForm
* *
@ -967,7 +925,7 @@ class PetApi
*/ */
public function updatePetWithForm($pet_id, $name = null, $status = null) 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; return $response;
} }
@ -997,16 +955,15 @@ class PetApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_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'));
// path params // path params
if ($pet_id !== null) { if ($pet_id !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "petId" . "}", "{" . "petId" . "}",
@ -1019,16 +976,10 @@ class PetApi
// form params // form params
if ($name !== null) { if ($name !== null) {
$formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name); $formParams['name'] = $this->apiClient->getSerializer()->toFormValue($name);
}// form params }// form params
if ($status !== null) { if ($status !== null) {
$formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status); $formParams['status'] = $this->apiClient->getSerializer()->toFormValue($status);
} }
@ -1043,7 +994,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -1053,7 +1003,6 @@ class PetApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -1061,7 +1010,6 @@ class PetApi
throw $e; throw $e;
} }
} }
/** /**
* uploadFile * uploadFile
* *
@ -1075,7 +1023,7 @@ class PetApi
*/ */
public function uploadFile($pet_id, $additional_metadata = null, $file = null) 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; return $response;
} }
@ -1105,16 +1053,15 @@ class PetApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_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'));
// path params // path params
if ($pet_id !== null) { if ($pet_id !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "petId" . "}", "{" . "petId" . "}",
@ -1127,13 +1074,9 @@ class PetApi
// form params // form params
if ($additional_metadata !== null) { if ($additional_metadata !== null) {
$formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata); $formParams['additionalMetadata'] = $this->apiClient->getSerializer()->toFormValue($additional_metadata);
}// form params }// form params
if ($file !== null) { if ($file !== null) {
// PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax // PHP 5.5 introduced a CurlFile object that deprecates the old @filename syntax
// See: https://wiki.php.net/rfc/curl-file-upload // See: https://wiki.php.net/rfc/curl-file-upload
if (function_exists('curl_file_create')) { if (function_exists('curl_file_create')) {
@ -1141,8 +1084,6 @@ class PetApi
} else { } else {
$formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file); $formParams['file'] = '@' . $this->apiClient->getSerializer()->toFormValue($file);
} }
} }
@ -1157,7 +1098,6 @@ class PetApi
if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) { if (strlen($this->apiClient->getConfig()->getAccessToken()) !== 0) {
$headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken(); $headerParams['Authorization'] = 'Bearer ' . $this->apiClient->getConfig()->getAccessToken();
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -1167,7 +1107,6 @@ class PetApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -1175,5 +1114,4 @@ class PetApi
throw $e; throw $e;
} }
} }
} }

View File

@ -90,7 +90,6 @@ class StoreApi
return $this; return $this;
} }
/** /**
* deleteOrder * deleteOrder
* *
@ -102,7 +101,7 @@ class StoreApi
*/ */
public function deleteOrder($order_id) public function deleteOrder($order_id)
{ {
list($response, $statusCode, $httpHeader) = $this->deleteOrderWithHttpInfo ($order_id); list($response) = $this->deleteOrderWithHttpInfo ($order_id);
return $response; return $response;
} }
@ -130,16 +129,15 @@ class StoreApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
if ($order_id !== null) { if ($order_id !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "orderId" . "}", "{" . "orderId" . "}",
@ -159,8 +157,7 @@ class StoreApi
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// make the API Call
// make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, 'DELETE', $resourcePath, 'DELETE',
@ -169,7 +166,6 @@ class StoreApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -177,7 +173,6 @@ class StoreApi
throw $e; throw $e;
} }
} }
/** /**
* findOrdersByStatus * findOrdersByStatus
* *
@ -189,7 +184,7 @@ class StoreApi
*/ */
public function findOrdersByStatus($status = null) public function findOrdersByStatus($status = null)
{ {
list($response, $statusCode, $httpHeader) = $this->findOrdersByStatusWithHttpInfo ($status); list($response) = $this->findOrdersByStatusWithHttpInfo ($status);
return $response; return $response;
} }
@ -213,14 +208,13 @@ class StoreApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// query params // query params
if ($status !== null) { if ($status !== null) {
$queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status); $queryParams['status'] = $this->apiClient->getSerializer()->toQueryValue($status);
} }
@ -252,7 +246,6 @@ class StoreApi
$headerParams['x-test_api_client_secret'] = $apiKey; $headerParams['x-test_api_client_secret'] = $apiKey;
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -260,17 +253,15 @@ class StoreApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Order[]' $headerParams, '\Swagger\Client\Model\Order[]'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -278,7 +269,6 @@ class StoreApi
throw $e; throw $e;
} }
} }
/** /**
* getInventory * getInventory
* *
@ -289,7 +279,7 @@ class StoreApi
*/ */
public function getInventory() public function getInventory()
{ {
list($response, $statusCode, $httpHeader) = $this->getInventoryWithHttpInfo (); list($response) = $this->getInventoryWithHttpInfo ();
return $response; return $response;
} }
@ -312,11 +302,11 @@ class StoreApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -340,7 +330,6 @@ class StoreApi
$headerParams['api_key'] = $apiKey; $headerParams['api_key'] = $apiKey;
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -348,17 +337,15 @@ class StoreApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, 'map[string,int]' $headerParams, 'map[string,int]'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -366,7 +353,6 @@ class StoreApi
throw $e; throw $e;
} }
} }
/** /**
* getInventoryInObject * getInventoryInObject
* *
@ -377,7 +363,7 @@ class StoreApi
*/ */
public function getInventoryInObject() public function getInventoryInObject()
{ {
list($response, $statusCode, $httpHeader) = $this->getInventoryInObjectWithHttpInfo (); list($response) = $this->getInventoryInObjectWithHttpInfo ();
return $response; return $response;
} }
@ -395,16 +381,16 @@ class StoreApi
// parse inputs // parse inputs
$resourcePath = "/store/inventory?response=arbitrary_object"; $resourcePath = "/store/inventory?response=arbitrary_object";
$httpBody = ''; $httpBody = '';
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -428,7 +414,6 @@ class StoreApi
$headerParams['api_key'] = $apiKey; $headerParams['api_key'] = $apiKey;
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -436,17 +421,15 @@ class StoreApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, 'object' $headerParams, 'object'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -454,7 +437,6 @@ class StoreApi
throw $e; throw $e;
} }
} }
/** /**
* getOrderById * getOrderById
* *
@ -466,7 +448,7 @@ class StoreApi
*/ */
public function getOrderById($order_id) public function getOrderById($order_id)
{ {
list($response, $statusCode, $httpHeader) = $this->getOrderByIdWithHttpInfo ($order_id); list($response) = $this->getOrderByIdWithHttpInfo ($order_id);
return $response; return $response;
} }
@ -494,16 +476,15 @@ class StoreApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
if ($order_id !== null) { if ($order_id !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "orderId" . "}", "{" . "orderId" . "}",
@ -537,7 +518,6 @@ class StoreApi
$queryParams['test_api_key_query'] = $apiKey; $queryParams['test_api_key_query'] = $apiKey;
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -545,17 +525,15 @@ class StoreApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Order' $headerParams, '\Swagger\Client\Model\Order'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -563,7 +541,6 @@ class StoreApi
throw $e; throw $e;
} }
} }
/** /**
* placeOrder * placeOrder
* *
@ -575,7 +552,7 @@ class StoreApi
*/ */
public function placeOrder($body = null) public function placeOrder($body = null)
{ {
list($response, $statusCode, $httpHeader) = $this->placeOrderWithHttpInfo ($body); list($response) = $this->placeOrderWithHttpInfo ($body);
return $response; return $response;
} }
@ -599,11 +576,11 @@ class StoreApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -638,7 +615,6 @@ class StoreApi
$headerParams['x-test_api_client_secret'] = $apiKey; $headerParams['x-test_api_client_secret'] = $apiKey;
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -646,17 +622,15 @@ class StoreApi
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\Order' $headerParams, '\Swagger\Client\Model\Order'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -664,5 +638,4 @@ class StoreApi
throw $e; throw $e;
} }
} }
} }

View File

@ -90,7 +90,6 @@ class UserApi
return $this; return $this;
} }
/** /**
* createUser * createUser
* *
@ -102,7 +101,7 @@ class UserApi
*/ */
public function createUser($body = null) public function createUser($body = null)
{ {
list($response, $statusCode, $httpHeader) = $this->createUserWithHttpInfo ($body); list($response) = $this->createUserWithHttpInfo ($body);
return $response; return $response;
} }
@ -126,11 +125,11 @@ class UserApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -151,8 +150,7 @@ class UserApi
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// make the API Call
// make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, 'POST', $resourcePath, 'POST',
@ -161,7 +159,6 @@ class UserApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -169,7 +166,6 @@ class UserApi
throw $e; throw $e;
} }
} }
/** /**
* createUsersWithArrayInput * createUsersWithArrayInput
* *
@ -181,7 +177,7 @@ class UserApi
*/ */
public function createUsersWithArrayInput($body = null) public function createUsersWithArrayInput($body = null)
{ {
list($response, $statusCode, $httpHeader) = $this->createUsersWithArrayInputWithHttpInfo ($body); list($response) = $this->createUsersWithArrayInputWithHttpInfo ($body);
return $response; return $response;
} }
@ -205,11 +201,11 @@ class UserApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -230,8 +226,7 @@ class UserApi
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// make the API Call
// make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, 'POST', $resourcePath, 'POST',
@ -240,7 +235,6 @@ class UserApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -248,7 +242,6 @@ class UserApi
throw $e; throw $e;
} }
} }
/** /**
* createUsersWithListInput * createUsersWithListInput
* *
@ -260,7 +253,7 @@ class UserApi
*/ */
public function createUsersWithListInput($body = null) public function createUsersWithListInput($body = null)
{ {
list($response, $statusCode, $httpHeader) = $this->createUsersWithListInputWithHttpInfo ($body); list($response) = $this->createUsersWithListInputWithHttpInfo ($body);
return $response; return $response;
} }
@ -284,11 +277,11 @@ class UserApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -309,8 +302,7 @@ class UserApi
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// make the API Call
// make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, 'POST', $resourcePath, 'POST',
@ -319,7 +311,6 @@ class UserApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -327,7 +318,6 @@ class UserApi
throw $e; throw $e;
} }
} }
/** /**
* deleteUser * deleteUser
* *
@ -339,7 +329,7 @@ class UserApi
*/ */
public function deleteUser($username) public function deleteUser($username)
{ {
list($response, $statusCode, $httpHeader) = $this->deleteUserWithHttpInfo ($username); list($response) = $this->deleteUserWithHttpInfo ($username);
return $response; return $response;
} }
@ -367,16 +357,15 @@ class UserApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
if ($username !== null) { if ($username !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "username" . "}", "{" . "username" . "}",
@ -401,7 +390,6 @@ class UserApi
if (strlen($this->apiClient->getConfig()->getUsername()) !== 0 or strlen($this->apiClient->getConfig()->getPassword()) !== 0) { 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()); $headerParams['Authorization'] = 'Basic ' . base64_encode($this->apiClient->getConfig()->getUsername() . ":" . $this->apiClient->getConfig()->getPassword());
} }
// make the API Call // make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
@ -411,7 +399,6 @@ class UserApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -419,19 +406,18 @@ class UserApi
throw $e; throw $e;
} }
} }
/** /**
* getUserByName * getUserByName
* *
* Get user by user name * Get user by user name
* *
* @param string $username The name that needs to be fetched. Use user1 for testing. (required) * @param string $username The name that needs to be fetched. Use user1 for testing. (required)
* @return \Swagger\Client\Model\User * @return \Swagger\Client\Model\User
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
public function getUserByName($username) public function getUserByName($username)
{ {
list($response, $statusCode, $httpHeader) = $this->getUserByNameWithHttpInfo ($username); list($response) = $this->getUserByNameWithHttpInfo ($username);
return $response; return $response;
} }
@ -441,7 +427,7 @@ class UserApi
* *
* Get user by user name * Get user by user name
* *
* @param string $username The name that needs to be fetched. Use user1 for testing. (required) * @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) * @return Array of \Swagger\Client\Model\User, HTTP status code, HTTP response headers (array of strings)
* @throws \Swagger\Client\ApiException on non-2xx response * @throws \Swagger\Client\ApiException on non-2xx response
*/ */
@ -459,16 +445,15 @@ class UserApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
if ($username !== null) { if ($username !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "username" . "}", "{" . "username" . "}",
@ -488,25 +473,22 @@ class UserApi
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// make the API Call
// make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, 'GET', $resourcePath, 'GET',
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, '\Swagger\Client\Model\User' $headerParams, '\Swagger\Client\Model\User'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -514,7 +496,6 @@ class UserApi
throw $e; throw $e;
} }
} }
/** /**
* loginUser * loginUser
* *
@ -527,7 +508,7 @@ class UserApi
*/ */
public function loginUser($username = null, $password = null) public function loginUser($username = null, $password = null)
{ {
list($response, $statusCode, $httpHeader) = $this->loginUserWithHttpInfo ($username, $password); list($response) = $this->loginUserWithHttpInfo ($username, $password);
return $response; return $response;
} }
@ -552,18 +533,16 @@ class UserApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// query params // query params
if ($username !== null) { if ($username !== null) {
$queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username); $queryParams['username'] = $this->apiClient->getSerializer()->toQueryValue($username);
}// query params }// query params
if ($password !== null) { if ($password !== null) {
$queryParams['password'] = $this->apiClient->getSerializer()->toQueryValue($password); $queryParams['password'] = $this->apiClient->getSerializer()->toQueryValue($password);
} }
@ -581,25 +560,22 @@ class UserApi
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// make the API Call
// make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, 'GET', $resourcePath, 'GET',
$queryParams, $httpBody, $queryParams, $httpBody,
$headerParams, 'string' $headerParams, 'string'
); );
if (!$response) { if (!$response) {
return array(null, $statusCode, $httpHeader); 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) {
} catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
case 200: 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); $e->setResponseObject($data);
break; break;
} }
@ -607,7 +583,6 @@ class UserApi
throw $e; throw $e;
} }
} }
/** /**
* logoutUser * logoutUser
* *
@ -618,7 +593,7 @@ class UserApi
*/ */
public function logoutUser() public function logoutUser()
{ {
list($response, $statusCode, $httpHeader) = $this->logoutUserWithHttpInfo (); list($response) = $this->logoutUserWithHttpInfo ();
return $response; return $response;
} }
@ -641,11 +616,11 @@ class UserApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
@ -662,8 +637,7 @@ class UserApi
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// make the API Call
// make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, 'GET', $resourcePath, 'GET',
@ -672,7 +646,6 @@ class UserApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -680,7 +653,6 @@ class UserApi
throw $e; throw $e;
} }
} }
/** /**
* updateUser * updateUser
* *
@ -693,7 +665,7 @@ class UserApi
*/ */
public function updateUser($username, $body = null) public function updateUser($username, $body = null)
{ {
list($response, $statusCode, $httpHeader) = $this->updateUserWithHttpInfo ($username, $body); list($response) = $this->updateUserWithHttpInfo ($username, $body);
return $response; return $response;
} }
@ -722,16 +694,15 @@ class UserApi
$queryParams = array(); $queryParams = array();
$headerParams = array(); $headerParams = array();
$formParams = 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)) { if (!is_null($_header_accept)) {
$headerParams['Accept'] = $_header_accept; $headerParams['Accept'] = $_header_accept;
} }
$headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array()); $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array());
// path params // path params
if ($username !== null) { if ($username !== null) {
$resourcePath = str_replace( $resourcePath = str_replace(
"{" . "username" . "}", "{" . "username" . "}",
@ -755,8 +726,7 @@ class UserApi
} elseif (count($formParams) > 0) { } elseif (count($formParams) > 0) {
$httpBody = $formParams; // for HTTP post (form) $httpBody = $formParams; // for HTTP post (form)
} }
// make the API Call
// make the API Call
try { try {
list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( list($response, $statusCode, $httpHeader) = $this->apiClient->callApi(
$resourcePath, 'PUT', $resourcePath, 'PUT',
@ -765,7 +735,6 @@ class UserApi
); );
return array(null, $statusCode, $httpHeader); return array(null, $statusCode, $httpHeader);
} catch (ApiException $e) { } catch (ApiException $e) {
switch ($e->getCode()) { switch ($e->getCode()) {
} }
@ -773,5 +742,4 @@ class UserApi
throw $e; throw $e;
} }
} }
} }

View File

@ -259,7 +259,7 @@ class ApiClient
* *
* @return string Accept (e.g. application/json) * @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] === '')) { if (count($accept) === 0 or (count($accept) === 1 and $accept[0] === '')) {
return null; return null;
@ -277,7 +277,7 @@ class ApiClient
* *
* @return string Content-Type (e.g. application/json) * @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] === '')) { if (count($content_type) === 0 or (count($content_type) === 1 and $content_type[0] === '')) {
return 'application/json'; return 'application/json';
@ -299,9 +299,9 @@ class ApiClient
{ {
// ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986 // ref/credit: http://php.net/manual/en/function.http-parse-headers.php#112986
$headers = array(); $headers = array();
$key = ''; // [+] $key = '';
foreach(explode("\n", $raw_headers) as $i => $h) foreach(explode("\n", $raw_headers) as $h)
{ {
$h = explode(':', $h, 2); $h = explode(':', $h, 2);
@ -311,26 +311,22 @@ class ApiClient
$headers[$h[0]] = trim($h[1]); $headers[$h[0]] = trim($h[1]);
elseif (is_array($headers[$h[0]])) elseif (is_array($headers[$h[0]]))
{ {
// $tmp = array_merge($headers[$h[0]], array(trim($h[1]))); // [-] $headers[$h[0]] = 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]))); // [+]
} }
else else
{ {
// $tmp = array_merge(array($headers[$h[0]]), array(trim($h[1]))); // [-] $headers[$h[0]] = 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]))); // [+]
} }
$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; return $headers;

View File

@ -94,14 +94,12 @@ class Animal implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $class_name * $class_name
* @var string * @var string
*/ */
protected $class_name; protected $class_name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,7 +111,6 @@ class Animal implements ArrayAccess
$this->class_name = $data["class_name"]; $this->class_name = $data["class_name"];
} }
} }
/** /**
* Gets class_name * Gets class_name
* @return string * @return string
@ -134,7 +131,6 @@ class Animal implements ArrayAccess
$this->class_name = $class_name; $this->class_name = $class_name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -182,10 +178,10 @@ class Animal implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -94,14 +94,12 @@ class Cat extends Animal implements ArrayAccess
return parent::getters() + self::$getters; return parent::getters() + self::$getters;
} }
/** /**
* $declawed * $declawed
* @var bool * @var bool
*/ */
protected $declawed; protected $declawed;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,7 +111,6 @@ class Cat extends Animal implements ArrayAccess
$this->declawed = $data["declawed"]; $this->declawed = $data["declawed"];
} }
} }
/** /**
* Gets declawed * Gets declawed
* @return bool * @return bool
@ -134,7 +131,6 @@ class Cat extends Animal implements ArrayAccess
$this->declawed = $declawed; $this->declawed = $declawed;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -182,10 +178,10 @@ class Cat extends Animal implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -98,20 +98,17 @@ class Category implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $name * $name
* @var string * @var string
*/ */
protected $name; protected $name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -124,7 +121,6 @@ class Category implements ArrayAccess
$this->name = $data["name"]; $this->name = $data["name"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -145,7 +141,6 @@ class Category implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets name * Gets name
* @return string * @return string
@ -166,7 +161,6 @@ class Category implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -214,10 +208,10 @@ class Category implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -94,14 +94,12 @@ class Dog extends Animal implements ArrayAccess
return parent::getters() + self::$getters; return parent::getters() + self::$getters;
} }
/** /**
* $breed * $breed
* @var string * @var string
*/ */
protected $breed; protected $breed;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,7 +111,6 @@ class Dog extends Animal implements ArrayAccess
$this->breed = $data["breed"]; $this->breed = $data["breed"];
} }
} }
/** /**
* Gets breed * Gets breed
* @return string * @return string
@ -134,7 +131,6 @@ class Dog extends Animal implements ArrayAccess
$this->breed = $breed; $this->breed = $breed;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -182,10 +178,10 @@ class Dog extends Animal implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -114,44 +114,37 @@ class InlineResponse200 implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $tags * $tags
* @var \Swagger\Client\Model\Tag[] * @var \Swagger\Client\Model\Tag[]
*/ */
protected $tags; protected $tags;
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $category * $category
* @var object * @var object
*/ */
protected $category; protected $category;
/** /**
* $status pet status in the store * $status pet status in the store
* @var string * @var string
*/ */
protected $status; protected $status;
/** /**
* $name * $name
* @var string * @var string
*/ */
protected $name; protected $name;
/** /**
* $photo_urls * $photo_urls
* @var string[] * @var string[]
*/ */
protected $photo_urls; protected $photo_urls;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -168,7 +161,6 @@ class InlineResponse200 implements ArrayAccess
$this->photo_urls = $data["photo_urls"]; $this->photo_urls = $data["photo_urls"];
} }
} }
/** /**
* Gets tags * Gets tags
* @return \Swagger\Client\Model\Tag[] * @return \Swagger\Client\Model\Tag[]
@ -189,7 +181,6 @@ class InlineResponse200 implements ArrayAccess
$this->tags = $tags; $this->tags = $tags;
return $this; return $this;
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -210,7 +201,6 @@ class InlineResponse200 implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets category * Gets category
* @return object * @return object
@ -231,7 +221,6 @@ class InlineResponse200 implements ArrayAccess
$this->category = $category; $this->category = $category;
return $this; return $this;
} }
/** /**
* Gets status * Gets status
* @return string * @return string
@ -255,7 +244,6 @@ class InlineResponse200 implements ArrayAccess
$this->status = $status; $this->status = $status;
return $this; return $this;
} }
/** /**
* Gets name * Gets name
* @return string * @return string
@ -276,7 +264,6 @@ class InlineResponse200 implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Gets photo_urls * Gets photo_urls
* @return string[] * @return string[]
@ -297,7 +284,6 @@ class InlineResponse200 implements ArrayAccess
$this->photo_urls = $photo_urls; $this->photo_urls = $photo_urls;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -345,10 +331,10 @@ class InlineResponse200 implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* Model200Response Class Doc Comment * Model200Response Class Doc Comment
* *
* @category Class * @category Class
* @description * @description Model for testing model name starting with number
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -94,14 +94,12 @@ class Model200Response implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $name * $name
* @var int * @var int
*/ */
protected $name; protected $name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,7 +111,6 @@ class Model200Response implements ArrayAccess
$this->name = $data["name"]; $this->name = $data["name"];
} }
} }
/** /**
* Gets name * Gets name
* @return int * @return int
@ -134,7 +131,6 @@ class Model200Response implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -182,10 +178,10 @@ class Model200Response implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* ModelReturn Class Doc Comment * ModelReturn Class Doc Comment
* *
* @category Class * @category Class
* @description * @description Model for testing reserved words
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -94,14 +94,12 @@ class ModelReturn implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $return * $return
* @var int * @var int
*/ */
protected $return; protected $return;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,7 +111,6 @@ class ModelReturn implements ArrayAccess
$this->return = $data["return"]; $this->return = $data["return"];
} }
} }
/** /**
* Gets return * Gets return
* @return int * @return int
@ -134,7 +131,6 @@ class ModelReturn implements ArrayAccess
$this->return = $return; $this->return = $return;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -182,10 +178,10 @@ class ModelReturn implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -38,7 +38,7 @@ use \ArrayAccess;
* Name Class Doc Comment * Name Class Doc Comment
* *
* @category Class * @category Class
* @description * @description Model for testing model name same as property name
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2
@ -98,20 +98,17 @@ class Name implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $name * $name
* @var int * @var int
*/ */
protected $name; protected $name;
/** /**
* $snake_case * $snake_case
* @var int * @var int
*/ */
protected $snake_case; protected $snake_case;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -124,7 +121,6 @@ class Name implements ArrayAccess
$this->snake_case = $data["snake_case"]; $this->snake_case = $data["snake_case"];
} }
} }
/** /**
* Gets name * Gets name
* @return int * @return int
@ -145,7 +141,6 @@ class Name implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Gets snake_case * Gets snake_case
* @return int * @return int
@ -166,7 +161,6 @@ class Name implements ArrayAccess
$this->snake_case = $snake_case; $this->snake_case = $snake_case;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -214,10 +208,10 @@ class Name implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -114,44 +114,37 @@ class Order implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $pet_id * $pet_id
* @var int * @var int
*/ */
protected $pet_id; protected $pet_id;
/** /**
* $quantity * $quantity
* @var int * @var int
*/ */
protected $quantity; protected $quantity;
/** /**
* $ship_date * $ship_date
* @var \DateTime * @var \DateTime
*/ */
protected $ship_date; protected $ship_date;
/** /**
* $status Order Status * $status Order Status
* @var string * @var string
*/ */
protected $status; protected $status;
/** /**
* $complete * $complete
* @var bool * @var bool
*/ */
protected $complete; protected $complete;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -168,7 +161,6 @@ class Order implements ArrayAccess
$this->complete = $data["complete"]; $this->complete = $data["complete"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -189,7 +181,6 @@ class Order implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets pet_id * Gets pet_id
* @return int * @return int
@ -210,7 +201,6 @@ class Order implements ArrayAccess
$this->pet_id = $pet_id; $this->pet_id = $pet_id;
return $this; return $this;
} }
/** /**
* Gets quantity * Gets quantity
* @return int * @return int
@ -231,7 +221,6 @@ class Order implements ArrayAccess
$this->quantity = $quantity; $this->quantity = $quantity;
return $this; return $this;
} }
/** /**
* Gets ship_date * Gets ship_date
* @return \DateTime * @return \DateTime
@ -252,7 +241,6 @@ class Order implements ArrayAccess
$this->ship_date = $ship_date; $this->ship_date = $ship_date;
return $this; return $this;
} }
/** /**
* Gets status * Gets status
* @return string * @return string
@ -276,7 +264,6 @@ class Order implements ArrayAccess
$this->status = $status; $this->status = $status;
return $this; return $this;
} }
/** /**
* Gets complete * Gets complete
* @return bool * @return bool
@ -297,7 +284,6 @@ class Order implements ArrayAccess
$this->complete = $complete; $this->complete = $complete;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -345,10 +331,10 @@ class Order implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -114,44 +114,37 @@ class Pet implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $category * $category
* @var \Swagger\Client\Model\Category * @var \Swagger\Client\Model\Category
*/ */
protected $category; protected $category;
/** /**
* $name * $name
* @var string * @var string
*/ */
protected $name; protected $name;
/** /**
* $photo_urls * $photo_urls
* @var string[] * @var string[]
*/ */
protected $photo_urls; protected $photo_urls;
/** /**
* $tags * $tags
* @var \Swagger\Client\Model\Tag[] * @var \Swagger\Client\Model\Tag[]
*/ */
protected $tags; protected $tags;
/** /**
* $status pet status in the store * $status pet status in the store
* @var string * @var string
*/ */
protected $status; protected $status;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -168,7 +161,6 @@ class Pet implements ArrayAccess
$this->status = $data["status"]; $this->status = $data["status"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -189,7 +181,6 @@ class Pet implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets category * Gets category
* @return \Swagger\Client\Model\Category * @return \Swagger\Client\Model\Category
@ -210,7 +201,6 @@ class Pet implements ArrayAccess
$this->category = $category; $this->category = $category;
return $this; return $this;
} }
/** /**
* Gets name * Gets name
* @return string * @return string
@ -231,7 +221,6 @@ class Pet implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Gets photo_urls * Gets photo_urls
* @return string[] * @return string[]
@ -252,7 +241,6 @@ class Pet implements ArrayAccess
$this->photo_urls = $photo_urls; $this->photo_urls = $photo_urls;
return $this; return $this;
} }
/** /**
* Gets tags * Gets tags
* @return \Swagger\Client\Model\Tag[] * @return \Swagger\Client\Model\Tag[]
@ -273,7 +261,6 @@ class Pet implements ArrayAccess
$this->tags = $tags; $this->tags = $tags;
return $this; return $this;
} }
/** /**
* Gets status * Gets status
* @return string * @return string
@ -297,7 +284,6 @@ class Pet implements ArrayAccess
$this->status = $status; $this->status = $status;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -345,10 +331,10 @@ class Pet implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -94,14 +94,12 @@ class SpecialModelName implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $special_property_name * $special_property_name
* @var int * @var int
*/ */
protected $special_property_name; protected $special_property_name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -113,7 +111,6 @@ class SpecialModelName implements ArrayAccess
$this->special_property_name = $data["special_property_name"]; $this->special_property_name = $data["special_property_name"];
} }
} }
/** /**
* Gets special_property_name * Gets special_property_name
* @return int * @return int
@ -134,7 +131,6 @@ class SpecialModelName implements ArrayAccess
$this->special_property_name = $special_property_name; $this->special_property_name = $special_property_name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -182,10 +178,10 @@ class SpecialModelName implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -98,20 +98,17 @@ class Tag implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $name * $name
* @var string * @var string
*/ */
protected $name; protected $name;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -124,7 +121,6 @@ class Tag implements ArrayAccess
$this->name = $data["name"]; $this->name = $data["name"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -145,7 +141,6 @@ class Tag implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets name * Gets name
* @return string * @return string
@ -166,7 +161,6 @@ class Tag implements ArrayAccess
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -214,10 +208,10 @@ class Tag implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -122,56 +122,47 @@ class User implements ArrayAccess
return self::$getters; return self::$getters;
} }
/** /**
* $id * $id
* @var int * @var int
*/ */
protected $id; protected $id;
/** /**
* $username * $username
* @var string * @var string
*/ */
protected $username; protected $username;
/** /**
* $first_name * $first_name
* @var string * @var string
*/ */
protected $first_name; protected $first_name;
/** /**
* $last_name * $last_name
* @var string * @var string
*/ */
protected $last_name; protected $last_name;
/** /**
* $email * $email
* @var string * @var string
*/ */
protected $email; protected $email;
/** /**
* $password * $password
* @var string * @var string
*/ */
protected $password; protected $password;
/** /**
* $phone * $phone
* @var string * @var string
*/ */
protected $phone; protected $phone;
/** /**
* $user_status User Status * $user_status User Status
* @var int * @var int
*/ */
protected $user_status; protected $user_status;
/** /**
* Constructor * Constructor
* @param mixed[] $data Associated array of property value initalizing the model * @param mixed[] $data Associated array of property value initalizing the model
@ -190,7 +181,6 @@ class User implements ArrayAccess
$this->user_status = $data["user_status"]; $this->user_status = $data["user_status"];
} }
} }
/** /**
* Gets id * Gets id
* @return int * @return int
@ -211,7 +201,6 @@ class User implements ArrayAccess
$this->id = $id; $this->id = $id;
return $this; return $this;
} }
/** /**
* Gets username * Gets username
* @return string * @return string
@ -232,7 +221,6 @@ class User implements ArrayAccess
$this->username = $username; $this->username = $username;
return $this; return $this;
} }
/** /**
* Gets first_name * Gets first_name
* @return string * @return string
@ -253,7 +241,6 @@ class User implements ArrayAccess
$this->first_name = $first_name; $this->first_name = $first_name;
return $this; return $this;
} }
/** /**
* Gets last_name * Gets last_name
* @return string * @return string
@ -274,7 +261,6 @@ class User implements ArrayAccess
$this->last_name = $last_name; $this->last_name = $last_name;
return $this; return $this;
} }
/** /**
* Gets email * Gets email
* @return string * @return string
@ -295,7 +281,6 @@ class User implements ArrayAccess
$this->email = $email; $this->email = $email;
return $this; return $this;
} }
/** /**
* Gets password * Gets password
* @return string * @return string
@ -316,7 +301,6 @@ class User implements ArrayAccess
$this->password = $password; $this->password = $password;
return $this; return $this;
} }
/** /**
* Gets phone * Gets phone
* @return string * @return string
@ -337,7 +321,6 @@ class User implements ArrayAccess
$this->phone = $phone; $this->phone = $phone;
return $this; return $this;
} }
/** /**
* Gets user_status * Gets user_status
* @return int * @return int
@ -358,7 +341,6 @@ class User implements ArrayAccess
$this->user_status = $user_status; $this->user_status = $user_status;
return $this; return $this;
} }
/** /**
* Returns true if offset exists. False otherwise. * Returns true if offset exists. False otherwise.
* @param integer $offset Offset * @param integer $offset Offset
@ -406,10 +388,10 @@ class User implements ArrayAccess
*/ */
public function __toString() 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); 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));
} }
} }

View File

@ -55,14 +55,14 @@ class ObjectSerializer
public static function sanitizeForSerialization($data) public static function sanitizeForSerialization($data)
{ {
if (is_scalar($data) || null === $data) { if (is_scalar($data) || null === $data) {
$sanitized = $data; return $data;
} elseif ($data instanceof \DateTime) { } elseif ($data instanceof \DateTime) {
$sanitized = $data->format(\DateTime::ATOM); return $data->format(\DateTime::ATOM);
} elseif (is_array($data)) { } elseif (is_array($data)) {
foreach ($data as $property => $value) { foreach ($data as $property => $value) {
$data[$property] = self::sanitizeForSerialization($value); $data[$property] = self::sanitizeForSerialization($value);
} }
$sanitized = $data; return $data;
} elseif (is_object($data)) { } elseif (is_object($data)) {
$values = array(); $values = array();
foreach (array_keys($data::swaggerTypes()) as $property) { foreach (array_keys($data::swaggerTypes()) as $property) {
@ -71,12 +71,10 @@ class ObjectSerializer
$values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter()); $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($data->$getter());
} }
} }
$sanitized = (object)$values; return (object)$values;
} else { } 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) public static function deserialize($data, $class, $httpHeaders=null, $discriminator=null)
{ {
if (null === $data) { if (null === $data) {
$deserialized = null; return null;
} elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int]
$inner = substr($class, 4, -1); $inner = substr($class, 4, -1);
$deserialized = array(); $deserialized = array();
@ -235,16 +233,17 @@ class ObjectSerializer
$deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator); $deserialized[$key] = self::deserialize($value, $subClass, null, $discriminator);
} }
} }
return $deserialized;
} elseif (strcasecmp(substr($class, -2), '[]') == 0) { } elseif (strcasecmp(substr($class, -2), '[]') == 0) {
$subClass = substr($class, 0, -2); $subClass = substr($class, 0, -2);
$values = array(); $values = array();
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
$values[] = self::deserialize($value, $subClass, null, $discriminator); $values[] = self::deserialize($value, $subClass, null, $discriminator);
} }
$deserialized = $values; return $values;
} elseif ($class === 'object') { } elseif ($class === 'object') {
settype($data, 'array'); settype($data, 'array');
$deserialized = $data; return $data;
} elseif ($class === '\DateTime') { } elseif ($class === '\DateTime') {
// Some API's return an invalid, empty string as a // Some API's return an invalid, empty string as a
// date-time property. DateTime::__construct() will return // date-time property. DateTime::__construct() will return
@ -253,13 +252,13 @@ class ObjectSerializer
// be interpreted as a missing field/value. Let's handle // be interpreted as a missing field/value. Let's handle
// this graceful. // this graceful.
if (!empty($data)) { if (!empty($data)) {
$deserialized = new \DateTime($data); return new \DateTime($data);
} else { } else {
$deserialized = null; return null;
} }
} elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) { } elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) {
settype($data, $class); settype($data, $class);
$deserialized = $data; return $data;
} elseif ($class === '\SplFileObject') { } elseif ($class === '\SplFileObject') {
// determine file name // determine file name
if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { if (array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) {
@ -270,6 +269,7 @@ class ObjectSerializer
$deserialized = new \SplFileObject($filename, "w"); $deserialized = new \SplFileObject($filename, "w");
$byte_written = $deserialized->fwrite($data); $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()); 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 { } else {
// If a discriminator is defined and points to a valid subclass, use it. // If a discriminator is defined and points to a valid subclass, use it.
@ -292,9 +292,7 @@ class ObjectSerializer
$instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator)); $instance->$propertySetter(self::deserialize($propertyValue, $type, null, $discriminator));
} }
} }
$deserialized = $instance; return $instance;
} }
return $deserialized;
} }
} }

View File

@ -37,7 +37,7 @@ namespace Swagger\Client\Model;
* Model200ResponseTest Class Doc Comment * Model200ResponseTest Class Doc Comment
* *
* @category Class * @category Class
* @description * @description Model for testing model name starting with number
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2

View File

@ -37,7 +37,7 @@ namespace Swagger\Client\Model;
* ModelReturnTest Class Doc Comment * ModelReturnTest Class Doc Comment
* *
* @category Class * @category Class
* @description * @description Model for testing reserved words
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2

View File

@ -37,7 +37,7 @@ namespace Swagger\Client\Model;
* NameTest Class Doc Comment * NameTest Class Doc Comment
* *
* @category Class * @category Class
* @description * @description Model for testing model name same as property name
* @package Swagger\Client * @package Swagger\Client
* @author http://github.com/swagger-api/swagger-codegen * @author http://github.com/swagger-api/swagger-codegen
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2 * @license http://www.apache.org/licenses/LICENSE-2.0 Apache Licene v2

View File

@ -64,7 +64,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* Test case for addPet * Test case for addPet
* *
@ -74,7 +73,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_addPet() { public function test_addPet() {
} }
/** /**
* Test case for addPetUsingByteArray * Test case for addPetUsingByteArray
* *
@ -84,7 +82,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_addPetUsingByteArray() { public function test_addPetUsingByteArray() {
} }
/** /**
* Test case for deletePet * Test case for deletePet
* *
@ -94,7 +91,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_deletePet() { public function test_deletePet() {
} }
/** /**
* Test case for findPetsByStatus * Test case for findPetsByStatus
* *
@ -104,7 +100,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_findPetsByStatus() { public function test_findPetsByStatus() {
} }
/** /**
* Test case for findPetsByTags * Test case for findPetsByTags
* *
@ -114,7 +109,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_findPetsByTags() { public function test_findPetsByTags() {
} }
/** /**
* Test case for getPetById * Test case for getPetById
* *
@ -124,7 +118,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_getPetById() { public function test_getPetById() {
} }
/** /**
* Test case for getPetByIdInObject * Test case for getPetByIdInObject
* *
@ -134,7 +127,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_getPetByIdInObject() { public function test_getPetByIdInObject() {
} }
/** /**
* Test case for petPetIdtestingByteArraytrueGet * Test case for petPetIdtestingByteArraytrueGet
* *
@ -144,7 +136,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_petPetIdtestingByteArraytrueGet() { public function test_petPetIdtestingByteArraytrueGet() {
} }
/** /**
* Test case for updatePet * Test case for updatePet
* *
@ -154,7 +145,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_updatePet() { public function test_updatePet() {
} }
/** /**
* Test case for updatePetWithForm * Test case for updatePetWithForm
* *
@ -164,7 +154,6 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_updatePetWithForm() { public function test_updatePetWithForm() {
} }
/** /**
* Test case for uploadFile * Test case for uploadFile
* *
@ -174,5 +163,4 @@ class PetApiTest extends \PHPUnit_Framework_TestCase
public function test_uploadFile() { public function test_uploadFile() {
} }
} }

View File

@ -64,7 +64,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* Test case for deleteOrder * Test case for deleteOrder
* *
@ -74,7 +73,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
public function test_deleteOrder() { public function test_deleteOrder() {
} }
/** /**
* Test case for findOrdersByStatus * Test case for findOrdersByStatus
* *
@ -84,7 +82,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
public function test_findOrdersByStatus() { public function test_findOrdersByStatus() {
} }
/** /**
* Test case for getInventory * Test case for getInventory
* *
@ -94,7 +91,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
public function test_getInventory() { public function test_getInventory() {
} }
/** /**
* Test case for getInventoryInObject * Test case for getInventoryInObject
* *
@ -104,7 +100,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
public function test_getInventoryInObject() { public function test_getInventoryInObject() {
} }
/** /**
* Test case for getOrderById * Test case for getOrderById
* *
@ -114,7 +109,6 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
public function test_getOrderById() { public function test_getOrderById() {
} }
/** /**
* Test case for placeOrder * Test case for placeOrder
* *
@ -124,5 +118,4 @@ class StoreApiTest extends \PHPUnit_Framework_TestCase
public function test_placeOrder() { public function test_placeOrder() {
} }
} }

View File

@ -64,7 +64,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* Test case for createUser * Test case for createUser
* *
@ -74,7 +73,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
public function test_createUser() { public function test_createUser() {
} }
/** /**
* Test case for createUsersWithArrayInput * Test case for createUsersWithArrayInput
* *
@ -84,7 +82,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
public function test_createUsersWithArrayInput() { public function test_createUsersWithArrayInput() {
} }
/** /**
* Test case for createUsersWithListInput * Test case for createUsersWithListInput
* *
@ -94,7 +91,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
public function test_createUsersWithListInput() { public function test_createUsersWithListInput() {
} }
/** /**
* Test case for deleteUser * Test case for deleteUser
* *
@ -104,7 +100,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
public function test_deleteUser() { public function test_deleteUser() {
} }
/** /**
* Test case for getUserByName * Test case for getUserByName
* *
@ -114,7 +109,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
public function test_getUserByName() { public function test_getUserByName() {
} }
/** /**
* Test case for loginUser * Test case for loginUser
* *
@ -124,7 +118,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
public function test_loginUser() { public function test_loginUser() {
} }
/** /**
* Test case for logoutUser * Test case for logoutUser
* *
@ -134,7 +127,6 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
public function test_logoutUser() { public function test_logoutUser() {
} }
/** /**
* Test case for updateUser * Test case for updateUser
* *
@ -144,5 +136,4 @@ class UserApiTest extends \PHPUnit_Framework_TestCase
public function test_updateUser() { public function test_updateUser() {
} }
} }