protected static getPagination ( Buzz\Message\Response $response ) | ||
$response | Buzz\Message\Response |
protected static function getPagination(Response $response)
{
$header = $response->getHeader('Link');
if (empty($header)) {
return;
}
$pagination = [];
foreach (explode(',', $header) as $link) {
preg_match('/<(.*)>; rel="(.*)"/i', trim($link, ','), $match);
if (3 === count($match)) {
$pagination[$match[2]] = $match[1];
}
}
return $pagination;
}