@@ -10,10 +10,10 @@ class StatusManager
10
10
const STATUS_REVIEWED = 'reviewed ' ;
11
11
12
12
private static $ triggerWords = [
13
- self ::STATUS_NEEDS_REVIEW => [ 'needs review ' ] ,
14
- self ::STATUS_NEEDS_WORK => [ 'needs work ' ] ,
15
- self ::STATUS_WORKS_FOR_ME => [ 'works for me ' ] ,
16
- self ::STATUS_REVIEWED => [ 'reviewed ' ] ,
13
+ self ::STATUS_NEEDS_REVIEW => 'needs review ' ,
14
+ self ::STATUS_NEEDS_WORK => 'needs work ' ,
15
+ self ::STATUS_WORKS_FOR_ME => 'works for me ' ,
16
+ self ::STATUS_REVIEWED => 'reviewed ' ,
17
17
];
18
18
19
19
private static $ labels = [
@@ -47,14 +47,12 @@ public function getStatusChangeFromComment($comment)
47
47
$ statusString = trim (substr ($ comment , $ statusPosition ));
48
48
49
49
$ newStatus = null ;
50
- foreach (self ::$ triggerWords as $ status => $ triggerWords ) {
51
- foreach ($ triggerWords as $ triggerWord ) {
52
- // status should be right at the beginning of the string
53
- if (stripos ($ statusString , $ triggerWord ) === 0 ) {
54
- // don't return immediately - we use the last status
55
- // in the rare case there are multiple
56
- $ newStatus = $ status ;
57
- }
50
+ foreach (self ::$ triggerWords as $ status => $ triggerWord ) {
51
+ // status should be right at the beginning of the string
52
+ if (stripos ($ statusString , $ triggerWord ) === 0 ) {
53
+ // don't return immediately - we use the last status
54
+ // in the rare case there are multiple
55
+ $ newStatus = $ status ;
58
56
}
59
57
}
60
58
0 commit comments