-
-
Notifications
You must be signed in to change notification settings - Fork 405
Expand file tree
/
Copy pathSourceControlProvider.php
More file actions
executable file
·69 lines (53 loc) · 1.74 KB
/
SourceControlProvider.php
File metadata and controls
executable file
·69 lines (53 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
namespace App\SourceControlProviders;
use App\Exceptions\FailedToDeployGitHook;
use App\Exceptions\FailedToDeployGitKey;
use App\Exceptions\FailedToDestroyGitHook;
interface SourceControlProvider
{
public static function id(): string;
/**
* @param array<string, mixed> $input
* @return array<string, mixed>
*/
public function createRules(array $input): array;
/**
* @param array<string, mixed> $input
* @return array<string, mixed>
*/
public function createData(array $input): array;
/**
* @return array<string, mixed>
*/
public function data(): array;
public function connect(): bool;
public function getRepo(string $repo): mixed;
public function fullRepoUrl(string $repo, string $key): string;
/**
* @param array<int, mixed> $events
* @return array<string, mixed>
*
* @throws FailedToDeployGitHook
*/
public function deployHook(string $repo, array $events, string $secret): array;
/**
* @throws FailedToDestroyGitHook
*/
public function destroyHook(string $repo, string $hookId): void;
/**
* @return array<string, mixed>|null
*/
public function getLastCommit(string $repo, string $branch): ?array;
/**
* @throws FailedToDeployGitKey
*/
public function deployKey(string $title, string $repo, string $key): string;
public function deleteDeployKey(string $keyId, string $repo): void;
/**
* @param array<string, mixed> $payload
*/
public function getWebhookBranch(array $payload): string;
public function getRepos(bool $useCache = true): array;
public function getBranches(string $repo, bool $useCache = true): array;
public function getSshPort(): ?int;
}