getHeader('Link'); if (empty($header)) { return null; } $pagination = array(); foreach (explode(',', $header) as $link) { preg_match('/<(.*)>; rel="(.*)"/i', trim($link, ','), $match); if (3 === count($match)) { $pagination[$match[2]] = $match[1]; } } return $pagination; } /** * {@inheritDoc} */ public function getApiLimit() { $header = $this->getHeaderAttributes('X-RateLimit-Remaining'); if (!empty($header)) { $this->remainingCalls = $header; } if (null !== $this->remainingCalls && 1 > $this->remainingCalls) { throw new ApiLimitExceedException($this->options['api_limit']); } } /** * Is not modified * * @return Boolean */ public function isNotModified() { return 304 === $this->getStatusCode(); } }