Skip to content

Commit

Permalink
redesign stargazers
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSuddenJoy authored Jun 10, 2024
1 parent 76564b5 commit 6db02a4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Domain/Github/GithubStars.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ class GithubStars
{
public function fetchStars(): ?int
{

$noStars = 0;

$result = @\file_get_contents(
'https://api.github.com/repos/MrSuddenJoy/4programmers.net',
false,
Expand All @@ -15,8 +18,13 @@ public function fetchStars(): ?int
$data = @\json_decode($result, true);
if ($data !== null) {
return $data['stargazers_count'];
} else {
// echo($noStars);
return $noStars;
}
}
return null;
}


}

0 comments on commit 6db02a4

Please sign in to comment.