@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $command = !empty($params[0]) ? $params[0] : 'help'; |
90 | 90 | $this->params = $params; |
91 | - $method = 'process' . ucfirst(strtolower($command)); |
|
91 | + $method = 'process'.ucfirst(strtolower($command)); |
|
92 | 92 | if (method_exists($this, $method)) { |
93 | 93 | return $this->{$method}(); |
94 | 94 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | { |
106 | 106 | if ($user !== null) { |
107 | 107 | $this->client->apiCall('im.open', ['user' => $user]) |
108 | - ->then(function (Payload $response) use ($messageToSent) { |
|
108 | + ->then(function(Payload $response) use ($messageToSent) { |
|
109 | 109 | $channel = $response->getData()['channel']['id']; |
110 | 110 | if ($messageToSent instanceof Message) { |
111 | 111 | $data = $this->getBaseDataArray($messageToSent->getText(), $channel); |
@@ -198,11 +198,11 @@ discard block |
||
198 | 198 | break; |
199 | 199 | } |
200 | 200 | $attachment->setTitle($item->subject); |
201 | - $attachment->setTitleLink('https://review.typo3.org/' . $item->_number); |
|
201 | + $attachment->setTitleLink('https://review.typo3.org/'.$item->_number); |
|
202 | 202 | |
203 | - $text .= 'Branch: ' . $this->bold($branch) . ' | :calendar: ' . $this->bold($created) |
|
204 | - . ' | ID: ' . $this->bold($item->_number) . "\n"; |
|
205 | - $text .= '<https://review.typo3.org/' . $item->_number . '|:arrow_right: Goto Review>'; |
|
203 | + $text .= 'Branch: '.$this->bold($branch).' | :calendar: '.$this->bold($created) |
|
204 | + . ' | ID: '.$this->bold($item->_number)."\n"; |
|
205 | + $text .= '<https://review.typo3.org/'.$item->_number.'|:arrow_right: Goto Review>'; |
|
206 | 206 | |
207 | 207 | $attachment->setText($text); |
208 | 208 | $attachment->setFallback($text); |
@@ -58,15 +58,15 @@ discard block |
||
58 | 58 | $countMinus2 = count($result); |
59 | 59 | |
60 | 60 | $returnString = ''; |
61 | - $returnString .= 'There are currently ' . $this->bold($count) . ' open reviews for project ' |
|
62 | - . $this->italic($project) . ' and branch master on <https://review.typo3.org/#/q/project:' . $project |
|
63 | - . '+status:open+branch:master|https://review.typo3.org>' . chr(10); |
|
64 | - $returnString .= $this->bold($countMinus1) . ' of ' . $this->bold($count) . ' open reviews voted with ' |
|
65 | - . $this->bold('-1') . ' <https://review.typo3.org/#/q/label:Code-Review%253D-1+is:open+branch:' |
|
66 | - . 'master+project:' . $project . '|Check now> ' . chr(10); |
|
67 | - $returnString .= $this->bold($countMinus2) . ' of ' . $this->bold($count) . ' open reviews voted with ' |
|
68 | - . $this->bold('-2') . ' <https://review.typo3.org/#/q/label:Code-Review%253D-2+is:open+branch:' |
|
69 | - . 'master+project:' . $project . '|Check now>'; |
|
61 | + $returnString .= 'There are currently '.$this->bold($count).' open reviews for project ' |
|
62 | + . $this->italic($project).' and branch master on <https://review.typo3.org/#/q/project:'.$project |
|
63 | + . '+status:open+branch:master|https://review.typo3.org>'.chr(10); |
|
64 | + $returnString .= $this->bold($countMinus1).' of '.$this->bold($count).' open reviews voted with ' |
|
65 | + . $this->bold('-1').' <https://review.typo3.org/#/q/label:Code-Review%253D-1+is:open+branch:' |
|
66 | + . 'master+project:'.$project.'|Check now> '.chr(10); |
|
67 | + $returnString .= $this->bold($countMinus2).' of '.$this->bold($count).' open reviews voted with ' |
|
68 | + . $this->bold('-2').' <https://review.typo3.org/#/q/label:Code-Review%253D-2+is:open+branch:' |
|
69 | + . 'master+project:'.$project.'|Check now>'; |
|
70 | 70 | |
71 | 71 | return $returnString; |
72 | 72 | } |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | if ($username === null) { |
98 | 98 | return 'hey, I need a username!'; |
99 | 99 | } |
100 | - $results = $this->queryGerrit('is:open owner:"' . $username . '" project:' . $project); |
|
100 | + $results = $this->queryGerrit('is:open owner:"'.$username.'" project:'.$project); |
|
101 | 101 | if (count($results) > 0) { |
102 | - $listOfItems = ['*Here are the results for ' . $username . '*:']; |
|
102 | + $listOfItems = ['*Here are the results for '.$username.'*:']; |
|
103 | 103 | if (is_array($results)) { |
104 | 104 | foreach ($results as $item) { |
105 | 105 | $listOfItems[] = $this->buildReviewLine($item); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | return implode(chr(10), $listOfItems); |
110 | 110 | } |
111 | - return $username . ' has no open reviews or username is unknown'; |
|
111 | + return $username.' has no open reviews or username is unknown'; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $paramsCount = count($this->params); |
147 | 147 | $changeIds = []; |
148 | 148 | for ($i = 1; $i < $paramsCount; ++$i) { |
149 | - $changeIds[] = 'change:' . $this->params[$i]; |
|
149 | + $changeIds[] = 'change:'.$this->params[$i]; |
|
150 | 150 | } |
151 | 151 | $result = $this->queryGerrit(implode(' OR ', $changeIds)); |
152 | 152 | $listOfItems = []; |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | protected function buildReviewMessageOutput(int $refId) |
167 | 167 | { |
168 | - $result = $this->queryGerrit('change:' . $refId); |
|
168 | + $result = $this->queryGerrit('change:'.$refId); |
|
169 | 169 | if (!$result) { |
170 | 170 | return "{$refId} not found, sorry!"; |
171 | 171 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | return 'hey, I need a query!'; |
194 | 194 | } |
195 | 195 | |
196 | - $results = $this->queryGerrit('limit:50 ' . $query); |
|
196 | + $results = $this->queryGerrit('limit:50 '.$query); |
|
197 | 197 | if (count($results) > 0) { |
198 | 198 | $listOfItems = ["*Here are the results for {$query}*:"]; |
199 | 199 | if (is_array($results)) { |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | |
224 | 224 | $cnt = count($result); |
225 | 225 | |
226 | - return 'Good job folks, since ' . $date . ' you merged *' . $cnt . '* patches into master'; |
|
226 | + return 'Good job folks, since '.$date.' you merged *'.$cnt.'* patches into master'; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | } elseif (strpos($notification['message'], 'forge:') === 0) { |
82 | 82 | $this->processForgeMessage($notification, $user); |
83 | 83 | } else { |
84 | - $msg = '*Hi <@' . $user . '>, here is a message from <@' . $notification['from_user'] . '>' |
|
84 | + $msg = '*Hi <@'.$user.'>, here is a message from <@'.$notification['from_user'].'>' |
|
85 | 85 | . ' for you:*'; |
86 | - $this->sendResponse($msg . "\n" . $notification['message'], $user); |
|
86 | + $this->sendResponse($msg."\n".$notification['message'], $user); |
|
87 | 87 | } |
88 | 88 | $now = new \DateTime(); |
89 | 89 | $now->setTimestamp(time()); |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | { |
106 | 106 | $parts = explode(':', $notification['message']); |
107 | 107 | $refId = (int) trim($parts[1]); |
108 | - $result = $this->queryGerrit('change:' . $refId); |
|
109 | - $msg = '*Hi <@' . $user . '>, <@' . $notification['from_user'] . '>' |
|
108 | + $result = $this->queryGerrit('change:'.$refId); |
|
109 | + $msg = '*Hi <@'.$user.'>, <@'.$notification['from_user'].'>' |
|
110 | 110 | . ' ask you to look at this patch:*'; |
111 | 111 | |
112 | 112 | if (is_array($result)) { |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | { |
129 | 129 | $parts = explode(':', $notification['message']); |
130 | 130 | $issueNumber = (int) trim($parts[1]); |
131 | - $result = $this->queryForge('issues/' . $issueNumber); |
|
131 | + $result = $this->queryForge('issues/'.$issueNumber); |
|
132 | 132 | if ($result) { |
133 | - $msg = '*Hi <@' . $user . '>, <@' . $notification['from_user'] . '>' |
|
133 | + $msg = '*Hi <@'.$user.'>, <@'.$notification['from_user'].'>' |
|
134 | 134 | . ' ask you to look at this issue:*'; |
135 | - $this->sendResponse($msg . "\n" . $this->buildIssueMessage($result->issue), $user); |
|
135 | + $this->sendResponse($msg."\n".$this->buildIssueMessage($result->issue), $user); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
@@ -159,6 +159,6 @@ discard block |
||
159 | 159 | 'message' => $message, |
160 | 160 | ]); |
161 | 161 | |
162 | - return 'OK, I will tell <@' . $toUser . '> about your message'; |
|
162 | + return 'OK, I will tell <@'.$toUser.'> about your message'; |
|
163 | 163 | } |
164 | 164 | } |