You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: generator/cybersource-php-template/model_generic.mustache
-63Lines changed: 0 additions & 63 deletions
Original file line number
Diff line number
Diff line change
@@ -157,36 +157,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
157
157
{{/isContainer}}
158
158
{{/isEnum}}
159
159
{{#hasValidation}}
160
-
{{#maximum}}
161
-
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) {
162
-
$invalid_properties[] = "invalid value for '{{name}}', must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.";
163
-
}
164
-
165
-
{{/maximum}}
166
-
{{#minimum}}
167
-
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}($this->container['{{name}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) {
168
-
$invalid_properties[] = "invalid value for '{{name}}', must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.";
169
-
}
170
-
171
-
{{/minimum}}
172
160
{{#pattern}}
173
161
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}!preg_match("{{{pattern}}}", $this->container['{{name}}'])) {
174
162
$invalid_properties[] = "invalid value for '{{name}}', must be conform to the pattern {{{pattern}}}.";
175
163
}
176
164
177
165
{{/pattern}}
178
-
{{#maxItems}}
179
-
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(count($this->container['{{name}}']) > {{maxItems}})) {
180
-
$invalid_properties[] = "invalid value for '{{name}}', number of items must be less than or equal to {{{maxItems}}}.";
181
-
}
182
-
183
-
{{/maxItems}}
184
-
{{#minItems}}
185
-
if ({{^required}}!is_null($this->container['{{name}}']) && {{/required}}(count($this->container['{{name}}']) < {{minItems}})) {
186
-
$invalid_properties[] = "invalid value for '{{name}}', number of items must be greater than or equal to {{{minItems}}}.";
187
-
}
188
-
189
-
{{/minItems}}
190
166
{{/hasValidation}}
191
167
{{/vars}}
192
168
return $invalid_properties;
@@ -221,31 +197,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
221
197
{{/isContainer}}
222
198
{{/isEnum}}
223
199
{{#hasValidation}}
224
-
{{#maximum}}
225
-
if ($this->container['{{name}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}) {
226
-
return false;
227
-
}
228
-
{{/maximum}}
229
-
{{#minimum}}
230
-
if ($this->container['{{name}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}) {
231
-
return false;
232
-
}
233
-
{{/minimum}}
234
200
{{#pattern}}
235
201
if (!preg_match("{{{pattern}}}", $this->container['{{name}}'])) {
236
202
return false;
237
203
}
238
204
{{/pattern}}
239
-
{{#maxItems}}
240
-
if (count($this->container['{{name}}']) > {{maxItems}}) {
241
-
return false;
242
-
}
243
-
{{/maxItems}}
244
-
{{#minItems}}
245
-
if (count($this->container['{{name}}']) < {{minItems}}) {
246
-
return false;
247
-
}
248
-
{{/minItems}}
249
205
{{/hasValidation}}
250
206
{{/vars}}
251
207
return true;
@@ -293,30 +249,11 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}imple
293
249
{{/isContainer}}
294
250
{{/isEnum}}
295
251
{{#hasValidation}}
296
-
{{#maximum}}
297
-
if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}})) {
298
-
throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be smaller than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}{{maximum}}.');
299
-
}
300
-
{{/maximum}}
301
-
{{#minimum}}
302
-
if ({{^required}}!is_null(${{name}}) && {{/required}}(${{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}})) {
303
-
throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must be bigger than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}{{minimum}}.');
304
-
}
305
-
{{/minimum}}
306
252
{{#pattern}}
307
253
if ({{^required}}!is_null(${{name}}) && {{/required}}(!preg_match("{{{pattern}}}", ${{name}}))) {
308
254
throw new \InvalidArgumentException("invalid value for ${{name}} when calling {{classname}}.{{operationId}}, must conform to the pattern {{{pattern}}}.");
309
255
}
310
256
{{/pattern}}
311
-
{{#maxItems}}
312
-
if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) > {{maxItems}})) {
313
-
throw new \InvalidArgumentException('invalid value for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be less than or equal to {{maxItems}}.');
314
-
}{{/maxItems}}
315
-
{{#minItems}}
316
-
if ({{^required}}!is_null(${{name}}) && {{/required}}(count(${{name}}) < {{minItems}})) {
317
-
throw new \InvalidArgumentException('invalid length for ${{name}} when calling {{classname}}.{{operationId}}, number of items must be greater than or equal to {{minItems}}.');
0 commit comments