Skip to content

Commit

Permalink
fix: if model filed has type any we should generate it as mixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ilfa committed Oct 29, 2024
1 parent da7df5c commit 651e305
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions template/model_generic.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -246,21 +246,21 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa

/**
* Gets {{name}}
* @return {{^required}}?{{/required}}{{datatype}}
* @return {{^required}}{{#datatype}}?{{/datatype}}{{/required}}{{datatype}}{{^datatype}}mixed{{/datatype}}
*/
public function {{getter}}(): {{^required}}?{{/required}}{{#required}}{{#nullable}}?{{/nullable}}{{/required}}{{^isListContainer}}{{^isMapContainer}}{{^isDouble}}{{datatype}}{{/isDouble}}{{/isMapContainer}}{{/isListContainer}}{{#isListContainer}}array{{/isListContainer}}{{#isMapContainer}}array{{/isMapContainer}}{{#isDouble}}float{{/isDouble}}
public function {{getter}}(): {{^required}}{{#datatype}}?{{/datatype}}{{/required}}{{#required}}{{#nullable}}?{{/nullable}}{{/required}}{{^isListContainer}}{{^isMapContainer}}{{^isDouble}}{{datatype}}{{/isDouble}}{{/isMapContainer}}{{/isListContainer}}{{#isListContainer}}array{{/isListContainer}}{{#isMapContainer}}array{{/isMapContainer}}{{#isDouble}}float{{/isDouble}}{{^datatype}}mixed{{/datatype}}
{
return $this->container['{{name}}'];
}

/**
* Sets {{name}}
*
* @param {{^required}}?{{/required}}{{datatype}} ${{name}}{{#description}} {{{description}}}{{/description}}{{^description}} {{{name}}}{{/description}}
* @param {{^required}}{{#datatype}}?{{/datatype}}{{/required}}{{datatype}}{{^datatype}}mixed{{/datatype}} ${{name}}{{#description}} {{{description}}}{{/description}}{{^description}} {{{name}}}{{/description}}
*
* @return $this
*/
public function {{setter}}({{^required}}?{{/required}}{{#required}}{{#nullable}}?{{/nullable}}{{/required}}{{^isListContainer}}{{^isMapContainer}}{{^isDouble}}{{datatype}}{{/isDouble}}{{/isMapContainer}}{{/isListContainer}}{{#isListContainer}}array{{/isListContainer}}{{#isMapContainer}}array{{/isMapContainer}}{{#isDouble}}float{{/isDouble}} ${{name}}): self
public function {{setter}}({{^required}}{{#datatype}}?{{/datatype}}{{/required}}{{#required}}{{#nullable}}?{{/nullable}}{{/required}}{{^isListContainer}}{{^isMapContainer}}{{^isDouble}}{{datatype}}{{/isDouble}}{{/isMapContainer}}{{/isListContainer}}{{#isListContainer}}array{{/isListContainer}}{{#isMapContainer}}array{{/isMapContainer}}{{#isDouble}}float{{/isDouble}}{{^datatype}}mixed{{/datatype}} ${{name}}): self
{
{{#isEnum}}
$allowedValues = $this->{{getter}}AllowableValues();
Expand Down

0 comments on commit 651e305

Please sign in to comment.