fix required parameters check for php

This commit is contained in:
wing328
2015-04-30 16:52:33 +08:00
parent 303378c5eb
commit 93e4ef0eec
4 changed files with 71 additions and 0 deletions

View File

@@ -39,6 +39,12 @@ class {{classname}} {
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
*/
public function {{nickname}}({{#allParams}}${{paramName}}{{#optional}}=null{{/optional}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) {
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
if (${{paramName}} === null) {
throw new \Exception("Missing the required parameter ${{paramName}} when calling {{nickname}}");
}
{{/required}}{{/allParams}}
// parse inputs
$resourcePath = "{{path}}";