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>.
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.
The call to Collection::__construct() has too many arguments starting with $this.
This check compares calls to functions or methods with their respective definitions.
If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the
check may pick up the wrong definition and report false positives. One codebase
where this has been known to happen is Wordpress.
In this case you can add the @ignorePhpDoc
annotation to the duplicate definition and it will be ignored.
Loading history...
42
}
43
44
/**
45
* Returns an array representation of the collection.
46
*
47
* The format of the returned array is implementation-dependent.
48
* 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>
.