From 9efef02d5f21e67f13c169574f84e45dd4ada911 Mon Sep 17 00:00:00 2001 From: abcsun Date: Sat, 7 May 2016 18:12:28 +0800 Subject: [PATCH] formate the module.mustache --- .../src/main/resources/php/model.mustache | 36 ++++--- .../petstore/php/SwaggerClient-php/README.md | 2 +- .../SwaggerClient-php/lib/Model/Animal.php | 8 -- .../lib/Model/AnimalFarm.php | 2 - .../lib/Model/ApiResponse.php | 23 +---- .../php/SwaggerClient-php/lib/Model/Cat.php | 9 +- .../SwaggerClient-php/lib/Model/Category.php | 16 +--- .../php/SwaggerClient-php/lib/Model/Dog.php | 9 +- .../SwaggerClient-php/lib/Model/EnumClass.php | 2 - .../SwaggerClient-php/lib/Model/EnumTest.php | 13 +-- .../lib/Model/FormatTest.php | 93 +++---------------- .../lib/Model/Model200Response.php | 9 +- .../lib/Model/ModelReturn.php | 9 +- .../php/SwaggerClient-php/lib/Model/Name.php | 22 +---- .../php/SwaggerClient-php/lib/Model/Order.php | 40 +------- .../php/SwaggerClient-php/lib/Model/Pet.php | 40 +------- .../lib/Model/SpecialModelName.php | 9 +- .../php/SwaggerClient-php/lib/Model/Tag.php | 16 +--- .../php/SwaggerClient-php/lib/Model/User.php | 58 ++---------- 19 files changed, 68 insertions(+), 348 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/model.mustache b/modules/swagger-codegen/src/main/resources/php/model.mustache index 34aaa63393c..d17c76c137e 100644 --- a/modules/swagger-codegen/src/main/resources/php/model.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model.mustache @@ -163,14 +163,18 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple public function list_invalid_properties() { $invalid_properties = array(); - {{#vars}}{{#required}} + {{#vars}} + {{#required}} if ($this->container['{{name}}'] === null) { $invalid_properties[] = "'${{name}}' can't be null"; - }{{/required}} - {{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}); + } + {{/required}} + {{#isEnum}} + $allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}); if (!in_array($this->container['{{name}}'], $allowed_values))) { $invalid_properties[] = "invalid value for '${{name}}', must be one of #{allowed_values}."; - }{{/isEnum}} + } + {{/isEnum}} {{#hasValidation}} {{#maxLength}} if (strlen($this->container['{{name}}']) > {{maxLength}}) { @@ -196,7 +200,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple if (!preg_match("{{pattern}}", $this->container['{{name}}'])) { $invalid_properties[] = "invalid value for '${{name}}', must be conform to the pattern {{pattern}}."; } - {{/pattern}}{{/hasValidation}}{{/vars}} + {{/pattern}} + {{/hasValidation}} + {{/vars}} return $invalid_properties; } @@ -208,11 +214,13 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple */ public function valid() { - {{#vars}}{{#required}} + {{#vars}} + {{#required}} if ($this->container['{{name}}'] === null) { return false; }{{/required}} - {{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}); + {{#isEnum}} + $allowed_values = array({{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}); if (!in_array($this->container['{{name}}'], $allowed_values))) { return false; }{{/isEnum}} @@ -241,7 +249,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple if (!preg_match("{{pattern}}", $this->container['{{name}}'])) { return false; } - {{/pattern}}{{/hasValidation}}{{/vars}} + {{/pattern}} + {{/hasValidation}} + {{/vars}} return true; } @@ -263,11 +273,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple */ public function {{setter}}(${{name}}) { - {{#isEnum}}$allowed_values = array({{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}); + {{#isEnum}} + $allowed_values = array({{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}); if (!in_array(${{{name}}}, $allowed_values)) { throw new \InvalidArgumentException("Invalid value for '{{name}}', must be one of {{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}"); - }{{/isEnum}} - + } + {{/isEnum}} {{#hasValidation}} {{#maxLength}} if (strlen(${{name}}) > {{maxLength}}) { @@ -292,7 +303,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple if (!preg_match("{{pattern}}", ${{name}})) { throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be conform to the pattern {{pattern}}.'); } - {{/pattern}}{{/hasValidation}} + {{/pattern}} + {{/hasValidation}} $this->container['{{name}}'] = ${{name}}; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/README.md b/samples/client/petstore/php/SwaggerClient-php/README.md index 5917dc8a7d9..6aea5f66866 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-05-07T07:50:05.452Z +- Build date: 2016-05-07T10:11:34.658Z - Build package: class io.swagger.codegen.languages.PhpClientCodegen ## Requirements 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 7c25695056e..e537ef93414 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Animal.php @@ -142,12 +142,9 @@ class Animal implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - if ($this->container['class_name'] === null) { $invalid_properties[] = "'$class_name' can't be null"; } - - return $invalid_properties; } @@ -159,11 +156,9 @@ class Animal implements ArrayAccess */ public function valid() { - if ($this->container['class_name'] === null) { return false; } - return true; } @@ -185,9 +180,6 @@ class Animal implements ArrayAccess */ public function setClassName($class_name) { - - - $this->container['class_name'] = $class_name; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php index 394c146e532..dc7190652bc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/AnimalFarm.php @@ -130,7 +130,6 @@ class AnimalFarm implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - return $invalid_properties; } @@ -142,7 +141,6 @@ class AnimalFarm implements ArrayAccess */ public function valid() { - return true; } 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 1f087295322..0c7e225d120 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ApiResponse.php @@ -165,13 +165,6 @@ class ApiResponse implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - - - - - return $invalid_properties; } @@ -183,12 +176,11 @@ class ApiResponse implements ArrayAccess */ public function valid() { - - - - + + + return true; } @@ -210,9 +202,6 @@ class ApiResponse implements ArrayAccess */ public function setCode($code) { - - - $this->container['code'] = $code; return $this; @@ -233,9 +222,6 @@ class ApiResponse implements ArrayAccess */ public function setType($type) { - - - $this->container['type'] = $type; return $this; @@ -256,9 +242,6 @@ class ApiResponse implements ArrayAccess */ public function setMessage($message) { - - - $this->container['message'] = $message; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php index 929560e001e..e40d5e969bf 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Cat.php @@ -139,9 +139,6 @@ class Cat extends Animal implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - return $invalid_properties; } @@ -153,8 +150,7 @@ class Cat extends Animal implements ArrayAccess */ public function valid() { - - + return true; } @@ -176,9 +172,6 @@ class Cat extends Animal implements ArrayAccess */ public function setDeclawed($declawed) { - - - $this->container['declawed'] = $declawed; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php index 26d37a15e4a..99c309f6c7e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Category.php @@ -152,11 +152,6 @@ class Category implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - - - return $invalid_properties; } @@ -168,10 +163,9 @@ class Category implements ArrayAccess */ public function valid() { - - - + + return true; } @@ -193,9 +187,6 @@ class Category implements ArrayAccess */ public function setId($id) { - - - $this->container['id'] = $id; return $this; @@ -216,9 +207,6 @@ class Category implements ArrayAccess */ public function setName($name) { - - - $this->container['name'] = $name; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php index 7a106519a81..9999bbba51c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Dog.php @@ -139,9 +139,6 @@ class Dog extends Animal implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - return $invalid_properties; } @@ -153,8 +150,7 @@ class Dog extends Animal implements ArrayAccess */ public function valid() { - - + return true; } @@ -176,9 +172,6 @@ class Dog extends Animal implements ArrayAccess */ public function setBreed($breed) { - - - $this->container['breed'] = $breed; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php index 6996674e02e..00b4a894af0 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumClass.php @@ -130,7 +130,6 @@ class EnumClass implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - return $invalid_properties; } @@ -142,7 +141,6 @@ class EnumClass implements ArrayAccess */ public function valid() { - return true; } diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php index dce42791a04..50d0069dea2 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/EnumTest.php @@ -204,22 +204,18 @@ class EnumTest implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - $allowed_values = array("UPPER", "lower"); if (!in_array($this->container['enum_string'], $allowed_values))) { $invalid_properties[] = "invalid value for '$enum_string', must be one of #{allowed_values}."; } - $allowed_values = array("1", "-1"); if (!in_array($this->container['enum_integer'], $allowed_values))) { $invalid_properties[] = "invalid value for '$enum_integer', must be one of #{allowed_values}."; } - $allowed_values = array("1.1", "-1.2"); if (!in_array($this->container['enum_number'], $allowed_values))) { $invalid_properties[] = "invalid value for '$enum_number', must be one of #{allowed_values}."; } - return $invalid_properties; } @@ -231,7 +227,7 @@ class EnumTest implements ArrayAccess */ public function valid() { - + $allowed_values = array("UPPER", "lower"); if (!in_array($this->container['enum_string'], $allowed_values))) { return false; @@ -246,7 +242,6 @@ class EnumTest implements ArrayAccess if (!in_array($this->container['enum_number'], $allowed_values))) { return false; } - return true; } @@ -271,8 +266,6 @@ class EnumTest implements ArrayAccess if (!in_array($enum_string, $allowed_values)) { throw new \InvalidArgumentException("Invalid value for 'enum_string', must be one of 'UPPER', 'lower'"); } - - $this->container['enum_string'] = $enum_string; return $this; @@ -297,8 +290,6 @@ class EnumTest implements ArrayAccess if (!in_array($enum_integer, $allowed_values)) { throw new \InvalidArgumentException("Invalid value for 'enum_integer', must be one of '1', '-1'"); } - - $this->container['enum_integer'] = $enum_integer; return $this; @@ -323,8 +314,6 @@ class EnumTest implements ArrayAccess if (!in_array($enum_number, $allowed_values)) { throw new \InvalidArgumentException("Invalid value for 'enum_number', must be one of '1.1', '-1.2'"); } - - $this->container['enum_number'] = $enum_number; return $this; 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 7ab03733625..7a99d042353 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/FormatTest.php @@ -295,84 +295,57 @@ class FormatTest implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - if ($this->container['integer'] > 100.0) { $invalid_properties[] = "invalid value for '$integer', must be smaller than or equal to 100.0."; } if ($this->container['integer'] < 10.0) { $invalid_properties[] = "invalid value for '$integer', must be bigger than or equal to 10.0."; } - - if ($this->container['int32'] > 200.0) { $invalid_properties[] = "invalid value for '$int32', must be smaller than or equal to 200.0."; } if ($this->container['int32'] < 20.0) { $invalid_properties[] = "invalid value for '$int32', must be bigger than or equal to 20.0."; } - - - if ($this->container['number'] === null) { $invalid_properties[] = "'$number' can't be null"; } - if ($this->container['number'] > 543.2) { $invalid_properties[] = "invalid value for '$number', must be smaller than or equal to 543.2."; } if ($this->container['number'] < 32.1) { $invalid_properties[] = "invalid value for '$number', must be bigger than or equal to 32.1."; } - - if ($this->container['float'] > 987.6) { $invalid_properties[] = "invalid value for '$float', must be smaller than or equal to 987.6."; } if ($this->container['float'] < 54.3) { $invalid_properties[] = "invalid value for '$float', must be bigger than or equal to 54.3."; } - - if ($this->container['double'] > 123.4) { $invalid_properties[] = "invalid value for '$double', must be smaller than or equal to 123.4."; } if ($this->container['double'] < 67.8) { $invalid_properties[] = "invalid value for '$double', must be bigger than or equal to 67.8."; } - - if (!preg_match("/[a-z]/i", $this->container['string'])) { $invalid_properties[] = "invalid value for '$string', must be conform to the pattern /[a-z]/i."; } - if ($this->container['byte'] === null) { $invalid_properties[] = "'$byte' can't be null"; } - - - - if ($this->container['date'] === null) { $invalid_properties[] = "'$date' can't be null"; } - - - - - - if ($this->container['password'] === null) { $invalid_properties[] = "'$password' can't be null"; } - if (strlen($this->container['password']) > 64) { $invalid_properties[] = "invalid value for '$password', the character length must be smaller than or equal to 64."; } if (strlen($this->container['password']) < 10) { $invalid_properties[] = "invalid value for '$password', the character length must be bigger than or equal to 10."; } - return $invalid_properties; } @@ -384,8 +357,8 @@ class FormatTest implements ArrayAccess */ public function valid() { - - + + if ($this->container['integer'] > 100.0) { return false; } @@ -393,7 +366,7 @@ class FormatTest implements ArrayAccess return false; } - + if ($this->container['int32'] > 200.0) { return false; } @@ -401,12 +374,11 @@ class FormatTest implements ArrayAccess return false; } - if ($this->container['number'] === null) { return false; } - + if ($this->container['number'] > 543.2) { return false; } @@ -414,7 +386,7 @@ class FormatTest implements ArrayAccess return false; } - + if ($this->container['float'] > 987.6) { return false; } @@ -422,7 +394,7 @@ class FormatTest implements ArrayAccess return false; } - + if ($this->container['double'] > 123.4) { return false; } @@ -430,38 +402,34 @@ class FormatTest implements ArrayAccess return false; } - + if (!preg_match("/[a-z]/i", $this->container['string'])) { return false; } - if ($this->container['byte'] === null) { return false; } - - + if ($this->container['date'] === null) { return false; } - - - + + if ($this->container['password'] === null) { return false; } - + if (strlen($this->container['password']) > 64) { return false; } if (strlen($this->container['password']) < 10) { return false; } - return true; } @@ -482,8 +450,6 @@ class FormatTest implements ArrayAccess */ public function setInteger($integer) { - - if ($integer > 100.0) { throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.0.'); @@ -491,7 +457,6 @@ class FormatTest implements ArrayAccess if ($integer < 10.0) { throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be bigger than or equal to 10.0.'); } - $this->container['integer'] = $integer; return $this; @@ -512,8 +477,6 @@ class FormatTest implements ArrayAccess */ public function setInt32($int32) { - - if ($int32 > 200.0) { throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.0.'); @@ -521,7 +484,6 @@ class FormatTest implements ArrayAccess if ($int32 < 20.0) { throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be bigger than or equal to 20.0.'); } - $this->container['int32'] = $int32; return $this; @@ -542,9 +504,6 @@ class FormatTest implements ArrayAccess */ public function setInt64($int64) { - - - $this->container['int64'] = $int64; return $this; @@ -565,8 +524,6 @@ class FormatTest implements ArrayAccess */ public function setNumber($number) { - - if ($number > 543.2) { throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.'); @@ -574,7 +531,6 @@ class FormatTest implements ArrayAccess if ($number < 32.1) { throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be bigger than or equal to 32.1.'); } - $this->container['number'] = $number; return $this; @@ -595,8 +551,6 @@ class FormatTest implements ArrayAccess */ public function setFloat($float) { - - if ($float > 987.6) { throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.'); @@ -604,7 +558,6 @@ class FormatTest implements ArrayAccess if ($float < 54.3) { throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be bigger than or equal to 54.3.'); } - $this->container['float'] = $float; return $this; @@ -625,8 +578,6 @@ class FormatTest implements ArrayAccess */ public function setDouble($double) { - - if ($double > 123.4) { throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.'); @@ -634,7 +585,6 @@ class FormatTest implements ArrayAccess if ($double < 67.8) { throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be bigger than or equal to 67.8.'); } - $this->container['double'] = $double; return $this; @@ -655,13 +605,10 @@ class FormatTest implements ArrayAccess */ public function setString($string) { - - if (!preg_match("/[a-z]/i", $string)) { throw new \InvalidArgumentException('invalid value for $string when calling FormatTest., must be conform to the pattern /[a-z]/i.'); } - $this->container['string'] = $string; return $this; @@ -682,9 +629,6 @@ class FormatTest implements ArrayAccess */ public function setByte($byte) { - - - $this->container['byte'] = $byte; return $this; @@ -705,9 +649,6 @@ class FormatTest implements ArrayAccess */ public function setBinary($binary) { - - - $this->container['binary'] = $binary; return $this; @@ -728,9 +669,6 @@ class FormatTest implements ArrayAccess */ public function setDate($date) { - - - $this->container['date'] = $date; return $this; @@ -751,9 +689,6 @@ class FormatTest implements ArrayAccess */ public function setDateTime($date_time) { - - - $this->container['date_time'] = $date_time; return $this; @@ -774,9 +709,6 @@ class FormatTest implements ArrayAccess */ public function setUuid($uuid) { - - - $this->container['uuid'] = $uuid; return $this; @@ -797,15 +729,12 @@ class FormatTest implements ArrayAccess */ public function setPassword($password) { - - if (strlen($password) > 64) { throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be smaller than or equal to 64.'); } if (strlen($password) < 10) { throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be bigger than or equal to 10.'); } - $this->container['password'] = $password; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php index 263311b9d31..6884fbaed82 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Model200Response.php @@ -139,9 +139,6 @@ class Model200Response implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - return $invalid_properties; } @@ -153,8 +150,7 @@ class Model200Response implements ArrayAccess */ public function valid() { - - + return true; } @@ -176,9 +172,6 @@ class Model200Response implements ArrayAccess */ public function setName($name) { - - - $this->container['name'] = $name; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php index 15298ff50eb..7f8b7e7296b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/ModelReturn.php @@ -139,9 +139,6 @@ class ModelReturn implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - return $invalid_properties; } @@ -153,8 +150,7 @@ class ModelReturn implements ArrayAccess */ public function valid() { - - + return true; } @@ -176,9 +172,6 @@ class ModelReturn implements ArrayAccess */ public function setReturn($return) { - - - $this->container['return'] = $return; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php index 53d12898bd7..9420a11796d 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Name.php @@ -165,16 +165,9 @@ class Name implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - if ($this->container['name'] === null) { $invalid_properties[] = "'$name' can't be null"; } - - - - - - return $invalid_properties; } @@ -186,15 +179,13 @@ class Name implements ArrayAccess */ public function valid() { - if ($this->container['name'] === null) { return false; } - - - + + return true; } @@ -216,9 +207,6 @@ class Name implements ArrayAccess */ public function setName($name) { - - - $this->container['name'] = $name; return $this; @@ -239,9 +227,6 @@ class Name implements ArrayAccess */ public function setSnakeCase($snake_case) { - - - $this->container['snake_case'] = $snake_case; return $this; @@ -262,9 +247,6 @@ class Name implements ArrayAccess */ public function setProperty($property) { - - - $this->container['property'] = $property; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php index 15638a9e3a3..e668f6d432b 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Order.php @@ -219,22 +219,10 @@ class Order implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - - - - - - - $allowed_values = array("placed", "approved", "delivered"); if (!in_array($this->container['status'], $allowed_values))) { $invalid_properties[] = "invalid value for '$status', must be one of #{allowed_values}."; } - - - return $invalid_properties; } @@ -246,21 +234,20 @@ class Order implements ArrayAccess */ public function valid() { - - - - - + + + + + $allowed_values = array("placed", "approved", "delivered"); if (!in_array($this->container['status'], $allowed_values))) { return false; } - return true; } @@ -282,9 +269,6 @@ class Order implements ArrayAccess */ public function setId($id) { - - - $this->container['id'] = $id; return $this; @@ -305,9 +289,6 @@ class Order implements ArrayAccess */ public function setPetId($pet_id) { - - - $this->container['pet_id'] = $pet_id; return $this; @@ -328,9 +309,6 @@ class Order implements ArrayAccess */ public function setQuantity($quantity) { - - - $this->container['quantity'] = $quantity; return $this; @@ -351,9 +329,6 @@ class Order implements ArrayAccess */ public function setShipDate($ship_date) { - - - $this->container['ship_date'] = $ship_date; return $this; @@ -378,8 +353,6 @@ class Order implements ArrayAccess if (!in_array($status, $allowed_values)) { throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'placed', 'approved', 'delivered'"); } - - $this->container['status'] = $status; return $this; @@ -400,9 +373,6 @@ class Order implements ArrayAccess */ public function setComplete($complete) { - - - $this->container['complete'] = $complete; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php index 4025707d369..c949198e642 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Pet.php @@ -219,28 +219,16 @@ class Pet implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - - - if ($this->container['name'] === null) { $invalid_properties[] = "'$name' can't be null"; } - - if ($this->container['photo_urls'] === null) { $invalid_properties[] = "'$photo_urls' can't be null"; } - - - - $allowed_values = array("available", "pending", "sold"); if (!in_array($this->container['status'], $allowed_values))) { $invalid_properties[] = "invalid value for '$status', must be one of #{allowed_values}."; } - return $invalid_properties; } @@ -252,28 +240,25 @@ class Pet implements ArrayAccess */ public function valid() { - - - + + if ($this->container['name'] === null) { return false; } - if ($this->container['photo_urls'] === null) { return false; } - - + + $allowed_values = array("available", "pending", "sold"); if (!in_array($this->container['status'], $allowed_values))) { return false; } - return true; } @@ -294,9 +279,6 @@ class Pet implements ArrayAccess */ public function setId($id) { - - - $this->container['id'] = $id; return $this; @@ -317,9 +299,6 @@ class Pet implements ArrayAccess */ public function setCategory($category) { - - - $this->container['category'] = $category; return $this; @@ -340,9 +319,6 @@ class Pet implements ArrayAccess */ public function setName($name) { - - - $this->container['name'] = $name; return $this; @@ -363,9 +339,6 @@ class Pet implements ArrayAccess */ public function setPhotoUrls($photo_urls) { - - - $this->container['photo_urls'] = $photo_urls; return $this; @@ -386,9 +359,6 @@ class Pet implements ArrayAccess */ public function setTags($tags) { - - - $this->container['tags'] = $tags; return $this; @@ -413,8 +383,6 @@ class Pet implements ArrayAccess if (!in_array($status, $allowed_values)) { throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'available', 'pending', 'sold'"); } - - $this->container['status'] = $status; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php index 680868dbd0b..0e37ecb8f46 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/SpecialModelName.php @@ -139,9 +139,6 @@ class SpecialModelName implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - return $invalid_properties; } @@ -153,8 +150,7 @@ class SpecialModelName implements ArrayAccess */ public function valid() { - - + return true; } @@ -176,9 +172,6 @@ class SpecialModelName implements ArrayAccess */ public function setSpecialPropertyName($special_property_name) { - - - $this->container['special_property_name'] = $special_property_name; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php index 69c853bbef3..d188cc323e4 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/Tag.php @@ -152,11 +152,6 @@ class Tag implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - - - return $invalid_properties; } @@ -168,10 +163,9 @@ class Tag implements ArrayAccess */ public function valid() { - - - + + return true; } @@ -193,9 +187,6 @@ class Tag implements ArrayAccess */ public function setId($id) { - - - $this->container['id'] = $id; return $this; @@ -216,9 +207,6 @@ class Tag implements ArrayAccess */ public function setName($name) { - - - $this->container['name'] = $name; return $this; diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php index 4ca0b8fb3e1..58cb418951e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Model/User.php @@ -230,23 +230,6 @@ class User implements ArrayAccess public function list_invalid_properties() { $invalid_properties = array(); - - - - - - - - - - - - - - - - - return $invalid_properties; } @@ -258,22 +241,21 @@ class User implements ArrayAccess */ public function valid() { - - - - - - - - - + + + + + + + + return true; } @@ -295,9 +277,6 @@ class User implements ArrayAccess */ public function setId($id) { - - - $this->container['id'] = $id; return $this; @@ -318,9 +297,6 @@ class User implements ArrayAccess */ public function setUsername($username) { - - - $this->container['username'] = $username; return $this; @@ -341,9 +317,6 @@ class User implements ArrayAccess */ public function setFirstName($first_name) { - - - $this->container['first_name'] = $first_name; return $this; @@ -364,9 +337,6 @@ class User implements ArrayAccess */ public function setLastName($last_name) { - - - $this->container['last_name'] = $last_name; return $this; @@ -387,9 +357,6 @@ class User implements ArrayAccess */ public function setEmail($email) { - - - $this->container['email'] = $email; return $this; @@ -410,9 +377,6 @@ class User implements ArrayAccess */ public function setPassword($password) { - - - $this->container['password'] = $password; return $this; @@ -433,9 +397,6 @@ class User implements ArrayAccess */ public function setPhone($phone) { - - - $this->container['phone'] = $phone; return $this; @@ -456,9 +417,6 @@ class User implements ArrayAccess */ public function setUserStatus($user_status) { - - - $this->container['user_status'] = $user_status; return $this;