Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer collective, backed by the Pireon OAuth identity server. The public site is a separate, server-rendered application consuming /api/public/v1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Services\Git\Contracts;
|
|
|
|
use App\Services\Git\GitException;
|
|
use App\Services\Git\RepositorySnapshot;
|
|
|
|
/**
|
|
* A git hosting provider this application can read from.
|
|
*
|
|
* Implementations are responsible for talking to one provider's API and
|
|
* translating its answer into the provider-neutral shapes in
|
|
* App\Services\Git — nothing outside this namespace should know whether a
|
|
* repository lives on GitHub, GitLab or Gitea.
|
|
*/
|
|
interface RepositoryProvider
|
|
{
|
|
/**
|
|
* Fetch everything the application shows about a repository.
|
|
*
|
|
* @param string $fullName "owner/repo"
|
|
*
|
|
* @throws GitException when the repository is missing,
|
|
* inaccessible, or the provider is unreachable.
|
|
*/
|
|
public function fetch(string $fullName): RepositorySnapshot;
|
|
|
|
/**
|
|
* Whether this driver is usable right now. A driver may work without
|
|
* credentials but be too rate-limited to be practical.
|
|
*/
|
|
public function isConfigured(): bool;
|
|
}
|