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
Previously return type was same, as method arguments. It`s wrong, and cause errors like
"Return value of Foo::setSuccess() must be of the type bool, object returned"
We cant use self and current {{classname}} as return type, because that can break class inheritance. So, better remove type hint on setters, until PHP-devs dont make realization for return static
Copy file name to clipboardExpand all lines: modules/openapi-generator/src/main/resources/php-symfony/model_generic.mustache
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}
35
35
*
36
36
* @return $this
37
37
*/
38
-
public function {{setter}}({{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{name}}{{^required}} = null{{/required}}){{#vendorExtensions.x-parameter-type}}: {{^required}}?{{/required}}{{vendorExtensions.x-parameter-type}}{{/vendorExtensions.x-parameter-type}}
38
+
public function {{setter}}({{#vendorExtensions.x-parameter-type}}{{vendorExtensions.x-parameter-type}} {{/vendorExtensions.x-parameter-type}}${{name}}{{^required}} = null{{/required}})
0 commit comments