@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | { |
105 | 105 | $parts = explode(':', $notification['message']); |
106 | 106 | $refId = (int) trim($parts[1]); |
107 | - $result = $this->queryGerrit('change:' . $refId); |
|
108 | - $msg = '*Hi <@' . $user . '>, <@' . $notification['from_user'] . '>' |
|
107 | + $result = $this->queryGerrit('change:'.$refId); |
|
108 | + $msg = '*Hi <@'.$user.'>, <@'.$notification['from_user'].'>' |
|
109 | 109 | . ' ask you to look at this patch:*'; |
110 | 110 | |
111 | 111 | if (is_array($result)) { |
@@ -127,11 +127,11 @@ discard block |
||
127 | 127 | { |
128 | 128 | $parts = explode(':', $notification['message']); |
129 | 129 | $issueNumber = (int) trim($parts[1]); |
130 | - $result = $this->queryForge('issues/' . $issueNumber); |
|
130 | + $result = $this->queryForge('issues/'.$issueNumber); |
|
131 | 131 | if ($result) { |
132 | - $msg = '*Hi <@' . $user . '>, <@' . $notification['from_user'] . '>' |
|
132 | + $msg = '*Hi <@'.$user.'>, <@'.$notification['from_user'].'>' |
|
133 | 133 | . ' ask you to look at this issue:*'; |
134 | - $this->sendResponse($msg . chr(10) . $this->buildIssueMessage($result->issue), $user); |
|
134 | + $this->sendResponse($msg.chr(10).$this->buildIssueMessage($result->issue), $user); |
|
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | */ |
142 | 142 | protected function processTextMessage(array $notification, string $user) |
143 | 143 | { |
144 | - $msg = '*Hi <@' . $user . '>, here is a message from <@' . $notification['from_user'] . '>' . ' for you:*'; |
|
145 | - $this->sendResponse($msg . chr(10) . $notification['message'], $user); |
|
144 | + $msg = '*Hi <@'.$user.'>, here is a message from <@'.$notification['from_user'].'>'.' for you:*'; |
|
145 | + $this->sendResponse($msg.chr(10).$notification['message'], $user); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -168,6 +168,6 @@ discard block |
||
168 | 168 | 'message' => $message, |
169 | 169 | ]); |
170 | 170 | |
171 | - return 'OK, I will tell <@' . $toUser . '> about your message'; |
|
171 | + return 'OK, I will tell <@'.$toUser.'> about your message'; |
|
172 | 172 | } |
173 | 173 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $command = !empty($params[0]) ? $params[0] : 'help'; |
100 | 100 | $this->params = $params; |
101 | - $method = 'process' . ucfirst(strtolower($command)); |
|
101 | + $method = 'process'.ucfirst(strtolower($command)); |
|
102 | 102 | if (method_exists($this, $method)) { |
103 | 103 | return $this->{$method}(); |
104 | 104 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | { |
116 | 116 | if ($user !== null) { |
117 | 117 | $this->client->apiCall('im.open', ['user' => $user]) |
118 | - ->then(function (Payload $response) use ($messageToSent) { |
|
118 | + ->then(function(Payload $response) use ($messageToSent) { |
|
119 | 119 | $channel = $response->getData()['channel']['id']; |
120 | 120 | $this->postMessage($messageToSent, $channel); |
121 | 121 | }); |
@@ -132,9 +132,9 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function getHelp() : string |
134 | 134 | { |
135 | - $result = '*HELP*' . chr(10); |
|
135 | + $result = '*HELP*'.chr(10); |
|
136 | 136 | foreach ($this->helpCommands as $command => $helpText) { |
137 | - $result .= "*{$this->commandName}:{$command}*: {$helpText}" . chr(10); |
|
137 | + $result .= "*{$this->commandName}:{$command}*: {$helpText}".chr(10); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | return $result; |
@@ -178,11 +178,11 @@ discard block |
||
178 | 178 | break; |
179 | 179 | } |
180 | 180 | $attachment->setTitle($item->subject); |
181 | - $attachment->setTitleLink('https://review.typo3.org/' . $item->_number); |
|
181 | + $attachment->setTitleLink('https://review.typo3.org/'.$item->_number); |
|
182 | 182 | |
183 | - $text .= 'Branch: ' . $this->bold($branch) . ' | :calendar: ' . $this->bold($created) |
|
184 | - . ' | ID: ' . $this->bold($item->_number) . chr(10); |
|
185 | - $text .= '<https://review.typo3.org/' . $item->_number . '|:arrow_right: Goto Review>'; |
|
183 | + $text .= 'Branch: '.$this->bold($branch).' | :calendar: '.$this->bold($created) |
|
184 | + . ' | ID: '.$this->bold($item->_number).chr(10); |
|
185 | + $text .= '<https://review.typo3.org/'.$item->_number.'|:arrow_right: Goto Review>'; |
|
186 | 186 | |
187 | 187 | $attachment->setText($text); |
188 | 188 | $attachment->setFallback($text); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $issueNumber = (int) $matches[1][0]; |
51 | 51 | } |
52 | 52 | $issueNumber = $issueNumber ?? $value; |
53 | - if ((int)$issueNumber === 0) { |
|
53 | + if ((int) $issueNumber === 0) { |
|
54 | 54 | return 'hey, I need an issue number!'; |
55 | 55 | } |
56 | 56 | $result = $this->queryForge("issues/{$issueNumber}"); |
@@ -51,15 +51,15 @@ discard block |
||
51 | 51 | $patchId = (int) str_replace('https://review.typo3.org/', '', $json->{'change-url'}); |
52 | 52 | $patchSet = property_exists($json, 'patchset') ? (int) $json->patchset : 0; |
53 | 53 | |
54 | - $item = $this->queryGerrit('change:' . $patchId)[0]; |
|
54 | + $item = $this->queryGerrit('change:'.$patchId)[0]; |
|
55 | 55 | $created = substr($item->created, 0, 19); |
56 | - $text = "Branch: {$json->branch} | :calendar: {$created} | ID: {$item->_number}" . chr(10); |
|
56 | + $text = "Branch: {$json->branch} | :calendar: {$created} | ID: {$item->_number}".chr(10); |
|
57 | 57 | $text .= ":link: <https://review.typo3.org/{$item->_number}|Goto Review>"; |
58 | 58 | if ($hook === 'patchset-created' && $patchSet === 1 && $json->branch === 'master') { |
59 | - $message = $this->buildMessage('[NEW] ' . $item->subject, $text); |
|
59 | + $message = $this->buildMessage('[NEW] '.$item->subject, $text); |
|
60 | 60 | $this->sendMessageToChannel($hook, $message); |
61 | 61 | } elseif ($hook === 'change-merged') { |
62 | - $message = $this->buildMessage(':white_check_mark: [MERGED] ' . $item->subject, $text, Message\Attachment::COLOR_GOOD); |
|
62 | + $message = $this->buildMessage(':white_check_mark: [MERGED] '.$item->subject, $text, Message\Attachment::COLOR_GOOD); |
|
63 | 63 | $this->sendMessageToChannel($hook, $message); |
64 | 64 | $this->checkFiles($patchId, $json->commit); |
65 | 65 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $attachment->setColor($color[$status]); |
139 | 139 | $attachment->setTitle($text[$status]); |
140 | 140 | |
141 | - $text = ':link: <https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/' . $fileName . '|' . $fileName . '>'; |
|
141 | + $text = ':link: <https://git.typo3.org/Packages/TYPO3.CMS.git/blob/HEAD:/'.$fileName.'|'.$fileName.'>'; |
|
142 | 142 | $attachment->setText($text); |
143 | 143 | $attachment->setFallback($text); |
144 | 144 | return $attachment; |