/** * @param string $user * @param string $repository * @return float */ private function computeOpenIssueRatio($user, $repository) { $query = "repo:{$user}/{$repository} type:issue " . $this->getExcludedLabelsSearchString(); $results = $this->github->search()->issues("{$query} state:open"); $openCount = $results['total_count']; $results = $this->github->search()->issues("{$query} state:closed"); $closedCount = $results['total_count']; $total = $openCount + $closedCount; return $total !== 0 ? $openCount / $total : 0; }
protected function fetchSearchResults($searchString, $count) { $results = $this->client->search()->setPerPage($count)->users($searchString, 'followers'); return $results['items']; }