public function updateCommits(Entity\Repo $repo) { $this->output->write(' commits'); try { $commits = $this->github->getCommitApi()->getBranchCommits($repo->getUsername(), $repo->getName(), 'master'); } catch (\phpGitHubApiRequestException $e) { if (404 == $e->getCode()) { return false; } throw $e; } if (empty($commits)) { return false; } $repo->setLastCommits(array_slice($commits, 0, 30)); return $repo; }