public function makeRecursiveRequest($url, $params, $results = array())
    {
        $http = new HttpClient('https://api.github.com');
        $res = $http->get($url, $params);

        foreach ($res['body'] as $item) {
            $results[] = $item;
        }

        foreach ($res['headers'] as $header) {
            if (preg_match('/^Link: <([^>]+)>; rel="next"/', $header, $r)) {
                $host = parse_url($r[1]);

                parse_str($host['query'], $params);
                $results = $this->makeRecursiveRequest($host['path'], $params, $results);

                break;
            }
        }

        return $results;
    }
public function makeRecursiveRequest($url, $params, $results = array())
    {
        $http = new HttpClient('https://api.github.com');
        $res = $http->get($url, $params);

        foreach ($res['body'] as $item) {
            $results[] = $item;
        }

        foreach ($res['headers'] as $header) {
            if (preg_match('/^Link: <([^>]+)>; rel="next"/', $header, $r)) {
                $host = parse_url($r[1]);

                parse_str($host['query'], $params);
                $results = $this->makeRecursiveRequest($host['path'], $params, $results);

                break;
            }
        }

        return $results;
    }
public function makeRecursiveRequest ( $ url , $ params , $ results = array ( ) ) { $ http = new HttpClient ( 'https://api.github.com' ) ; $ res = $ http -> get ( $ url , $ params ) ; foreach ( $ res [ 'body' ] as $ item ) { $ results [ ] = $ item ; } foreach ( $ res [ 'headers' ] as $ header ) { if ( preg_match ( '/^Link: <([^>]+)>; rel="next"/' , $ header , $ r ) ) { $ host = parse_url ( $ r [ 1 ] ) ; parse_str ( $ host [ 'query' ] , $ params ) ; $ results = $ this -> makeRecursiveRequest ( $ host [ 'path' ] , $ params , $ results ) ; break ; } } return $ results ; }
Make all GitHub requests following the Link HTTP headers.

@param string $url
@param mixed $params
@param array $results

@return array
Make all GitHub requests following the Link HTTP headers .