From cfe8dfc11202dbc5a23b976f2779af78d7c9694a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20J=C3=B8rgensen?= Date: Mon, 1 Aug 2016 11:46:08 +0200 Subject: [PATCH] [PHP] Fix invalid PHP syntax Fixes 3480. --- .../src/main/resources/php/model_generic.mustache | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache index 3c04809b492..0a2cf4cbe27 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -128,27 +128,27 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple {{/isEnum}} {{#hasValidation}} {{#maxLength}} - if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}(strlen($this->container['{{name}}']) > {{maxLength}})) { + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(strlen($this->container['{{name}}']) > {{maxLength}})) { $invalid_properties[] = "invalid value for '{{name}}', the character length must be smaller than or equal to {{{maxLength}}}."; } {{/maxLength}} {{#minLength}} - if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}(strlen($this->container['{{name}}']) < {{minLength}})) { + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(strlen($this->container['{{name}}']) < {{minLength}})) { $invalid_properties[] = "invalid value for '{{name}}', the character length must be bigger than or equal to {{{minLength}}}."; } {{/minLength}} {{#maximum}} - if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}($this->container['{{name}}'] > {{maximum}})) { + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] > {{maximum}})) { $invalid_properties[] = "invalid value for '{{name}}', must be smaller than or equal to {{maximum}}."; } {{/maximum}} {{#minimum}} - if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}($this->container['{{name}}'] < {{minimum}})) { + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] < {{minimum}})) { $invalid_properties[] = "invalid value for '{{name}}', must be bigger than or equal to {{minimum}}."; } {{/minimum}} {{#pattern}} - if ({{^required}}!is_null(${{$this->container['{{name}}']}}) && {{/required}}!preg_match("{{pattern}}", $this->container['{{name}}'])) { + if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}!preg_match("{{pattern}}", $this->container['{{name}}'])) { $invalid_properties[] = "invalid value for '{{name}}', must be conform to the pattern {{pattern}}."; } {{/pattern}}