diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 80e8d1bae7a..0eb04769d78 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-04-23T22:48:00.795+08:00 +- Build date: 2016-04-27T21:03:06.377+02:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -58,16 +58,24 @@ Please follow the [installation procedure](#installation--usage) and then run th setAccessToken('YOUR_ACCESS_TOKEN'); - -$api_instance = new Swagger\Client\Api\PetApi(); -$body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet object that needs to be added to the store +$api_instance = new Swagger\Client\Api\FakeApi(); +$number = 3.4; // float | None +$double = 1.2; // double | None +$string = "string_example"; // string | None +$byte = "B"; // string | None +$integer = 56; // int | None +$int32 = 56; // int | None +$int64 = 789; // int | None +$float = 3.4; // float | None +$binary = "B"; // string | None +$date = new \DateTime(); // \DateTime | None +$date_time = new \DateTime(); // \DateTime | None +$password = "password_example"; // string | None try { - $api_instance->addPet($body); + $api_instance->testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); } catch (Exception $e) { - echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n"; + echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n"; } ?> @@ -79,6 +87,7 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters *PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store *PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status @@ -104,6 +113,7 @@ Class | Method | HTTP request | Description ## Documentation For Models - [Animal](docs/Animal.md) + - [AnimalFarm](docs/AnimalFarm.md) - [ApiResponse](docs/ApiResponse.md) - [Cat](docs/Cat.md) - [Category](docs/Category.md) @@ -122,12 +132,6 @@ Class | Method | HTTP request | Description ## Documentation For Authorization -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - ## petstore_auth - **Type**: OAuth @@ -137,6 +141,12 @@ Class | Method | HTTP request | Description - **write:pets**: modify pets in your account - **read:pets**: read your pets +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + ## Author diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/AnimalFarm.md b/samples/client/petstore/php/SwaggerClient-php/docs/AnimalFarm.md new file mode 100644 index 00000000000..df6bab21dae --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/AnimalFarm.md @@ -0,0 +1,9 @@ +# AnimalFarm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md new file mode 100644 index 00000000000..93c24ef7eeb --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/FakeApi.md @@ -0,0 +1,75 @@ +# Swagger\Client\FakeApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters + + +# **testEndpointParameters** +> testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password) + +Fake endpoint for testing various parameters + +Fake endpoint for testing various parameters + +### Example +```php +testEndpointParameters($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); +} catch (Exception $e) { + echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), "\n"; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **number** | **float**| None | + **double** | **double**| None | + **string** | **string**| None | + **byte** | **string**| None | + **integer** | **int**| None | [optional] + **int32** | **int**| None | [optional] + **int64** | **int**| None | [optional] + **float** | **float**| None | [optional] + **binary** | **string**| None | [optional] + **date** | **\DateTime**| None | [optional] + **date_time** | **\DateTime**| None | [optional] + **password** | **string**| None | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md b/samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md index e043ee8d2b8..90531d28c40 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/FormatTest.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **binary** | **string** | | [optional] **date** | [**\DateTime**](Date.md) | | **date_time** | [**\DateTime**](\DateTime.md) | | [optional] +**uuid** | [**UUID**](UUID.md) | | [optional] **password** | **string** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php new file mode 100644 index 00000000000..5d9e5ea7c86 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -0,0 +1,239 @@ +getConfig()->setHost('http://petstore.swagger.io/v2'); + } + + $this->apiClient = $apiClient; + } + + /** + * Get API client + * @return \Swagger\Client\ApiClient get the API client + */ + public function getApiClient() + { + return $this->apiClient; + } + + /** + * Set the API client + * @param \Swagger\Client\ApiClient $apiClient set the API client + * @return FakeApi + */ + public function setApiClient(ApiClient $apiClient) + { + $this->apiClient = $apiClient; + return $this; + } + + /** + * testEndpointParameters + * + * Fake endpoint for testing various parameters + * + * @param float $number None (required) + * @param double $double None (required) + * @param string $string None (required) + * @param string $byte None (required) + * @param int $integer None (optional) + * @param int $int32 None (optional) + * @param int $int64 None (optional) + * @param float $float None (optional) + * @param string $binary None (optional) + * @param \DateTime $date None (optional) + * @param \DateTime $date_time None (optional) + * @param string $password None (optional) + * @return void + * @throws \Swagger\Client\ApiException on non-2xx response + */ + public function testEndpointParameters($number, $double, $string, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $binary = null, $date = null, $date_time = null, $password = null) + { + list($response) = $this->testEndpointParametersWithHttpInfo ($number, $double, $string, $byte, $integer, $int32, $int64, $float, $binary, $date, $date_time, $password); + return $response; + } + + + /** + * testEndpointParametersWithHttpInfo + * + * Fake endpoint for testing various parameters + * + * @param float $number None (required) + * @param double $double None (required) + * @param string $string None (required) + * @param string $byte None (required) + * @param int $integer None (optional) + * @param int $int32 None (optional) + * @param int $int64 None (optional) + * @param float $float None (optional) + * @param string $binary None (optional) + * @param \DateTime $date None (optional) + * @param \DateTime $date_time None (optional) + * @param string $password None (optional) + * @return Array of null, HTTP status code, HTTP response headers (array of strings) + * @throws \Swagger\Client\ApiException on non-2xx response + */ + public function testEndpointParametersWithHttpInfo($number, $double, $string, $byte, $integer = null, $int32 = null, $int64 = null, $float = null, $binary = null, $date = null, $date_time = null, $password = null) + { + + // verify the required parameter 'number' is set + if ($number === null) { + throw new \InvalidArgumentException('Missing the required parameter $number when calling testEndpointParameters'); + } + // verify the required parameter 'double' is set + if ($double === null) { + throw new \InvalidArgumentException('Missing the required parameter $double when calling testEndpointParameters'); + } + // verify the required parameter 'string' is set + if ($string === null) { + throw new \InvalidArgumentException('Missing the required parameter $string when calling testEndpointParameters'); + } + // verify the required parameter 'byte' is set + if ($byte === null) { + throw new \InvalidArgumentException('Missing the required parameter $byte when calling testEndpointParameters'); + } + + // parse inputs + $resourcePath = "/fake"; + $httpBody = ''; + $queryParams = array(); + $headerParams = array(); + $formParams = array(); + $_header_accept = $this->apiClient->selectHeaderAccept(array('application/xml', 'application/json')); + if (!is_null($_header_accept)) { + $headerParams['Accept'] = $_header_accept; + } + $headerParams['Content-Type'] = $this->apiClient->selectHeaderContentType(array()); + + + + + // default format to json + $resourcePath = str_replace("{format}", "json", $resourcePath); + + // form params + if ($integer !== null) { + $formParams['integer'] = $this->apiClient->getSerializer()->toFormValue($integer); + }// form params + if ($int32 !== null) { + $formParams['int32'] = $this->apiClient->getSerializer()->toFormValue($int32); + }// form params + if ($int64 !== null) { + $formParams['int64'] = $this->apiClient->getSerializer()->toFormValue($int64); + }// form params + if ($number !== null) { + $formParams['number'] = $this->apiClient->getSerializer()->toFormValue($number); + }// form params + if ($float !== null) { + $formParams['float'] = $this->apiClient->getSerializer()->toFormValue($float); + }// form params + if ($double !== null) { + $formParams['double'] = $this->apiClient->getSerializer()->toFormValue($double); + }// form params + if ($string !== null) { + $formParams['string'] = $this->apiClient->getSerializer()->toFormValue($string); + }// form params + if ($byte !== null) { + $formParams['byte'] = $this->apiClient->getSerializer()->toFormValue($byte); + }// form params + if ($binary !== null) { + $formParams['binary'] = $this->apiClient->getSerializer()->toFormValue($binary); + }// form params + if ($date !== null) { + $formParams['date'] = $this->apiClient->getSerializer()->toFormValue($date); + }// form params + if ($date_time !== null) { + $formParams['dateTime'] = $this->apiClient->getSerializer()->toFormValue($date_time); + }// form params + if ($password !== null) { + $formParams['password'] = $this->apiClient->getSerializer()->toFormValue($password); + } + + + // for model (json/xml) + if (isset($_tempBody)) { + $httpBody = $_tempBody; // $_tempBody is the method argument, if present + } elseif (count($formParams) > 0) { + $httpBody = $formParams; // for HTTP post (form) + } + // make the API Call + try { + list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( + $resourcePath, 'POST', + $queryParams, $httpBody, + $headerParams + ); + + return array(null, $statusCode, $httpHeader); + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + throw $e; + } + } +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php index 3f01e789547..8ea6b41d472 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -101,10 +101,16 @@ class Animal implements ArrayAccess } /** - * $class_name - * @var string - */ - protected $class_name; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['class_name'] + * @var string + */ + 'class_name' => null, + ); /** * Constructor @@ -115,10 +121,10 @@ class Animal implements ArrayAccess // Initialize discriminator property with the model name. $discrimintor = array_search('className', self::$attributeMap); - $this->{$discrimintor} = static::$swaggerModelName; + $this->container[$discrimintor] = static::$swaggerModelName; if ($data != null) { - $this->class_name = $data["class_name"]; + $this->container['class_name'] = $data['class_name']; } } /** @@ -127,7 +133,7 @@ class Animal implements ArrayAccess */ public function getClassName() { - return $this->class_name; + return $this->container['class_name']; } /** @@ -138,7 +144,7 @@ class Animal implements ArrayAccess public function setClassName($class_name) { - $this->class_name = $class_name; + $this->container['class_name'] = $class_name; return $this; } /** @@ -148,7 +154,7 @@ class Animal implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -158,7 +164,7 @@ class Animal implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -169,7 +175,11 @@ class Animal implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -179,7 +189,7 @@ class Animal implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php new file mode 100644 index 00000000000..568aa5b98c7 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php @@ -0,0 +1,178 @@ +container[$offset]); + } + + /** + * Gets offset. + * @param integer $offset Offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * @param integer $offset Offset + * @param mixed $value Value to be set + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * @param integer $offset Offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * @return string + */ + public function __toString() + { + 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)); + } +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php index 4f467a5aab5..4247dc5f1a7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -109,20 +109,28 @@ class ApiResponse implements ArrayAccess } /** - * $code - * @var int - */ - protected $code; - /** - * $type - * @var string - */ - protected $type; - /** - * $message - * @var string - */ - protected $message; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['code'] + * @var int + */ + 'code' => null, + + /** + * $container['type'] + * @var string + */ + 'type' => null, + + /** + * $container['message'] + * @var string + */ + 'message' => null, + ); /** * Constructor @@ -133,9 +141,9 @@ class ApiResponse implements ArrayAccess if ($data != null) { - $this->code = $data["code"]; - $this->type = $data["type"]; - $this->message = $data["message"]; + $this->container['code'] = $data['code']; + $this->container['type'] = $data['type']; + $this->container['message'] = $data['message']; } } /** @@ -144,7 +152,7 @@ class ApiResponse implements ArrayAccess */ public function getCode() { - return $this->code; + return $this->container['code']; } /** @@ -155,7 +163,7 @@ class ApiResponse implements ArrayAccess public function setCode($code) { - $this->code = $code; + $this->container['code'] = $code; return $this; } /** @@ -164,7 +172,7 @@ class ApiResponse implements ArrayAccess */ public function getType() { - return $this->type; + return $this->container['type']; } /** @@ -175,7 +183,7 @@ class ApiResponse implements ArrayAccess public function setType($type) { - $this->type = $type; + $this->container['type'] = $type; return $this; } /** @@ -184,7 +192,7 @@ class ApiResponse implements ArrayAccess */ public function getMessage() { - return $this->message; + return $this->container['message']; } /** @@ -195,7 +203,7 @@ class ApiResponse implements ArrayAccess public function setMessage($message) { - $this->message = $message; + $this->container['message'] = $message; return $this; } /** @@ -205,7 +213,7 @@ class ApiResponse implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -215,7 +223,7 @@ class ApiResponse implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -226,7 +234,11 @@ class ApiResponse implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -236,7 +248,7 @@ class ApiResponse implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index e0eaf7a106d..e8b4db070d9 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -101,10 +101,16 @@ class Cat extends Animal implements ArrayAccess } /** - * $declawed - * @var bool - */ - protected $declawed; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['declawed'] + * @var bool + */ + 'declawed' => null, + ); /** * Constructor @@ -115,7 +121,7 @@ class Cat extends Animal implements ArrayAccess parent::__construct($data); if ($data != null) { - $this->declawed = $data["declawed"]; + $this->container['declawed'] = $data['declawed']; } } /** @@ -124,7 +130,7 @@ class Cat extends Animal implements ArrayAccess */ public function getDeclawed() { - return $this->declawed; + return $this->container['declawed']; } /** @@ -135,7 +141,7 @@ class Cat extends Animal implements ArrayAccess public function setDeclawed($declawed) { - $this->declawed = $declawed; + $this->container['declawed'] = $declawed; return $this; } /** @@ -145,7 +151,7 @@ class Cat extends Animal implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -155,7 +161,7 @@ class Cat extends Animal implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -166,7 +172,11 @@ class Cat extends Animal implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -176,7 +186,7 @@ class Cat extends Animal implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index fb6eed3af29..eb4fdfd413c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -105,15 +105,22 @@ class Category implements ArrayAccess } /** - * $id - * @var int - */ - protected $id; - /** - * $name - * @var string - */ - protected $name; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['id'] + * @var int + */ + 'id' => null, + + /** + * $container['name'] + * @var string + */ + 'name' => null, + ); /** * Constructor @@ -124,8 +131,8 @@ class Category implements ArrayAccess if ($data != null) { - $this->id = $data["id"]; - $this->name = $data["name"]; + $this->container['id'] = $data['id']; + $this->container['name'] = $data['name']; } } /** @@ -134,7 +141,7 @@ class Category implements ArrayAccess */ public function getId() { - return $this->id; + return $this->container['id']; } /** @@ -145,7 +152,7 @@ class Category implements ArrayAccess public function setId($id) { - $this->id = $id; + $this->container['id'] = $id; return $this; } /** @@ -154,7 +161,7 @@ class Category implements ArrayAccess */ public function getName() { - return $this->name; + return $this->container['name']; } /** @@ -165,7 +172,7 @@ class Category implements ArrayAccess public function setName($name) { - $this->name = $name; + $this->container['name'] = $name; return $this; } /** @@ -175,7 +182,7 @@ class Category implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -185,7 +192,7 @@ class Category implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -196,7 +203,11 @@ class Category implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -206,7 +217,7 @@ class Category implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index 6fd43d3a944..665ad7d67ba 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -101,10 +101,16 @@ class Dog extends Animal implements ArrayAccess } /** - * $breed - * @var string - */ - protected $breed; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['breed'] + * @var string + */ + 'breed' => null, + ); /** * Constructor @@ -115,7 +121,7 @@ class Dog extends Animal implements ArrayAccess parent::__construct($data); if ($data != null) { - $this->breed = $data["breed"]; + $this->container['breed'] = $data['breed']; } } /** @@ -124,7 +130,7 @@ class Dog extends Animal implements ArrayAccess */ public function getBreed() { - return $this->breed; + return $this->container['breed']; } /** @@ -135,7 +141,7 @@ class Dog extends Animal implements ArrayAccess public function setBreed($breed) { - $this->breed = $breed; + $this->container['breed'] = $breed; return $this; } /** @@ -145,7 +151,7 @@ class Dog extends Animal implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -155,7 +161,7 @@ class Dog extends Animal implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -166,7 +172,11 @@ class Dog extends Animal implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -176,7 +186,7 @@ class Dog extends Animal implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php index 7bfe30c0ef7..0314dacf61a 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -68,6 +68,7 @@ class FormatTest implements ArrayAccess 'binary' => 'string', 'date' => '\DateTime', 'date_time' => '\DateTime', + 'uuid' => 'UUID', 'password' => 'string' ); @@ -91,6 +92,7 @@ class FormatTest implements ArrayAccess 'binary' => 'binary', 'date' => 'date', 'date_time' => 'dateTime', + 'uuid' => 'uuid', 'password' => 'password' ); @@ -114,6 +116,7 @@ class FormatTest implements ArrayAccess 'binary' => 'setBinary', 'date' => 'setDate', 'date_time' => 'setDateTime', + 'uuid' => 'setUuid', 'password' => 'setPassword' ); @@ -137,6 +140,7 @@ class FormatTest implements ArrayAccess 'binary' => 'getBinary', 'date' => 'getDate', 'date_time' => 'getDateTime', + 'uuid' => 'getUuid', 'password' => 'getPassword' ); @@ -145,65 +149,88 @@ class FormatTest implements ArrayAccess } /** - * $integer - * @var int - */ - protected $integer; - /** - * $int32 - * @var int - */ - protected $int32; - /** - * $int64 - * @var int - */ - protected $int64; - /** - * $number - * @var float - */ - protected $number; - /** - * $float - * @var float - */ - protected $float; - /** - * $double - * @var double - */ - protected $double; - /** - * $string - * @var string - */ - protected $string; - /** - * $byte - * @var string - */ - protected $byte; - /** - * $binary - * @var string - */ - protected $binary; - /** - * $date - * @var \DateTime - */ - protected $date; - /** - * $date_time - * @var \DateTime - */ - protected $date_time; - /** - * $password - * @var string - */ - protected $password; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['integer'] + * @var int + */ + 'integer' => null, + + /** + * $container['int32'] + * @var int + */ + 'int32' => null, + + /** + * $container['int64'] + * @var int + */ + 'int64' => null, + + /** + * $container['number'] + * @var float + */ + 'number' => null, + + /** + * $container['float'] + * @var float + */ + 'float' => null, + + /** + * $container['double'] + * @var double + */ + 'double' => null, + + /** + * $container['string'] + * @var string + */ + 'string' => null, + + /** + * $container['byte'] + * @var string + */ + 'byte' => null, + + /** + * $container['binary'] + * @var string + */ + 'binary' => null, + + /** + * $container['date'] + * @var \DateTime + */ + 'date' => null, + + /** + * $container['date_time'] + * @var \DateTime + */ + 'date_time' => null, + + /** + * $container['uuid'] + * @var UUID + */ + 'uuid' => null, + + /** + * $container['password'] + * @var string + */ + 'password' => null, + ); /** * Constructor @@ -214,18 +241,19 @@ class FormatTest implements ArrayAccess if ($data != null) { - $this->integer = $data["integer"]; - $this->int32 = $data["int32"]; - $this->int64 = $data["int64"]; - $this->number = $data["number"]; - $this->float = $data["float"]; - $this->double = $data["double"]; - $this->string = $data["string"]; - $this->byte = $data["byte"]; - $this->binary = $data["binary"]; - $this->date = $data["date"]; - $this->date_time = $data["date_time"]; - $this->password = $data["password"]; + $this->container['integer'] = $data['integer']; + $this->container['int32'] = $data['int32']; + $this->container['int64'] = $data['int64']; + $this->container['number'] = $data['number']; + $this->container['float'] = $data['float']; + $this->container['double'] = $data['double']; + $this->container['string'] = $data['string']; + $this->container['byte'] = $data['byte']; + $this->container['binary'] = $data['binary']; + $this->container['date'] = $data['date']; + $this->container['date_time'] = $data['date_time']; + $this->container['uuid'] = $data['uuid']; + $this->container['password'] = $data['password']; } } /** @@ -234,7 +262,7 @@ class FormatTest implements ArrayAccess */ public function getInteger() { - return $this->integer; + return $this->container['integer']; } /** @@ -245,7 +273,7 @@ class FormatTest implements ArrayAccess public function setInteger($integer) { - $this->integer = $integer; + $this->container['integer'] = $integer; return $this; } /** @@ -254,7 +282,7 @@ class FormatTest implements ArrayAccess */ public function getInt32() { - return $this->int32; + return $this->container['int32']; } /** @@ -265,7 +293,7 @@ class FormatTest implements ArrayAccess public function setInt32($int32) { - $this->int32 = $int32; + $this->container['int32'] = $int32; return $this; } /** @@ -274,7 +302,7 @@ class FormatTest implements ArrayAccess */ public function getInt64() { - return $this->int64; + return $this->container['int64']; } /** @@ -285,7 +313,7 @@ class FormatTest implements ArrayAccess public function setInt64($int64) { - $this->int64 = $int64; + $this->container['int64'] = $int64; return $this; } /** @@ -294,7 +322,7 @@ class FormatTest implements ArrayAccess */ public function getNumber() { - return $this->number; + return $this->container['number']; } /** @@ -305,7 +333,7 @@ class FormatTest implements ArrayAccess public function setNumber($number) { - $this->number = $number; + $this->container['number'] = $number; return $this; } /** @@ -314,7 +342,7 @@ class FormatTest implements ArrayAccess */ public function getFloat() { - return $this->float; + return $this->container['float']; } /** @@ -325,7 +353,7 @@ class FormatTest implements ArrayAccess public function setFloat($float) { - $this->float = $float; + $this->container['float'] = $float; return $this; } /** @@ -334,7 +362,7 @@ class FormatTest implements ArrayAccess */ public function getDouble() { - return $this->double; + return $this->container['double']; } /** @@ -345,7 +373,7 @@ class FormatTest implements ArrayAccess public function setDouble($double) { - $this->double = $double; + $this->container['double'] = $double; return $this; } /** @@ -354,7 +382,7 @@ class FormatTest implements ArrayAccess */ public function getString() { - return $this->string; + return $this->container['string']; } /** @@ -365,7 +393,7 @@ class FormatTest implements ArrayAccess public function setString($string) { - $this->string = $string; + $this->container['string'] = $string; return $this; } /** @@ -374,7 +402,7 @@ class FormatTest implements ArrayAccess */ public function getByte() { - return $this->byte; + return $this->container['byte']; } /** @@ -385,7 +413,7 @@ class FormatTest implements ArrayAccess public function setByte($byte) { - $this->byte = $byte; + $this->container['byte'] = $byte; return $this; } /** @@ -394,7 +422,7 @@ class FormatTest implements ArrayAccess */ public function getBinary() { - return $this->binary; + return $this->container['binary']; } /** @@ -405,7 +433,7 @@ class FormatTest implements ArrayAccess public function setBinary($binary) { - $this->binary = $binary; + $this->container['binary'] = $binary; return $this; } /** @@ -414,7 +442,7 @@ class FormatTest implements ArrayAccess */ public function getDate() { - return $this->date; + return $this->container['date']; } /** @@ -425,7 +453,7 @@ class FormatTest implements ArrayAccess public function setDate($date) { - $this->date = $date; + $this->container['date'] = $date; return $this; } /** @@ -434,7 +462,7 @@ class FormatTest implements ArrayAccess */ public function getDateTime() { - return $this->date_time; + return $this->container['date_time']; } /** @@ -445,7 +473,27 @@ class FormatTest implements ArrayAccess public function setDateTime($date_time) { - $this->date_time = $date_time; + $this->container['date_time'] = $date_time; + return $this; + } + /** + * Gets uuid + * @return UUID + */ + public function getUuid() + { + return $this->container['uuid']; + } + + /** + * Sets uuid + * @param UUID $uuid + * @return $this + */ + public function setUuid($uuid) + { + + $this->container['uuid'] = $uuid; return $this; } /** @@ -454,7 +502,7 @@ class FormatTest implements ArrayAccess */ public function getPassword() { - return $this->password; + return $this->container['password']; } /** @@ -465,7 +513,7 @@ class FormatTest implements ArrayAccess public function setPassword($password) { - $this->password = $password; + $this->container['password'] = $password; return $this; } /** @@ -475,7 +523,7 @@ class FormatTest implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -485,7 +533,7 @@ class FormatTest implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -496,7 +544,11 @@ class FormatTest implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -506,7 +558,7 @@ class FormatTest implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index 8d62f9531ec..29bf83b4081 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -101,10 +101,16 @@ class Model200Response implements ArrayAccess } /** - * $name - * @var int - */ - protected $name; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['name'] + * @var int + */ + 'name' => null, + ); /** * Constructor @@ -115,7 +121,7 @@ class Model200Response implements ArrayAccess if ($data != null) { - $this->name = $data["name"]; + $this->container['name'] = $data['name']; } } /** @@ -124,7 +130,7 @@ class Model200Response implements ArrayAccess */ public function getName() { - return $this->name; + return $this->container['name']; } /** @@ -135,7 +141,7 @@ class Model200Response implements ArrayAccess public function setName($name) { - $this->name = $name; + $this->container['name'] = $name; return $this; } /** @@ -145,7 +151,7 @@ class Model200Response implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -155,7 +161,7 @@ class Model200Response implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -166,7 +172,11 @@ class Model200Response implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -176,7 +186,7 @@ class Model200Response implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index d4660e118fd..7953b4b56de 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -101,10 +101,16 @@ class ModelReturn implements ArrayAccess } /** - * $return - * @var int - */ - protected $return; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['return'] + * @var int + */ + 'return' => null, + ); /** * Constructor @@ -115,7 +121,7 @@ class ModelReturn implements ArrayAccess if ($data != null) { - $this->return = $data["return"]; + $this->container['return'] = $data['return']; } } /** @@ -124,7 +130,7 @@ class ModelReturn implements ArrayAccess */ public function getReturn() { - return $this->return; + return $this->container['return']; } /** @@ -135,7 +141,7 @@ class ModelReturn implements ArrayAccess public function setReturn($return) { - $this->return = $return; + $this->container['return'] = $return; return $this; } /** @@ -145,7 +151,7 @@ class ModelReturn implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -155,7 +161,7 @@ class ModelReturn implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -166,7 +172,11 @@ class ModelReturn implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -176,7 +186,7 @@ class ModelReturn implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index 9e1c4b92762..e60962bd73d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -109,20 +109,28 @@ class Name implements ArrayAccess } /** - * $name - * @var int - */ - protected $name; - /** - * $snake_case - * @var int - */ - protected $snake_case; - /** - * $property - * @var string - */ - protected $property; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['name'] + * @var int + */ + 'name' => null, + + /** + * $container['snake_case'] + * @var int + */ + 'snake_case' => null, + + /** + * $container['property'] + * @var string + */ + 'property' => null, + ); /** * Constructor @@ -133,9 +141,9 @@ class Name implements ArrayAccess if ($data != null) { - $this->name = $data["name"]; - $this->snake_case = $data["snake_case"]; - $this->property = $data["property"]; + $this->container['name'] = $data['name']; + $this->container['snake_case'] = $data['snake_case']; + $this->container['property'] = $data['property']; } } /** @@ -144,7 +152,7 @@ class Name implements ArrayAccess */ public function getName() { - return $this->name; + return $this->container['name']; } /** @@ -155,7 +163,7 @@ class Name implements ArrayAccess public function setName($name) { - $this->name = $name; + $this->container['name'] = $name; return $this; } /** @@ -164,7 +172,7 @@ class Name implements ArrayAccess */ public function getSnakeCase() { - return $this->snake_case; + return $this->container['snake_case']; } /** @@ -175,7 +183,7 @@ class Name implements ArrayAccess public function setSnakeCase($snake_case) { - $this->snake_case = $snake_case; + $this->container['snake_case'] = $snake_case; return $this; } /** @@ -184,7 +192,7 @@ class Name implements ArrayAccess */ public function getProperty() { - return $this->property; + return $this->container['property']; } /** @@ -195,7 +203,7 @@ class Name implements ArrayAccess public function setProperty($property) { - $this->property = $property; + $this->container['property'] = $property; return $this; } /** @@ -205,7 +213,7 @@ class Name implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -215,7 +223,7 @@ class Name implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -226,7 +234,11 @@ class Name implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -236,7 +248,7 @@ class Name implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 7ee5c124d2c..22afa803685 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -121,35 +121,46 @@ class Order implements ArrayAccess } /** - * $id - * @var int - */ - protected $id; - /** - * $pet_id - * @var int - */ - protected $pet_id; - /** - * $quantity - * @var int - */ - protected $quantity; - /** - * $ship_date - * @var \DateTime - */ - protected $ship_date; - /** - * $status Order Status - * @var string - */ - protected $status; - /** - * $complete - * @var bool - */ - protected $complete = false; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['id'] + * @var int + */ + 'id' => null, + + /** + * $container['pet_id'] + * @var int + */ + 'pet_id' => null, + + /** + * $container['quantity'] + * @var int + */ + 'quantity' => null, + + /** + * $container['ship_date'] + * @var \DateTime + */ + 'ship_date' => null, + + /** + * $container['status'] Order Status + * @var string + */ + 'status' => null, + + /** + * $container['complete'] + * @var bool + */ + 'complete' => false, + ); /** * Constructor @@ -160,12 +171,12 @@ class Order implements ArrayAccess if ($data != null) { - $this->id = $data["id"]; - $this->pet_id = $data["pet_id"]; - $this->quantity = $data["quantity"]; - $this->ship_date = $data["ship_date"]; - $this->status = $data["status"]; - $this->complete = $data["complete"]; + $this->container['id'] = $data['id']; + $this->container['pet_id'] = $data['pet_id']; + $this->container['quantity'] = $data['quantity']; + $this->container['ship_date'] = $data['ship_date']; + $this->container['status'] = $data['status']; + $this->container['complete'] = $data['complete']; } } /** @@ -174,7 +185,7 @@ class Order implements ArrayAccess */ public function getId() { - return $this->id; + return $this->container['id']; } /** @@ -185,7 +196,7 @@ class Order implements ArrayAccess public function setId($id) { - $this->id = $id; + $this->container['id'] = $id; return $this; } /** @@ -194,7 +205,7 @@ class Order implements ArrayAccess */ public function getPetId() { - return $this->pet_id; + return $this->container['pet_id']; } /** @@ -205,7 +216,7 @@ class Order implements ArrayAccess public function setPetId($pet_id) { - $this->pet_id = $pet_id; + $this->container['pet_id'] = $pet_id; return $this; } /** @@ -214,7 +225,7 @@ class Order implements ArrayAccess */ public function getQuantity() { - return $this->quantity; + return $this->container['quantity']; } /** @@ -225,7 +236,7 @@ class Order implements ArrayAccess public function setQuantity($quantity) { - $this->quantity = $quantity; + $this->container['quantity'] = $quantity; return $this; } /** @@ -234,7 +245,7 @@ class Order implements ArrayAccess */ public function getShipDate() { - return $this->ship_date; + return $this->container['ship_date']; } /** @@ -245,7 +256,7 @@ class Order implements ArrayAccess public function setShipDate($ship_date) { - $this->ship_date = $ship_date; + $this->container['ship_date'] = $ship_date; return $this; } /** @@ -254,7 +265,7 @@ class Order implements ArrayAccess */ public function getStatus() { - return $this->status; + return $this->container['status']; } /** @@ -264,11 +275,11 @@ class Order implements ArrayAccess */ public function setStatus($status) { - $allowed_values = array("placed", "approved", "delivered"); + $allowed_values = array('placed', 'approved', 'delivered'); if (!in_array($status, $allowed_values)) { throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'placed', 'approved', 'delivered'"); } - $this->status = $status; + $this->container['status'] = $status; return $this; } /** @@ -277,7 +288,7 @@ class Order implements ArrayAccess */ public function getComplete() { - return $this->complete; + return $this->container['complete']; } /** @@ -288,7 +299,7 @@ class Order implements ArrayAccess public function setComplete($complete) { - $this->complete = $complete; + $this->container['complete'] = $complete; return $this; } /** @@ -298,7 +309,7 @@ class Order implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -308,7 +319,7 @@ class Order implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -319,7 +330,11 @@ class Order implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -329,7 +344,7 @@ class Order implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 3a9e46cd3fb..ce790bf5ca7 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -121,35 +121,46 @@ class Pet implements ArrayAccess } /** - * $id - * @var int - */ - protected $id; - /** - * $category - * @var \Swagger\Client\Model\Category - */ - protected $category; - /** - * $name - * @var string - */ - protected $name; - /** - * $photo_urls - * @var string[] - */ - protected $photo_urls; - /** - * $tags - * @var \Swagger\Client\Model\Tag[] - */ - protected $tags; - /** - * $status pet status in the store - * @var string - */ - protected $status; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['id'] + * @var int + */ + 'id' => null, + + /** + * $container['category'] + * @var \Swagger\Client\Model\Category + */ + 'category' => null, + + /** + * $container['name'] + * @var string + */ + 'name' => null, + + /** + * $container['photo_urls'] + * @var string[] + */ + 'photo_urls' => null, + + /** + * $container['tags'] + * @var \Swagger\Client\Model\Tag[] + */ + 'tags' => null, + + /** + * $container['status'] pet status in the store + * @var string + */ + 'status' => null, + ); /** * Constructor @@ -160,12 +171,12 @@ class Pet implements ArrayAccess if ($data != null) { - $this->id = $data["id"]; - $this->category = $data["category"]; - $this->name = $data["name"]; - $this->photo_urls = $data["photo_urls"]; - $this->tags = $data["tags"]; - $this->status = $data["status"]; + $this->container['id'] = $data['id']; + $this->container['category'] = $data['category']; + $this->container['name'] = $data['name']; + $this->container['photo_urls'] = $data['photo_urls']; + $this->container['tags'] = $data['tags']; + $this->container['status'] = $data['status']; } } /** @@ -174,7 +185,7 @@ class Pet implements ArrayAccess */ public function getId() { - return $this->id; + return $this->container['id']; } /** @@ -185,7 +196,7 @@ class Pet implements ArrayAccess public function setId($id) { - $this->id = $id; + $this->container['id'] = $id; return $this; } /** @@ -194,7 +205,7 @@ class Pet implements ArrayAccess */ public function getCategory() { - return $this->category; + return $this->container['category']; } /** @@ -205,7 +216,7 @@ class Pet implements ArrayAccess public function setCategory($category) { - $this->category = $category; + $this->container['category'] = $category; return $this; } /** @@ -214,7 +225,7 @@ class Pet implements ArrayAccess */ public function getName() { - return $this->name; + return $this->container['name']; } /** @@ -225,7 +236,7 @@ class Pet implements ArrayAccess public function setName($name) { - $this->name = $name; + $this->container['name'] = $name; return $this; } /** @@ -234,7 +245,7 @@ class Pet implements ArrayAccess */ public function getPhotoUrls() { - return $this->photo_urls; + return $this->container['photo_urls']; } /** @@ -245,7 +256,7 @@ class Pet implements ArrayAccess public function setPhotoUrls($photo_urls) { - $this->photo_urls = $photo_urls; + $this->container['photo_urls'] = $photo_urls; return $this; } /** @@ -254,7 +265,7 @@ class Pet implements ArrayAccess */ public function getTags() { - return $this->tags; + return $this->container['tags']; } /** @@ -265,7 +276,7 @@ class Pet implements ArrayAccess public function setTags($tags) { - $this->tags = $tags; + $this->container['tags'] = $tags; return $this; } /** @@ -274,7 +285,7 @@ class Pet implements ArrayAccess */ public function getStatus() { - return $this->status; + return $this->container['status']; } /** @@ -284,11 +295,11 @@ class Pet implements ArrayAccess */ public function setStatus($status) { - $allowed_values = array("available", "pending", "sold"); + $allowed_values = array('available', 'pending', 'sold'); if (!in_array($status, $allowed_values)) { throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'available', 'pending', 'sold'"); } - $this->status = $status; + $this->container['status'] = $status; return $this; } /** @@ -298,7 +309,7 @@ class Pet implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -308,7 +319,7 @@ class Pet implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -319,7 +330,11 @@ class Pet implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -329,7 +344,7 @@ class Pet implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index fb748811cf2..18eee0cf7e4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -101,10 +101,16 @@ class SpecialModelName implements ArrayAccess } /** - * $special_property_name - * @var int - */ - protected $special_property_name; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['special_property_name'] + * @var int + */ + 'special_property_name' => null, + ); /** * Constructor @@ -115,7 +121,7 @@ class SpecialModelName implements ArrayAccess if ($data != null) { - $this->special_property_name = $data["special_property_name"]; + $this->container['special_property_name'] = $data['special_property_name']; } } /** @@ -124,7 +130,7 @@ class SpecialModelName implements ArrayAccess */ public function getSpecialPropertyName() { - return $this->special_property_name; + return $this->container['special_property_name']; } /** @@ -135,7 +141,7 @@ class SpecialModelName implements ArrayAccess public function setSpecialPropertyName($special_property_name) { - $this->special_property_name = $special_property_name; + $this->container['special_property_name'] = $special_property_name; return $this; } /** @@ -145,7 +151,7 @@ class SpecialModelName implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -155,7 +161,7 @@ class SpecialModelName implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -166,7 +172,11 @@ class SpecialModelName implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -176,7 +186,7 @@ class SpecialModelName implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index 4bb56401c48..7e1ab0159d6 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -105,15 +105,22 @@ class Tag implements ArrayAccess } /** - * $id - * @var int - */ - protected $id; - /** - * $name - * @var string - */ - protected $name; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['id'] + * @var int + */ + 'id' => null, + + /** + * $container['name'] + * @var string + */ + 'name' => null, + ); /** * Constructor @@ -124,8 +131,8 @@ class Tag implements ArrayAccess if ($data != null) { - $this->id = $data["id"]; - $this->name = $data["name"]; + $this->container['id'] = $data['id']; + $this->container['name'] = $data['name']; } } /** @@ -134,7 +141,7 @@ class Tag implements ArrayAccess */ public function getId() { - return $this->id; + return $this->container['id']; } /** @@ -145,7 +152,7 @@ class Tag implements ArrayAccess public function setId($id) { - $this->id = $id; + $this->container['id'] = $id; return $this; } /** @@ -154,7 +161,7 @@ class Tag implements ArrayAccess */ public function getName() { - return $this->name; + return $this->container['name']; } /** @@ -165,7 +172,7 @@ class Tag implements ArrayAccess public function setName($name) { - $this->name = $name; + $this->container['name'] = $name; return $this; } /** @@ -175,7 +182,7 @@ class Tag implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -185,7 +192,7 @@ class Tag implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -196,7 +203,11 @@ class Tag implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -206,7 +217,7 @@ class Tag implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index da9cc20ff4c..34a18044a06 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -129,45 +129,58 @@ class User implements ArrayAccess } /** - * $id - * @var int - */ - protected $id; - /** - * $username - * @var string - */ - protected $username; - /** - * $first_name - * @var string - */ - protected $first_name; - /** - * $last_name - * @var string - */ - protected $last_name; - /** - * $email - * @var string - */ - protected $email; - /** - * $password - * @var string - */ - protected $password; - /** - * $phone - * @var string - */ - protected $phone; - /** - * $user_status User Status - * @var int - */ - protected $user_status; + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array( + /** + * $container['id'] + * @var int + */ + 'id' => null, + + /** + * $container['username'] + * @var string + */ + 'username' => null, + + /** + * $container['first_name'] + * @var string + */ + 'first_name' => null, + + /** + * $container['last_name'] + * @var string + */ + 'last_name' => null, + + /** + * $container['email'] + * @var string + */ + 'email' => null, + + /** + * $container['password'] + * @var string + */ + 'password' => null, + + /** + * $container['phone'] + * @var string + */ + 'phone' => null, + + /** + * $container['user_status'] User Status + * @var int + */ + 'user_status' => null, + ); /** * Constructor @@ -178,14 +191,14 @@ class User implements ArrayAccess if ($data != null) { - $this->id = $data["id"]; - $this->username = $data["username"]; - $this->first_name = $data["first_name"]; - $this->last_name = $data["last_name"]; - $this->email = $data["email"]; - $this->password = $data["password"]; - $this->phone = $data["phone"]; - $this->user_status = $data["user_status"]; + $this->container['id'] = $data['id']; + $this->container['username'] = $data['username']; + $this->container['first_name'] = $data['first_name']; + $this->container['last_name'] = $data['last_name']; + $this->container['email'] = $data['email']; + $this->container['password'] = $data['password']; + $this->container['phone'] = $data['phone']; + $this->container['user_status'] = $data['user_status']; } } /** @@ -194,7 +207,7 @@ class User implements ArrayAccess */ public function getId() { - return $this->id; + return $this->container['id']; } /** @@ -205,7 +218,7 @@ class User implements ArrayAccess public function setId($id) { - $this->id = $id; + $this->container['id'] = $id; return $this; } /** @@ -214,7 +227,7 @@ class User implements ArrayAccess */ public function getUsername() { - return $this->username; + return $this->container['username']; } /** @@ -225,7 +238,7 @@ class User implements ArrayAccess public function setUsername($username) { - $this->username = $username; + $this->container['username'] = $username; return $this; } /** @@ -234,7 +247,7 @@ class User implements ArrayAccess */ public function getFirstName() { - return $this->first_name; + return $this->container['first_name']; } /** @@ -245,7 +258,7 @@ class User implements ArrayAccess public function setFirstName($first_name) { - $this->first_name = $first_name; + $this->container['first_name'] = $first_name; return $this; } /** @@ -254,7 +267,7 @@ class User implements ArrayAccess */ public function getLastName() { - return $this->last_name; + return $this->container['last_name']; } /** @@ -265,7 +278,7 @@ class User implements ArrayAccess public function setLastName($last_name) { - $this->last_name = $last_name; + $this->container['last_name'] = $last_name; return $this; } /** @@ -274,7 +287,7 @@ class User implements ArrayAccess */ public function getEmail() { - return $this->email; + return $this->container['email']; } /** @@ -285,7 +298,7 @@ class User implements ArrayAccess public function setEmail($email) { - $this->email = $email; + $this->container['email'] = $email; return $this; } /** @@ -294,7 +307,7 @@ class User implements ArrayAccess */ public function getPassword() { - return $this->password; + return $this->container['password']; } /** @@ -305,7 +318,7 @@ class User implements ArrayAccess public function setPassword($password) { - $this->password = $password; + $this->container['password'] = $password; return $this; } /** @@ -314,7 +327,7 @@ class User implements ArrayAccess */ public function getPhone() { - return $this->phone; + return $this->container['phone']; } /** @@ -325,7 +338,7 @@ class User implements ArrayAccess public function setPhone($phone) { - $this->phone = $phone; + $this->container['phone'] = $phone; return $this; } /** @@ -334,7 +347,7 @@ class User implements ArrayAccess */ public function getUserStatus() { - return $this->user_status; + return $this->container['user_status']; } /** @@ -345,7 +358,7 @@ class User implements ArrayAccess public function setUserStatus($user_status) { - $this->user_status = $user_status; + $this->container['user_status'] = $user_status; return $this; } /** @@ -355,7 +368,7 @@ class User implements ArrayAccess */ public function offsetExists($offset) { - return isset($this->$offset); + return isset($this->container[$offset]); } /** @@ -365,7 +378,7 @@ class User implements ArrayAccess */ public function offsetGet($offset) { - return $this->$offset; + return isset($this->container[$offset]) ? $this->container[$offset] : null; } /** @@ -376,7 +389,11 @@ class User implements ArrayAccess */ public function offsetSet($offset, $value) { - $this->$offset = $value; + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } } /** @@ -386,7 +403,7 @@ class User implements ArrayAccess */ public function offsetUnset($offset) { - unset($this->$offset); + unset($this->container[$offset]); } /** diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index 3adaa899f5f..ac63c18fbd5 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -256,7 +256,7 @@ class ObjectSerializer } else { return null; } - } elseif (in_array($class, array('integer', 'int', 'void', 'number', 'object', 'double', 'float', 'byte', 'DateTime', 'string', 'mixed', 'boolean', 'bool'))) { + } elseif (in_array($class, array('void', 'bool', 'string', 'double', 'byte', 'mixed', 'integer', 'float', 'int', 'DateTime', 'number', 'boolean', 'object'))) { settype($data, $class); return $data; } elseif ($class === '\SplFileObject') { diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Tests/AnimalFarmTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/AnimalFarmTest.php new file mode 100644 index 00000000000..f154716c064 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Tests/AnimalFarmTest.php @@ -0,0 +1,70 @@ +