Skip to content

Commit

Permalink
scrutinizer
Browse files Browse the repository at this point in the history
  • Loading branch information
ggoffy committed Mar 18, 2021
1 parent 6fc58eb commit 6d3e95a
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions class/Github/GithubClient.php
Expand Up @@ -113,7 +113,7 @@ public function testApi2($url) {
* @param $username
* @param int $per_page
* @param int $page
* @return array
* @return array|bool
*/
public function getUserRepositories($username, $per_page = 100, $page = 1)
{
Expand All @@ -128,7 +128,7 @@ public function getUserRepositories($username, $per_page = 100, $page = 1)
* @param $org
* @param int $per_page
* @param int $page
* @return array
* @return array|bool
*/
public function getOrgRepositories($org, $per_page = 100, $page = 1)
{
Expand All @@ -142,7 +142,7 @@ public function getOrgRepositories($org, $per_page = 100, $page = 1)
*
* @param string $username the user who owns the repository
* @param string $repository the name of the repository
* @return string|array the readme content
* @return array|bool
*/
public function getReadme($username, $repository)
{
Expand All @@ -156,7 +156,7 @@ public function getReadme($username, $repository)
*
* @param string $username the user who owns the repository
* @param string $repository the name of the repository
* @return array
* @return array|bool
*/
public function getReleases($username, $repository)
{
Expand All @@ -171,7 +171,7 @@ public function getReleases($username, $repository)
* @param string $username the user who owns the repository
* @param string $repository the name of the repository
* @param bool $prerelease
* @return array
* @return array|bool
*/
public function getLatestRelease($username, $repository, $prerelease = false)
{
Expand All @@ -183,11 +183,6 @@ public function getLatestRelease($username, $repository, $prerelease = false)
}
$result = $this->_get($url);

if (\is_array($result) && \array_key_exists('error_code', $result)) {
//TODO: improve error handling
echo $result['message'];
die;
}
if ($prerelease) {
if (\is_array($result)) {
return $result[0];
Expand All @@ -204,7 +199,7 @@ public function getLatestRelease($username, $repository, $prerelease = false)
*
* @param $username
* @param $repository
* @return array
* @return array|bool
*/
public function getRepositoryContent($username, $repository)
{
Expand Down

0 comments on commit 6d3e95a

Please sign in to comment.