formate the module.mustache

This commit is contained in:
abcsun 2016-05-07 18:12:28 +08:00
parent df1d36cf47
commit 9efef02d5f
19 changed files with 68 additions and 348 deletions

View File

@ -163,14 +163,18 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
{{#vars}}{{#required}} {{#vars}}
{{#required}}
if ($this->container['{{name}}'] === null) { if ($this->container['{{name}}'] === null) {
$invalid_properties[] = "'${{name}}' can't be 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))) { if (!in_array($this->container['{{name}}'], $allowed_values))) {
$invalid_properties[] = "invalid value for '${{name}}', must be one of #{allowed_values}."; $invalid_properties[] = "invalid value for '${{name}}', must be one of #{allowed_values}.";
}{{/isEnum}} }
{{/isEnum}}
{{#hasValidation}} {{#hasValidation}}
{{#maxLength}} {{#maxLength}}
if (strlen($this->container['{{name}}']) > {{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}}'])) { if (!preg_match("{{pattern}}", $this->container['{{name}}'])) {
$invalid_properties[] = "invalid value for '${{name}}', must be conform to the pattern {{pattern}}."; $invalid_properties[] = "invalid value for '${{name}}', must be conform to the pattern {{pattern}}.";
} }
{{/pattern}}{{/hasValidation}}{{/vars}} {{/pattern}}
{{/hasValidation}}
{{/vars}}
return $invalid_properties; return $invalid_properties;
} }
@ -208,11 +214,13 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
*/ */
public function valid() public function valid()
{ {
{{#vars}}{{#required}} {{#vars}}
{{#required}}
if ($this->container['{{name}}'] === null) { if ($this->container['{{name}}'] === null) {
return false; return false;
}{{/required}} }{{/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))) { if (!in_array($this->container['{{name}}'], $allowed_values))) {
return false; return false;
}{{/isEnum}} }{{/isEnum}}
@ -241,7 +249,9 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
if (!preg_match("{{pattern}}", $this->container['{{name}}'])) { if (!preg_match("{{pattern}}", $this->container['{{name}}'])) {
return false; return false;
} }
{{/pattern}}{{/hasValidation}}{{/vars}} {{/pattern}}
{{/hasValidation}}
{{/vars}}
return true; return true;
} }
@ -263,11 +273,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
*/ */
public function {{setter}}(${{name}}) 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)) { if (!in_array(${{{name}}}, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for '{{name}}', must be one of {{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}"); throw new \InvalidArgumentException("Invalid value for '{{name}}', must be one of {{#allowableValues}}{{#values}}'{{{this}}}'{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}");
}{{/isEnum}} }
{{/isEnum}}
{{#hasValidation}} {{#hasValidation}}
{{#maxLength}} {{#maxLength}}
if (strlen(${{name}}) > {{maxLength}}) { if (strlen(${{name}}) > {{maxLength}}) {
@ -292,7 +303,8 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
if (!preg_match("{{pattern}}", ${{name}})) { if (!preg_match("{{pattern}}", ${{name}})) {
throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be conform to the pattern {{pattern}}.'); 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}}; $this->container['{{name}}'] = ${{name}};
return $this; return $this;

View File

@ -5,7 +5,7 @@ This PHP package is automatically generated by the [Swagger Codegen](https://git
- API version: 1.0.0 - API version: 1.0.0
- Package version: 1.0.0 - Package version: 1.0.0
- Build date: 2016-05-07T07:50:05.452Z - Build date: 2016-05-07T10:11:34.658Z
- Build package: class io.swagger.codegen.languages.PhpClientCodegen - Build package: class io.swagger.codegen.languages.PhpClientCodegen
## Requirements ## Requirements

View File

@ -142,12 +142,9 @@ class Animal implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
if ($this->container['class_name'] === null) { if ($this->container['class_name'] === null) {
$invalid_properties[] = "'$class_name' can't be null"; $invalid_properties[] = "'$class_name' can't be null";
} }
return $invalid_properties; return $invalid_properties;
} }
@ -159,12 +156,10 @@ class Animal implements ArrayAccess
*/ */
public function valid() public function valid()
{ {
if ($this->container['class_name'] === null) { if ($this->container['class_name'] === null) {
return false; return false;
} }
return true; return true;
} }
@ -185,9 +180,6 @@ class Animal implements ArrayAccess
*/ */
public function setClassName($class_name) public function setClassName($class_name)
{ {
$this->container['class_name'] = $class_name; $this->container['class_name'] = $class_name;
return $this; return $this;

View File

@ -130,7 +130,6 @@ class AnimalFarm implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -142,7 +141,6 @@ class AnimalFarm implements ArrayAccess
*/ */
public function valid() public function valid()
{ {
return true; return true;
} }

View File

@ -165,13 +165,6 @@ class ApiResponse implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -189,7 +182,6 @@ class ApiResponse implements ArrayAccess
return true; return true;
} }
@ -210,9 +202,6 @@ class ApiResponse implements ArrayAccess
*/ */
public function setCode($code) public function setCode($code)
{ {
$this->container['code'] = $code; $this->container['code'] = $code;
return $this; return $this;
@ -233,9 +222,6 @@ class ApiResponse implements ArrayAccess
*/ */
public function setType($type) public function setType($type)
{ {
$this->container['type'] = $type; $this->container['type'] = $type;
return $this; return $this;
@ -256,9 +242,6 @@ class ApiResponse implements ArrayAccess
*/ */
public function setMessage($message) public function setMessage($message)
{ {
$this->container['message'] = $message; $this->container['message'] = $message;
return $this; return $this;

View File

@ -139,9 +139,6 @@ class Cat extends Animal implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -155,7 +152,6 @@ class Cat extends Animal implements ArrayAccess
{ {
return true; return true;
} }
@ -176,9 +172,6 @@ class Cat extends Animal implements ArrayAccess
*/ */
public function setDeclawed($declawed) public function setDeclawed($declawed)
{ {
$this->container['declawed'] = $declawed; $this->container['declawed'] = $declawed;
return $this; return $this;

View File

@ -152,11 +152,6 @@ class Category implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -172,7 +167,6 @@ class Category implements ArrayAccess
return true; return true;
} }
@ -193,9 +187,6 @@ class Category implements ArrayAccess
*/ */
public function setId($id) public function setId($id)
{ {
$this->container['id'] = $id; $this->container['id'] = $id;
return $this; return $this;
@ -216,9 +207,6 @@ class Category implements ArrayAccess
*/ */
public function setName($name) public function setName($name)
{ {
$this->container['name'] = $name; $this->container['name'] = $name;
return $this; return $this;

View File

@ -139,9 +139,6 @@ class Dog extends Animal implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -155,7 +152,6 @@ class Dog extends Animal implements ArrayAccess
{ {
return true; return true;
} }
@ -176,9 +172,6 @@ class Dog extends Animal implements ArrayAccess
*/ */
public function setBreed($breed) public function setBreed($breed)
{ {
$this->container['breed'] = $breed; $this->container['breed'] = $breed;
return $this; return $this;

View File

@ -130,7 +130,6 @@ class EnumClass implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -142,7 +141,6 @@ class EnumClass implements ArrayAccess
*/ */
public function valid() public function valid()
{ {
return true; return true;
} }

View File

@ -204,22 +204,18 @@ class EnumTest implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
$allowed_values = array("UPPER", "lower"); $allowed_values = array("UPPER", "lower");
if (!in_array($this->container['enum_string'], $allowed_values))) { if (!in_array($this->container['enum_string'], $allowed_values))) {
$invalid_properties[] = "invalid value for '$enum_string', must be one of #{allowed_values}."; $invalid_properties[] = "invalid value for '$enum_string', must be one of #{allowed_values}.";
} }
$allowed_values = array("1", "-1"); $allowed_values = array("1", "-1");
if (!in_array($this->container['enum_integer'], $allowed_values))) { if (!in_array($this->container['enum_integer'], $allowed_values))) {
$invalid_properties[] = "invalid value for '$enum_integer', must be one of #{allowed_values}."; $invalid_properties[] = "invalid value for '$enum_integer', must be one of #{allowed_values}.";
} }
$allowed_values = array("1.1", "-1.2"); $allowed_values = array("1.1", "-1.2");
if (!in_array($this->container['enum_number'], $allowed_values))) { if (!in_array($this->container['enum_number'], $allowed_values))) {
$invalid_properties[] = "invalid value for '$enum_number', must be one of #{allowed_values}."; $invalid_properties[] = "invalid value for '$enum_number', must be one of #{allowed_values}.";
} }
return $invalid_properties; return $invalid_properties;
} }
@ -246,7 +242,6 @@ class EnumTest implements ArrayAccess
if (!in_array($this->container['enum_number'], $allowed_values))) { if (!in_array($this->container['enum_number'], $allowed_values))) {
return false; return false;
} }
return true; return true;
} }
@ -271,8 +266,6 @@ class EnumTest implements ArrayAccess
if (!in_array($enum_string, $allowed_values)) { if (!in_array($enum_string, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for 'enum_string', must be one of 'UPPER', 'lower'"); throw new \InvalidArgumentException("Invalid value for 'enum_string', must be one of 'UPPER', 'lower'");
} }
$this->container['enum_string'] = $enum_string; $this->container['enum_string'] = $enum_string;
return $this; return $this;
@ -297,8 +290,6 @@ class EnumTest implements ArrayAccess
if (!in_array($enum_integer, $allowed_values)) { if (!in_array($enum_integer, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for 'enum_integer', must be one of '1', '-1'"); throw new \InvalidArgumentException("Invalid value for 'enum_integer', must be one of '1', '-1'");
} }
$this->container['enum_integer'] = $enum_integer; $this->container['enum_integer'] = $enum_integer;
return $this; return $this;
@ -323,8 +314,6 @@ class EnumTest implements ArrayAccess
if (!in_array($enum_number, $allowed_values)) { if (!in_array($enum_number, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for 'enum_number', must be one of '1.1', '-1.2'"); throw new \InvalidArgumentException("Invalid value for 'enum_number', must be one of '1.1', '-1.2'");
} }
$this->container['enum_number'] = $enum_number; $this->container['enum_number'] = $enum_number;
return $this; return $this;

View File

@ -295,84 +295,57 @@ class FormatTest implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
if ($this->container['integer'] > 100.0) { if ($this->container['integer'] > 100.0) {
$invalid_properties[] = "invalid value for '$integer', must be smaller than or equal to 100.0."; $invalid_properties[] = "invalid value for '$integer', must be smaller than or equal to 100.0.";
} }
if ($this->container['integer'] < 10.0) { if ($this->container['integer'] < 10.0) {
$invalid_properties[] = "invalid value for '$integer', must be bigger than or equal to 10.0."; $invalid_properties[] = "invalid value for '$integer', must be bigger than or equal to 10.0.";
} }
if ($this->container['int32'] > 200.0) { if ($this->container['int32'] > 200.0) {
$invalid_properties[] = "invalid value for '$int32', must be smaller than or equal to 200.0."; $invalid_properties[] = "invalid value for '$int32', must be smaller than or equal to 200.0.";
} }
if ($this->container['int32'] < 20.0) { if ($this->container['int32'] < 20.0) {
$invalid_properties[] = "invalid value for '$int32', must be bigger than or equal to 20.0."; $invalid_properties[] = "invalid value for '$int32', must be bigger than or equal to 20.0.";
} }
if ($this->container['number'] === null) { if ($this->container['number'] === null) {
$invalid_properties[] = "'$number' can't be null"; $invalid_properties[] = "'$number' can't be null";
} }
if ($this->container['number'] > 543.2) { if ($this->container['number'] > 543.2) {
$invalid_properties[] = "invalid value for '$number', must be smaller than or equal to 543.2."; $invalid_properties[] = "invalid value for '$number', must be smaller than or equal to 543.2.";
} }
if ($this->container['number'] < 32.1) { if ($this->container['number'] < 32.1) {
$invalid_properties[] = "invalid value for '$number', must be bigger than or equal to 32.1."; $invalid_properties[] = "invalid value for '$number', must be bigger than or equal to 32.1.";
} }
if ($this->container['float'] > 987.6) { if ($this->container['float'] > 987.6) {
$invalid_properties[] = "invalid value for '$float', must be smaller than or equal to 987.6."; $invalid_properties[] = "invalid value for '$float', must be smaller than or equal to 987.6.";
} }
if ($this->container['float'] < 54.3) { if ($this->container['float'] < 54.3) {
$invalid_properties[] = "invalid value for '$float', must be bigger than or equal to 54.3."; $invalid_properties[] = "invalid value for '$float', must be bigger than or equal to 54.3.";
} }
if ($this->container['double'] > 123.4) { if ($this->container['double'] > 123.4) {
$invalid_properties[] = "invalid value for '$double', must be smaller than or equal to 123.4."; $invalid_properties[] = "invalid value for '$double', must be smaller than or equal to 123.4.";
} }
if ($this->container['double'] < 67.8) { if ($this->container['double'] < 67.8) {
$invalid_properties[] = "invalid value for '$double', must be bigger than or equal to 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'])) { if (!preg_match("/[a-z]/i", $this->container['string'])) {
$invalid_properties[] = "invalid value for '$string', must be conform to the pattern /[a-z]/i."; $invalid_properties[] = "invalid value for '$string', must be conform to the pattern /[a-z]/i.";
} }
if ($this->container['byte'] === null) { if ($this->container['byte'] === null) {
$invalid_properties[] = "'$byte' can't be null"; $invalid_properties[] = "'$byte' can't be null";
} }
if ($this->container['date'] === null) { if ($this->container['date'] === null) {
$invalid_properties[] = "'$date' can't be null"; $invalid_properties[] = "'$date' can't be null";
} }
if ($this->container['password'] === null) { if ($this->container['password'] === null) {
$invalid_properties[] = "'$password' can't be null"; $invalid_properties[] = "'$password' can't be null";
} }
if (strlen($this->container['password']) > 64) { if (strlen($this->container['password']) > 64) {
$invalid_properties[] = "invalid value for '$password', the character length must be smaller than or equal to 64."; $invalid_properties[] = "invalid value for '$password', the character length must be smaller than or equal to 64.";
} }
if (strlen($this->container['password']) < 10) { if (strlen($this->container['password']) < 10) {
$invalid_properties[] = "invalid value for '$password', the character length must be bigger than or equal to 10."; $invalid_properties[] = "invalid value for '$password', the character length must be bigger than or equal to 10.";
} }
return $invalid_properties; return $invalid_properties;
} }
@ -402,7 +375,6 @@ class FormatTest implements ArrayAccess
} }
if ($this->container['number'] === null) { if ($this->container['number'] === null) {
return false; return false;
} }
@ -434,14 +406,12 @@ class FormatTest implements ArrayAccess
if (!preg_match("/[a-z]/i", $this->container['string'])) { if (!preg_match("/[a-z]/i", $this->container['string'])) {
return false; return false;
} }
if ($this->container['byte'] === null) { if ($this->container['byte'] === null) {
return false; return false;
} }
if ($this->container['date'] === null) { if ($this->container['date'] === null) {
return false; return false;
} }
@ -450,7 +420,6 @@ class FormatTest implements ArrayAccess
if ($this->container['password'] === null) { if ($this->container['password'] === null) {
return false; return false;
} }
@ -461,7 +430,6 @@ class FormatTest implements ArrayAccess
if (strlen($this->container['password']) < 10) { if (strlen($this->container['password']) < 10) {
return false; return false;
} }
return true; return true;
} }
@ -483,15 +451,12 @@ class FormatTest implements ArrayAccess
public function setInteger($integer) public function setInteger($integer)
{ {
if ($integer > 100.0) { if ($integer > 100.0) {
throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.0.'); throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be smaller than or equal to 100.0.');
} }
if ($integer < 10.0) { if ($integer < 10.0) {
throw new \InvalidArgumentException('invalid value for $integer when calling FormatTest., must be bigger than or equal to 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; $this->container['integer'] = $integer;
return $this; return $this;
@ -513,15 +478,12 @@ class FormatTest implements ArrayAccess
public function setInt32($int32) public function setInt32($int32)
{ {
if ($int32 > 200.0) { if ($int32 > 200.0) {
throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.0.'); throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be smaller than or equal to 200.0.');
} }
if ($int32 < 20.0) { if ($int32 < 20.0) {
throw new \InvalidArgumentException('invalid value for $int32 when calling FormatTest., must be bigger than or equal to 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; $this->container['int32'] = $int32;
return $this; return $this;
@ -542,9 +504,6 @@ class FormatTest implements ArrayAccess
*/ */
public function setInt64($int64) public function setInt64($int64)
{ {
$this->container['int64'] = $int64; $this->container['int64'] = $int64;
return $this; return $this;
@ -566,15 +525,12 @@ class FormatTest implements ArrayAccess
public function setNumber($number) public function setNumber($number)
{ {
if ($number > 543.2) { if ($number > 543.2) {
throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.'); throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be smaller than or equal to 543.2.');
} }
if ($number < 32.1) { if ($number < 32.1) {
throw new \InvalidArgumentException('invalid value for $number when calling FormatTest., must be bigger than or equal to 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; $this->container['number'] = $number;
return $this; return $this;
@ -596,15 +552,12 @@ class FormatTest implements ArrayAccess
public function setFloat($float) public function setFloat($float)
{ {
if ($float > 987.6) { if ($float > 987.6) {
throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.'); throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be smaller than or equal to 987.6.');
} }
if ($float < 54.3) { if ($float < 54.3) {
throw new \InvalidArgumentException('invalid value for $float when calling FormatTest., must be bigger than or equal to 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; $this->container['float'] = $float;
return $this; return $this;
@ -626,15 +579,12 @@ class FormatTest implements ArrayAccess
public function setDouble($double) public function setDouble($double)
{ {
if ($double > 123.4) { if ($double > 123.4) {
throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.'); throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be smaller than or equal to 123.4.');
} }
if ($double < 67.8) { if ($double < 67.8) {
throw new \InvalidArgumentException('invalid value for $double when calling FormatTest., must be bigger than or equal to 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; $this->container['double'] = $double;
return $this; return $this;
@ -656,12 +606,9 @@ class FormatTest implements ArrayAccess
public function setString($string) public function setString($string)
{ {
if (!preg_match("/[a-z]/i", $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.'); throw new \InvalidArgumentException('invalid value for $string when calling FormatTest., must be conform to the pattern /[a-z]/i.');
} }
$this->container['string'] = $string; $this->container['string'] = $string;
return $this; return $this;
@ -682,9 +629,6 @@ class FormatTest implements ArrayAccess
*/ */
public function setByte($byte) public function setByte($byte)
{ {
$this->container['byte'] = $byte; $this->container['byte'] = $byte;
return $this; return $this;
@ -705,9 +649,6 @@ class FormatTest implements ArrayAccess
*/ */
public function setBinary($binary) public function setBinary($binary)
{ {
$this->container['binary'] = $binary; $this->container['binary'] = $binary;
return $this; return $this;
@ -728,9 +669,6 @@ class FormatTest implements ArrayAccess
*/ */
public function setDate($date) public function setDate($date)
{ {
$this->container['date'] = $date; $this->container['date'] = $date;
return $this; return $this;
@ -751,9 +689,6 @@ class FormatTest implements ArrayAccess
*/ */
public function setDateTime($date_time) public function setDateTime($date_time)
{ {
$this->container['date_time'] = $date_time; $this->container['date_time'] = $date_time;
return $this; return $this;
@ -774,9 +709,6 @@ class FormatTest implements ArrayAccess
*/ */
public function setUuid($uuid) public function setUuid($uuid)
{ {
$this->container['uuid'] = $uuid; $this->container['uuid'] = $uuid;
return $this; return $this;
@ -797,15 +729,12 @@ class FormatTest implements ArrayAccess
*/ */
public function setPassword($password) public function setPassword($password)
{ {
if (strlen($password) > 64) { if (strlen($password) > 64) {
throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be smaller than or equal to 64.'); throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be smaller than or equal to 64.');
} }
if (strlen($password) < 10) { if (strlen($password) < 10) {
throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be bigger than or equal to 10.'); throw new \InvalidArgumentException('invalid length for $password when calling FormatTest., must be bigger than or equal to 10.');
} }
$this->container['password'] = $password; $this->container['password'] = $password;
return $this; return $this;

View File

@ -139,9 +139,6 @@ class Model200Response implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -155,7 +152,6 @@ class Model200Response implements ArrayAccess
{ {
return true; return true;
} }
@ -176,9 +172,6 @@ class Model200Response implements ArrayAccess
*/ */
public function setName($name) public function setName($name)
{ {
$this->container['name'] = $name; $this->container['name'] = $name;
return $this; return $this;

View File

@ -139,9 +139,6 @@ class ModelReturn implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -155,7 +152,6 @@ class ModelReturn implements ArrayAccess
{ {
return true; return true;
} }
@ -176,9 +172,6 @@ class ModelReturn implements ArrayAccess
*/ */
public function setReturn($return) public function setReturn($return)
{ {
$this->container['return'] = $return; $this->container['return'] = $return;
return $this; return $this;

View File

@ -165,16 +165,9 @@ class Name implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
if ($this->container['name'] === null) { if ($this->container['name'] === null) {
$invalid_properties[] = "'$name' can't be null"; $invalid_properties[] = "'$name' can't be null";
} }
return $invalid_properties; return $invalid_properties;
} }
@ -186,7 +179,6 @@ class Name implements ArrayAccess
*/ */
public function valid() public function valid()
{ {
if ($this->container['name'] === null) { if ($this->container['name'] === null) {
return false; return false;
} }
@ -195,7 +187,6 @@ class Name implements ArrayAccess
return true; return true;
} }
@ -216,9 +207,6 @@ class Name implements ArrayAccess
*/ */
public function setName($name) public function setName($name)
{ {
$this->container['name'] = $name; $this->container['name'] = $name;
return $this; return $this;
@ -239,9 +227,6 @@ class Name implements ArrayAccess
*/ */
public function setSnakeCase($snake_case) public function setSnakeCase($snake_case)
{ {
$this->container['snake_case'] = $snake_case; $this->container['snake_case'] = $snake_case;
return $this; return $this;
@ -262,9 +247,6 @@ class Name implements ArrayAccess
*/ */
public function setProperty($property) public function setProperty($property)
{ {
$this->container['property'] = $property; $this->container['property'] = $property;
return $this; return $this;

View File

@ -219,22 +219,10 @@ class Order implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
$allowed_values = array("placed", "approved", "delivered"); $allowed_values = array("placed", "approved", "delivered");
if (!in_array($this->container['status'], $allowed_values))) { if (!in_array($this->container['status'], $allowed_values))) {
$invalid_properties[] = "invalid value for '$status', must be one of #{allowed_values}."; $invalid_properties[] = "invalid value for '$status', must be one of #{allowed_values}.";
} }
return $invalid_properties; return $invalid_properties;
} }
@ -261,7 +249,6 @@ class Order implements ArrayAccess
} }
return true; return true;
} }
@ -282,9 +269,6 @@ class Order implements ArrayAccess
*/ */
public function setId($id) public function setId($id)
{ {
$this->container['id'] = $id; $this->container['id'] = $id;
return $this; return $this;
@ -305,9 +289,6 @@ class Order implements ArrayAccess
*/ */
public function setPetId($pet_id) public function setPetId($pet_id)
{ {
$this->container['pet_id'] = $pet_id; $this->container['pet_id'] = $pet_id;
return $this; return $this;
@ -328,9 +309,6 @@ class Order implements ArrayAccess
*/ */
public function setQuantity($quantity) public function setQuantity($quantity)
{ {
$this->container['quantity'] = $quantity; $this->container['quantity'] = $quantity;
return $this; return $this;
@ -351,9 +329,6 @@ class Order implements ArrayAccess
*/ */
public function setShipDate($ship_date) public function setShipDate($ship_date)
{ {
$this->container['ship_date'] = $ship_date; $this->container['ship_date'] = $ship_date;
return $this; return $this;
@ -378,8 +353,6 @@ class Order implements ArrayAccess
if (!in_array($status, $allowed_values)) { if (!in_array($status, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'placed', 'approved', 'delivered'"); throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'placed', 'approved', 'delivered'");
} }
$this->container['status'] = $status; $this->container['status'] = $status;
return $this; return $this;
@ -400,9 +373,6 @@ class Order implements ArrayAccess
*/ */
public function setComplete($complete) public function setComplete($complete)
{ {
$this->container['complete'] = $complete; $this->container['complete'] = $complete;
return $this; return $this;

View File

@ -219,28 +219,16 @@ class Pet implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
if ($this->container['name'] === null) { if ($this->container['name'] === null) {
$invalid_properties[] = "'$name' can't be null"; $invalid_properties[] = "'$name' can't be null";
} }
if ($this->container['photo_urls'] === null) { if ($this->container['photo_urls'] === null) {
$invalid_properties[] = "'$photo_urls' can't be null"; $invalid_properties[] = "'$photo_urls' can't be null";
} }
$allowed_values = array("available", "pending", "sold"); $allowed_values = array("available", "pending", "sold");
if (!in_array($this->container['status'], $allowed_values))) { if (!in_array($this->container['status'], $allowed_values))) {
$invalid_properties[] = "invalid value for '$status', must be one of #{allowed_values}."; $invalid_properties[] = "invalid value for '$status', must be one of #{allowed_values}.";
} }
return $invalid_properties; return $invalid_properties;
} }
@ -256,12 +244,10 @@ class Pet implements ArrayAccess
if ($this->container['name'] === null) { if ($this->container['name'] === null) {
return false; return false;
} }
if ($this->container['photo_urls'] === null) { if ($this->container['photo_urls'] === null) {
return false; return false;
} }
@ -273,7 +259,6 @@ class Pet implements ArrayAccess
if (!in_array($this->container['status'], $allowed_values))) { if (!in_array($this->container['status'], $allowed_values))) {
return false; return false;
} }
return true; return true;
} }
@ -294,9 +279,6 @@ class Pet implements ArrayAccess
*/ */
public function setId($id) public function setId($id)
{ {
$this->container['id'] = $id; $this->container['id'] = $id;
return $this; return $this;
@ -317,9 +299,6 @@ class Pet implements ArrayAccess
*/ */
public function setCategory($category) public function setCategory($category)
{ {
$this->container['category'] = $category; $this->container['category'] = $category;
return $this; return $this;
@ -340,9 +319,6 @@ class Pet implements ArrayAccess
*/ */
public function setName($name) public function setName($name)
{ {
$this->container['name'] = $name; $this->container['name'] = $name;
return $this; return $this;
@ -363,9 +339,6 @@ class Pet implements ArrayAccess
*/ */
public function setPhotoUrls($photo_urls) public function setPhotoUrls($photo_urls)
{ {
$this->container['photo_urls'] = $photo_urls; $this->container['photo_urls'] = $photo_urls;
return $this; return $this;
@ -386,9 +359,6 @@ class Pet implements ArrayAccess
*/ */
public function setTags($tags) public function setTags($tags)
{ {
$this->container['tags'] = $tags; $this->container['tags'] = $tags;
return $this; return $this;
@ -413,8 +383,6 @@ class Pet implements ArrayAccess
if (!in_array($status, $allowed_values)) { if (!in_array($status, $allowed_values)) {
throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'available', 'pending', 'sold'"); throw new \InvalidArgumentException("Invalid value for 'status', must be one of 'available', 'pending', 'sold'");
} }
$this->container['status'] = $status; $this->container['status'] = $status;
return $this; return $this;

View File

@ -139,9 +139,6 @@ class SpecialModelName implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -155,7 +152,6 @@ class SpecialModelName implements ArrayAccess
{ {
return true; return true;
} }
@ -176,9 +172,6 @@ class SpecialModelName implements ArrayAccess
*/ */
public function setSpecialPropertyName($special_property_name) public function setSpecialPropertyName($special_property_name)
{ {
$this->container['special_property_name'] = $special_property_name; $this->container['special_property_name'] = $special_property_name;
return $this; return $this;

View File

@ -152,11 +152,6 @@ class Tag implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -172,7 +167,6 @@ class Tag implements ArrayAccess
return true; return true;
} }
@ -193,9 +187,6 @@ class Tag implements ArrayAccess
*/ */
public function setId($id) public function setId($id)
{ {
$this->container['id'] = $id; $this->container['id'] = $id;
return $this; return $this;
@ -216,9 +207,6 @@ class Tag implements ArrayAccess
*/ */
public function setName($name) public function setName($name)
{ {
$this->container['name'] = $name; $this->container['name'] = $name;
return $this; return $this;

View File

@ -230,23 +230,6 @@ class User implements ArrayAccess
public function list_invalid_properties() public function list_invalid_properties()
{ {
$invalid_properties = array(); $invalid_properties = array();
return $invalid_properties; return $invalid_properties;
} }
@ -274,7 +257,6 @@ class User implements ArrayAccess
return true; return true;
} }
@ -295,9 +277,6 @@ class User implements ArrayAccess
*/ */
public function setId($id) public function setId($id)
{ {
$this->container['id'] = $id; $this->container['id'] = $id;
return $this; return $this;
@ -318,9 +297,6 @@ class User implements ArrayAccess
*/ */
public function setUsername($username) public function setUsername($username)
{ {
$this->container['username'] = $username; $this->container['username'] = $username;
return $this; return $this;
@ -341,9 +317,6 @@ class User implements ArrayAccess
*/ */
public function setFirstName($first_name) public function setFirstName($first_name)
{ {
$this->container['first_name'] = $first_name; $this->container['first_name'] = $first_name;
return $this; return $this;
@ -364,9 +337,6 @@ class User implements ArrayAccess
*/ */
public function setLastName($last_name) public function setLastName($last_name)
{ {
$this->container['last_name'] = $last_name; $this->container['last_name'] = $last_name;
return $this; return $this;
@ -387,9 +357,6 @@ class User implements ArrayAccess
*/ */
public function setEmail($email) public function setEmail($email)
{ {
$this->container['email'] = $email; $this->container['email'] = $email;
return $this; return $this;
@ -410,9 +377,6 @@ class User implements ArrayAccess
*/ */
public function setPassword($password) public function setPassword($password)
{ {
$this->container['password'] = $password; $this->container['password'] = $password;
return $this; return $this;
@ -433,9 +397,6 @@ class User implements ArrayAccess
*/ */
public function setPhone($phone) public function setPhone($phone)
{ {
$this->container['phone'] = $phone; $this->container['phone'] = $phone;
return $this; return $this;
@ -456,9 +417,6 @@ class User implements ArrayAccess
*/ */
public function setUserStatus($user_status) public function setUserStatus($user_status)
{ {
$this->container['user_status'] = $user_status; $this->container['user_status'] = $user_status;
return $this; return $this;