Should the return type not be array? Also, consider making the array more specific, something like array<String>, or String[].
This check compares the return type specified in the @return annotation of a function
or method doc comment with the types returned by the function and raises an issue if they
mismatch.
If the return type contains the type array, this check recommends the use of
a more specific type like String[] or array<String>.
Loading history...
28
*/
29
public function jsonSerialize()
30
{
31
return $this->toArray();
32
}
33
34
/**
35
* Returns an array representation of the collection.
36
*
37
* The format of the returned array is implementation-dependent.
38
* Some implementations may throw an exception if an array representation
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.If the return type contains the type array, this check recommends the use of a more specific type like
String[]
orarray<String>
.