File tree Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Expand file tree Collapse file tree 3 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ protected function parseStatusFromText($body)
44
44
}
45
45
}
46
46
47
- private function checkUserIsAllowedToReview (array $ data )
47
+ protected function isUserAllowedToReview (array $ data )
48
48
{
49
49
return $ data ['issue ' ]['user ' ]['login ' ] !== $ data ['comment ' ]['user ' ]['login ' ];
50
50
}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public function onIssueComment(GitHubEvent $event)
31
31
$ issueNumber = $ data ['issue ' ]['number ' ];
32
32
$ newStatus = $ this ->parseStatusFromText ($ data ['comment ' ]['body ' ]);
33
33
34
- if (Status::REVIEWED === $ newStatus && false === $ this ->checkUserIsAllowedToReview ($ data )) {
34
+ if (Status::REVIEWED === $ newStatus && false === $ this ->isUserAllowedToReview ($ data )) {
35
35
$ newStatus = null ;
36
36
}
37
37
@@ -54,9 +54,4 @@ public static function getSubscribedEvents()
54
54
GitHubEvents::ISSUE_COMMENT => 'onIssueComment ' ,
55
55
);
56
56
}
57
-
58
- private function checkUserIsAllowedToReview (array $ data )
59
- {
60
- return $ data ['issue ' ]['user ' ]['login ' ] !== $ data ['comment ' ]['user ' ]['login ' ];
61
- }
62
57
}
Original file line number Diff line number Diff line change @@ -54,10 +54,10 @@ public function onReview(GitHubEvent $event)
54
54
break ;
55
55
default :
56
56
$ newStatus = $ this ->parseStatusFromText ($ data ['review ' ]['body ' ]);
57
+ }
57
58
58
- if (Status::REVIEWED === $ newStatus && false === $ this ->checkUserIsAllowedToReview ($ data )) {
59
- $ newStatus = null ;
60
- }
59
+ if (Status::REVIEWED === $ newStatus && false === $ this ->isUserAllowedToReview ($ data )) {
60
+ $ newStatus = null ;
61
61
}
62
62
63
63
$ event ->setResponseData (array (
@@ -107,9 +107,4 @@ public static function getSubscribedEvents()
107
107
GitHubEvents::PULL_REQUEST => 'onReviewRequested ' ,
108
108
);
109
109
}
110
-
111
- private function checkUserIsAllowedToReview (array $ data )
112
- {
113
- return $ data ['pull_request ' ]['user ' ]['login ' ] !== $ data ['review ' ]['user ' ]['login ' ];
114
- }
115
110
}
You can’t perform that action at this time.
0 commit comments