/** * @param GithubService $api * @param AccessResponse $accessResponse */ function showMoreResults(GithubService $api, AccessResponse $accessResponse) { $resultKey = getVariable('resultKey'); if (!$resultKey) { echo "Couldn't read resultKey, can't show more results."; return; } $storedLink = StoredLink::createFromKey($resultKey); if (!$storedLink) { echo "Couldn't find storedLink from key {$resultKey}, can't show more results."; return; } $command = $api->listRepoCommitsPaginate(new Oauth2Token($accessResponse->accessToken), $storedLink->link->url); $commits = $command->execute(); displayCommits($commits); //$response = $command->getResponse(); if ($commits->pager) { displayAndSaveLinks($commits->pager); } }
function showMoreResults(AccessResponse $accessResponse) { $resultKey = getVariable('resultKey'); if (!$resultKey) { echo "Couldn't read resultKey, can't show more results."; return; } $storedLink = StoredLink::createFromKey($resultKey); if (!$storedLink) { echo "Couldn't find storedLink from key {$resultKey}, can't show more results."; return; } $api = new \AABTest\GithubAPI\GithubAPI(GITHUB_USER_AGENT); $command = $api->listRepoCommitsPaginate('token ' . $accessResponse->accessToken, $storedLink->link->url); $commits = $command->execute(); displayCommits($commits); $response = $command->getResponse(); displayAndSaveLinks($response); }