-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathRepository.php
More file actions
61 lines (52 loc) · 1.32 KB
/
Repository.php
File metadata and controls
61 lines (52 loc) · 1.32 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
<?php
namespace App\Model;
use App\Api\Status\GitHubStatusApi;
/**
* @author Ener-Getick <egetick@gmail.com>
*/
class Repository
{
/**
* @param string|null $secret the webhook secret used by GitHub
* @param list<string> $ignoredLabels labels that should not be auto-applied from PR/issue titles
*/
public function __construct(
private readonly string $vendor,
private readonly string $name,
private readonly ?string $secret = null,
private readonly array $ignoredLabels = [],
) {
}
public function getVendor(): string
{
return $this->vendor;
}
public function getName(): string
{
return $this->name;
}
public function getSecret(): ?string
{
return $this->secret;
}
public function getNeedsReviewUrl(): string
{
return sprintf(
'https://github.com/%s/%s/labels/%s',
$this->getVendor(),
$this->getName(),
rawurlencode(GitHubStatusApi::getNeedsReviewLabel())
);
}
/**
* @return list<string>
*/
public function getIgnoredLabels(): array
{
return $this->ignoredLabels;
}
public function getFullName(): string
{
return sprintf('%s/%s', $this->getVendor(), $this->getName());
}
}