@@ -11,7 +11,7 @@ class GitHubStatusApi implements StatusApi
11
11
/**
12
12
* @var array<string, string>
13
13
*/
14
- private static array $ statusToLabel = [
14
+ private const array STATUS_TO_LABEL = [
15
15
Status::NEEDS_REVIEW => 'Status: Needs Review ' ,
16
16
Status::NEEDS_WORK => 'Status: Needs Work ' ,
17
17
Status::WORKS_FOR_ME => 'Status: Works for me ' ,
@@ -27,7 +27,7 @@ public function __construct(
27
27
private readonly LabelApi $ labelsApi ,
28
28
private readonly LoggerInterface $ logger ,
29
29
) {
30
- $ this ->labelToStatus = array_flip (self ::$ statusToLabel );
30
+ $ this ->labelToStatus = array_flip (self ::STATUS_TO_LABEL );
31
31
}
32
32
33
33
/**
@@ -36,11 +36,11 @@ public function __construct(
36
36
*/
37
37
public function setIssueStatus (int $ issueNumber , ?string $ newStatus , Repository $ repository ): void
38
38
{
39
- if (null !== $ newStatus && !isset (self ::$ statusToLabel [$ newStatus ])) {
39
+ if (null !== $ newStatus && !isset (self ::STATUS_TO_LABEL [$ newStatus ])) {
40
40
throw new \InvalidArgumentException (sprintf ('Invalid status "%s" ' , $ newStatus ));
41
41
}
42
42
43
- $ newLabel = null === $ newStatus ? null : self ::$ statusToLabel [$ newStatus ];
43
+ $ newLabel = null === $ newStatus ? null : self ::STATUS_TO_LABEL [$ newStatus ];
44
44
$ this ->logger ->info (sprintf ('Fetching issue labels for issue %s, repository %s ' , $ issueNumber , $ repository ->getFullName ()));
45
45
$ currentLabels = $ this ->labelsApi ->getIssueLabels ($ issueNumber , $ repository );
46
46
@@ -91,6 +91,6 @@ public function getIssueStatus(int $issueNumber, Repository $repository): ?strin
91
91
92
92
public static function getNeedsReviewLabel (): string
93
93
{
94
- return self ::$ statusToLabel [Status::NEEDS_REVIEW ];
94
+ return self ::STATUS_TO_LABEL [Status::NEEDS_REVIEW ];
95
95
}
96
96
}
0 commit comments