fix for #224, added safe php comparison

This commit is contained in:
Tony Tam
2015-02-16 17:49:22 -08:00
parent 39b2bf4204
commit fde5014bf9
4 changed files with 29 additions and 24 deletions

View File

@@ -49,20 +49,20 @@ class {{classname}} {
$headerParams['Content-Type'] = '{{#consumes}}{{mediaType}}{{#hasMore}},{{/hasMore}}{{/consumes}}';
{{#queryParams}}// query params
if(${{paramName}} != null) {
if(${{paramName}} !== null) {
$queryParams['{{paramName}}'] = $this->apiClient->toQueryValue(${{paramName}});
}{{/queryParams}}
{{#headerParams}}// header params
if(${{paramName}} != null) {
if(${{paramName}} !== null) {
$headerParams['{{paramName}}'] = $this->apiClient->toHeaderValue(${{paramName}});
}{{/headerParams}}
{{#pathParams}}// path params
if(${{paramName}} != null) {
if(${{paramName}} !== null) {
$resourcePath = str_replace("{" . "{{paramName}}" . "}",
$this->apiClient->toPathValue(${{paramName}}), $resourcePath);
}{{/pathParams}}
{{#formParams}}
if (${{paramName}} != null) {
if (${{paramName}} !== null) {
$formParams[{{paramName}}] = {{#isFile}}'@' . {{/isFile}}${{paramName}};
}{{/formParams}}
{{#bodyParams}}// body params