diff --git a/samples/client/petstore/php/.swagger-codegen-ignore b/samples/client/petstore/php/.swagger-codegen-ignore new file mode 100644 index 00000000000..19d3377182e --- /dev/null +++ b/samples/client/petstore/php/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# Thsi matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 25596bbd7d9..cf492be945c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/README.md +++ b/samples/client/petstore/php/SwaggerClient-php/README.md @@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git - API version: 1.0.0 - Package version: -- Build date: 2016-05-20T17:45:19.363+08:00 +- Build date: 2016-05-24T14:56:49.287+02:00 - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements @@ -75,7 +75,7 @@ $password = "password_example"; // string | None try { $api_instance->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"; + echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL; } ?> @@ -128,6 +128,7 @@ Class | Method | HTTP request | Description - [Name](docs/Model/Name.md) - [Order](docs/Model/Order.md) - [Pet](docs/Model/Pet.md) + - [ReadOnlyFirst](docs/Model/ReadOnlyFirst.md) - [SpecialModelName](docs/Model/SpecialModelName.md) - [Tag](docs/Model/Tag.md) - [User](docs/Model/User.md) diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md index bf07517eac1..d3351321e46 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/FakeApi.md @@ -36,7 +36,7 @@ $password = "password_example"; // string | None try { $api_instance->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"; + echo 'Exception when calling FakeApi->testEndpointParameters: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md index 6ab902730c7..3d6bbc24a81 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/PetApi.md @@ -35,7 +35,7 @@ $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet obje try { $api_instance->addPet($body); } catch (Exception $e) { - echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->addPet: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -83,7 +83,7 @@ $api_key = "api_key_example"; // string | try { $api_instance->deletePet($pet_id, $api_key); } catch (Exception $e) { - echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->deletePet: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -132,7 +132,7 @@ try { $result = $api_instance->findPetsByStatus($status); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->findPetsByStatus: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -180,7 +180,7 @@ try { $result = $api_instance->findPetsByTags($tags); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->findPetsByTags: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -230,7 +230,7 @@ try { $result = $api_instance->getPetById($pet_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->getPetById: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -277,7 +277,7 @@ $body = new \Swagger\Client\Model\Pet(); // \Swagger\Client\Model\Pet | Pet obje try { $api_instance->updatePet($body); } catch (Exception $e) { - echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->updatePet: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -326,7 +326,7 @@ $status = "status_example"; // string | Updated status of the pet try { $api_instance->updatePetWithForm($pet_id, $name, $status); } catch (Exception $e) { - echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->updatePetWithForm: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -378,7 +378,7 @@ try { $result = $api_instance->uploadFile($pet_id, $additional_metadata, $file); print_r($result); } catch (Exception $e) { - echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), "\n"; + echo 'Exception when calling PetApi->uploadFile: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md index 24cacd22b47..36a3db3bfb2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/StoreApi.md @@ -28,7 +28,7 @@ $order_id = "order_id_example"; // string | ID of the order that needs to be del try { $api_instance->deleteOrder($order_id); } catch (Exception $e) { - echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), "\n"; + echo 'Exception when calling StoreApi->deleteOrder: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -77,7 +77,7 @@ try { $result = $api_instance->getInventory(); print_r($result); } catch (Exception $e) { - echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), "\n"; + echo 'Exception when calling StoreApi->getInventory: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -119,7 +119,7 @@ try { $result = $api_instance->getOrderById($order_id); print_r($result); } catch (Exception $e) { - echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), "\n"; + echo 'Exception when calling StoreApi->getOrderById: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -164,7 +164,7 @@ try { $result = $api_instance->placeOrder($body); print_r($result); } catch (Exception $e) { - echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), "\n"; + echo 'Exception when calling StoreApi->placeOrder: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md b/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md index 5737f3cdb5e..cc7a222b13f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Api/UserApi.md @@ -32,7 +32,7 @@ $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Create try { $api_instance->createUser($body); } catch (Exception $e) { - echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->createUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -76,7 +76,7 @@ $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object try { $api_instance->createUsersWithArrayInput($body); } catch (Exception $e) { - echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->createUsersWithArrayInput: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -120,7 +120,7 @@ $body = array(new User()); // \Swagger\Client\Model\User[] | List of user object try { $api_instance->createUsersWithListInput($body); } catch (Exception $e) { - echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->createUsersWithListInput: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -164,7 +164,7 @@ $username = "username_example"; // string | The name that needs to be deleted try { $api_instance->deleteUser($username); } catch (Exception $e) { - echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -209,7 +209,7 @@ try { $result = $api_instance->getUserByName($username); print_r($result); } catch (Exception $e) { - echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->getUserByName: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -255,7 +255,7 @@ try { $result = $api_instance->loginUser($username, $password); print_r($result); } catch (Exception $e) { - echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->loginUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -299,7 +299,7 @@ $api_instance = new Swagger\Client\Api\UserApi(); try { $api_instance->logoutUser(); } catch (Exception $e) { - echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->logoutUser: ', $e->getMessage(), PHP_EOL; } ?> ``` @@ -341,7 +341,7 @@ $body = new \Swagger\Client\Model\User(); // \Swagger\Client\Model\User | Update try { $api_instance->updateUser($username, $body); } catch (Exception $e) { - echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), "\n"; + echo 'Exception when calling UserApi->updateUser: ', $e->getMessage(), PHP_EOL; } ?> ``` diff --git a/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..420ac6efe67 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/AdditionalPropertiesClass.md @@ -0,0 +1,9 @@ +# AdditionalPropertiesClass + +## 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/Model/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..c05cee84500 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,11 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uuid** | **string** | | [optional] +**date_time** | [**\DateTime**](\DateTime.md) | | [optional] + +[[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/Model/ReadOnlyFirst.md b/samples/client/petstore/php/SwaggerClient-php/docs/Model/ReadOnlyFirst.md new file mode 100644 index 00000000000..90662a00cf3 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/docs/Model/ReadOnlyFirst.md @@ -0,0 +1,11 @@ +# ReadOnlyFirst + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bar** | **string** | | [optional] +**baz** | **string** | | [optional] + +[[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/ApiClient.php b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php index 6370b9be7a5..da1f438f4da 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ApiClient.php @@ -211,7 +211,7 @@ class ApiClient // debugging for curl if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Request body ~BEGIN~\n".print_r($postData, true)."\n~END~\n", 3, $this->config->getDebugFile()); + error_log("[DEBUG] HTTP Request body ~BEGIN~".PHP_EOL.print_r($postData, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); curl_setopt($curl, CURLOPT_VERBOSE, 1); curl_setopt($curl, CURLOPT_STDERR, fopen($this->config->getDebugFile(), 'a')); @@ -231,7 +231,7 @@ class ApiClient // debug HTTP response body if ($this->config->getDebug()) { - error_log("[DEBUG] HTTP Response body ~BEGIN~\n".print_r($http_body, true)."\n~END~\n", 3, $this->config->getDebugFile()); + error_log("[DEBUG] HTTP Response body ~BEGIN~".PHP_EOL.print_r($http_body, true).PHP_EOL."~END~".PHP_EOL, 3, $this->config->getDebugFile()); } // Handle the response diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php index 33bf0e93651..aed1094c269 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Configuration.php @@ -513,12 +513,12 @@ class Configuration */ public static function toDebugReport() { - $report = "PHP SDK (Swagger\Client) Debug Report:\n"; - $report .= " OS: ".php_uname()."\n"; - $report .= " PHP Version: ".phpversion()."\n"; - $report .= " OpenAPI Spec Version: 1.0.0\n"; - $report .= " SDK Package Version: \n"; - $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath()."\n"; + $report = "PHP SDK (Swagger\Client) Debug Report:".PHP_EOL; + $report .= " OS: ".php_uname().PHP_EOL; + $report .= " PHP Version: ".phpversion().PHP_EOL; + $report .= " OpenAPI Spec Version: 1.0.0".PHP_EOL; + $report .= " SDK Package Version: ".PHP_EOL; + $report .= " Temp Folder Path: ".self::getDefaultConfiguration()->getTempFolderPath().PHP_EOL; return $report; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php new file mode 100644 index 00000000000..4999bc62a8d --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AdditionalPropertiesClass.php @@ -0,0 +1,204 @@ +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/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php new file mode 100644 index 00000000000..86bb4051f0e --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -0,0 +1,252 @@ + 'string', + 'date_time' => '\DateTime' + ); + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = array( + 'uuid' => 'uuid', + 'date_time' => 'dateTime' + ); + + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = array( + 'uuid' => 'setUuid', + 'date_time' => 'setDateTime' + ); + + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = array( + 'uuid' => 'getUuid', + 'date_time' => 'getDateTime' + ); + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array(); + + /** + * Constructor + * @param mixed[] $data Associated array of property value initalizing the model + */ + public function __construct(array $data = null) + { + $this->container['uuid'] = isset($data['uuid']) ? $data['uuid'] : null; + $this->container['date_time'] = isset($data['date_time']) ? $data['date_time'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = array(); + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properteis are valid + */ + public function valid() + { + return true; + } + + + /** + * Gets uuid + * @return string + */ + public function getUuid() + { + return $this->container['uuid']; + } + + /** + * Sets uuid + * @param string $uuid + * @return $this + */ + public function setUuid($uuid) + { + $this->container['uuid'] = $uuid; + + return $this; + } + + /** + * Gets date_time + * @return \DateTime + */ + public function getDateTime() + { + return $this->container['date_time']; + } + + /** + * Sets date_time + * @param \DateTime $date_time + * @return $this + */ + public function setDateTime($date_time) + { + $this->container['date_time'] = $date_time; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->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/ReadOnlyFirst.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php new file mode 100644 index 00000000000..1378f043b64 --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ReadOnlyFirst.php @@ -0,0 +1,252 @@ + 'string', + 'baz' => 'string' + ); + + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of attributes where the key is the local name, and the value is the original name + * @var string[] + */ + protected static $attributeMap = array( + 'bar' => 'bar', + 'baz' => 'baz' + ); + + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * @var string[] + */ + protected static $setters = array( + 'bar' => 'setBar', + 'baz' => 'setBaz' + ); + + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * @var string[] + */ + protected static $getters = array( + 'bar' => 'getBar', + 'baz' => 'getBaz' + ); + + public static function getters() + { + return self::$getters; + } + + + + + + /** + * Associative array for storing property values + * @var mixed[] + */ + protected $container = array(); + + /** + * Constructor + * @param mixed[] $data Associated array of property value initalizing the model + */ + public function __construct(array $data = null) + { + $this->container['bar'] = isset($data['bar']) ? $data['bar'] : null; + $this->container['baz'] = isset($data['baz']) ? $data['baz'] : null; + } + + /** + * show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalid_properties = array(); + return $invalid_properties; + } + + /** + * validate all the properties in the model + * return true if all passed + * + * @return bool True if all properteis are valid + */ + public function valid() + { + return true; + } + + + /** + * Gets bar + * @return string + */ + public function getBar() + { + return $this->container['bar']; + } + + /** + * Sets bar + * @param string $bar + * @return $this + */ + public function setBar($bar) + { + $this->container['bar'] = $bar; + + return $this; + } + + /** + * Gets baz + * @return string + */ + public function getBaz() + { + return $this->container['baz']; + } + + /** + * Sets baz + * @param string $baz + * @return $this + */ + public function setBaz($baz) + { + $this->container['baz'] = $baz; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * @param integer $offset Offset + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->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/ObjectSerializer.php b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php index 19165ad7bb3..af6e87f89fc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/ObjectSerializer.php @@ -271,7 +271,7 @@ class ObjectSerializer $byte_written = $deserialized->fwrite($data); if (Configuration::getDefaultConfiguration()->getDebug()) { - error_log("[DEBUG] 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("[DEBUG] Written $byte_written byte to $filename. Please move the file to a proper folder or delete the temp file after processing.".PHP_EOL, 3, Configuration::getDefaultConfiguration()->getDebugFile()); } return $deserialized; diff --git a/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php b/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php new file mode 100644 index 00000000000..d5150f44b8d --- /dev/null +++ b/samples/client/petstore/php/SwaggerClient-php/test/Model/AdditionalPropertiesClassTest.php @@ -0,0 +1,72 @@ +