88
99class GitHubStatusApi implements StatusApi
1010{
11- private $ statusToLabel = [
11+ private static $ statusToLabel = [
1212 Status::NEEDS_REVIEW => 'Status: Needs Review ' ,
1313 Status::NEEDS_WORK => 'Status: Needs Work ' ,
1414 Status::WORKS_FOR_ME => 'Status: Works for me ' ,
@@ -25,7 +25,7 @@ class GitHubStatusApi implements StatusApi
2525 public function __construct (CachedLabelsApi $ labelsApi )
2626 {
2727 $ this ->labelsApi = $ labelsApi ;
28- $ this ->labelToStatus = array_flip ($ this -> statusToLabel );
28+ $ this ->labelToStatus = array_flip (self :: $ statusToLabel );
2929 }
3030
3131 /**
@@ -35,11 +35,11 @@ public function __construct(CachedLabelsApi $labelsApi)
3535 */
3636 public function setIssueStatus ($ issueNumber , $ newStatus , Repository $ repository )
3737 {
38- if (!isset ($ this -> statusToLabel [$ newStatus ])) {
38+ if (!isset (self :: $ statusToLabel [$ newStatus ])) {
3939 throw new \InvalidArgumentException (sprintf ('Invalid status "%s" ' , $ newStatus ));
4040 }
4141
42- $ newLabel = $ this -> statusToLabel [$ newStatus ];
42+ $ newLabel = self :: $ statusToLabel [$ newStatus ];
4343 $ currentLabels = $ this ->labelsApi ->getIssueLabels ($ issueNumber , $ repository );
4444 $ addLabel = true ;
4545
@@ -82,13 +82,8 @@ public function getIssueStatus($issueNumber, Repository $repository)
8282 return ;
8383 }
8484
85- public function getNeedsReviewUrl ( Repository $ repository )
85+ public static function getNeedsReviewLabel ( )
8686 {
87- return sprintf (
88- 'https://github.com/%s/%s/labels/%s ' ,
89- $ repository ->getVendor (),
90- $ repository ->getName (),
91- rawurlencode ($ this ->statusToLabel [Status::NEEDS_REVIEW ])
92- );
87+ return self ::$ statusToLabel [Status::NEEDS_REVIEW ];
9388 }
9489}
0 commit comments