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
Swagger Client Models implement the ArrayAccess interface and use the offset methods (offsetExists(), offsetGet(), offsetSet() and offsetUnset()). These methods are missing return types, causing warnings to be generated.
For example: Return type of Swagger\Client\{ClientName}\Model\{ModelName}::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/{vendor-name}/{package-name}/lib/Model/{ModelName}.php on line 330
Description
Swagger Client Models implement the ArrayAccess interface and use the offset methods (
offsetExists()
,offsetGet()
,offsetSet()
andoffsetUnset()
). These methods are missing return types, causing warnings to be generated.For example:
Return type of Swagger\Client\{ClientName}\Model\{ModelName}::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/{vendor-name}/{package-name}/lib/Model/{ModelName}.php on line 330
Swagger-codegen version
3.0.34
Suggest a fix/enhancement
Add return types to the method declarations in https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/php/model_generic.mustache#L397
The text was updated successfully, but these errors were encountered: