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.
Loading history...
30
*/
31
1
public static function fromArray(array $array)
32
{
33
1
if (count($array) > 1) {
34
1
throw new \InvalidArgumentException('Array must only have one element.');
35
}
36
37
1
return new static((new Service())->write(key($array), reset($array)));
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.