Closed Gn0ume closed 6 years ago
Parameter type 'array' is deprecated. Use square brackets with simply types or DTO based classes instead Too bad if this explanation isn't helpful for you.
For your case its better to create DTO class like:
class GetDuckResponse {
/** @var string */
public $say;
}
and specify it in action's phpdocs:
/**
* Returns array of ducks
* @return GetDuckResponse;
*/
If your purpose is returning ducks, create DuckDto(with all needed properties) and mention it in action's comment like @return DuckDTO[]
/**
Such action bring out the response: {"jsonrpc":"2.0","id":2,"error":{"code":-32603,"message":"Parameter type 'array' is deprecated. Use square brackets with simply types or DTO based classes instead.","data":null}}