Commit 49e337f3 authored by Emiliano Balbuena's avatar Emiliano Balbuena

(fix): Bring Response::sort() back

1 merge request!433WIP: Modal Page (+ FeedCollection)
Pipeline #106216199 failed with stages
in 11 minutes and 36 seconds
......@@ -384,6 +384,18 @@ class Response implements \Iterator, \ArrayAccess, \Countable, \JsonSerializable
return array_reduce($this->data, $callback, $initialValue);
}
/**
* @param callable $callback
* @return Response
*/
public function sort(callable $callback): Response
{
$data = $this->data;
usort($data, $callback);
return new static($data, $this->pagingToken, $this->attributes);
}
/**
* Returns the first element of the Response, or null if empty
* @return mixed|null
......
Please register or to comment