Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Vite to 5.0 #269

Merged
merged 4 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions app/GitHub/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use App\GitHub\Dto\Issue;
use App\GitHub\Dto\PullRequest;
use Exception;
use GrahamCampbell\GitHub\Facades\GitHub as GitHubClient;

class Repository
Expand All @@ -20,24 +21,37 @@ public function __construct($namespace, $name)

public function isArchived()
{
return GitHubClient::repo()->show($this->namespace, $this->name)['archived'];
try {
return GitHubClient::repo()->show($this->namespace, $this->name)['archived'];
} catch (Exception $th) {
return false;
}
}

public function issues()
{
return collect(GitHubClient::issues()->all($this->namespace, $this->name))
->map(function ($issue) {
return new Issue($issue);
})->reject(function (Issue $issue) {
return ! is_null($issue->pull_request);
});
try {
return collect(GitHubClient::issues()->all($this->namespace, $this->name))
->map(function ($issue) {
return new Issue($issue);
})->reject(function (Issue $issue) {
return ! is_null($issue->pull_request);
});
} catch (Exception $th) {
return collect();
}
}

public function pullRequests()
{
return collect(GitHubClient::pullRequests()->all($this->namespace, $this->name))
->map(function ($pullRequest) {
return new PullRequest($pullRequest);
});
try {
return collect(GitHubClient::pullRequests()->all($this->namespace, $this->name))
->map(function ($pullRequest) {
return new PullRequest($pullRequest);
});
} catch (Exception $th) {
return collect();
}

}
}
Loading
Loading