@@ -54,6 +54,6 @@ |
||
54 | 54 | |
55 | 55 | $option = $options[random_int(0, count($options) - 1)]; |
56 | 56 | |
57 | - return '*Botty says:* _' . $option . '_'; |
|
57 | + return '*Botty says:* _'.$option.'_'; |
|
58 | 58 | } |
59 | 59 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -(new Dotenv\Dotenv(__DIR__ . '/../'))->load(); |
|
3 | +(new Dotenv\Dotenv(__DIR__.'/../'))->load(); |
|
4 | 4 | |
5 | 5 | $GLOBALS['config'] = [ |
6 | 6 | // project phase |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | protected function bold($string) : string |
28 | 28 | { |
29 | - return '*' . $string . '*'; |
|
29 | + return '*'.$string.'*'; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | protected function italic($string) : string |
40 | 40 | { |
41 | - return '_' . $string . '_'; |
|
41 | + return '_'.$string.'_'; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function buildReviewLine($item) : string |
52 | 52 | { |
53 | - return $this->bold($item->subject) . ' <https://review.typo3.org/' . $item->_number |
|
54 | - . '|Review #' . $item->_number . ' now>'; |
|
53 | + return $this->bold($item->subject).' <https://review.typo3.org/'.$item->_number |
|
54 | + . '|Review #'.$item->_number.' now>'; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -63,15 +63,15 @@ discard block |
||
63 | 63 | { |
64 | 64 | $created = substr($item->created_on, 0, 19); |
65 | 65 | $updated = substr($item->updated_on, 0, 19); |
66 | - $text = $this->bold('[' . $item->tracker->name . '] ' . $item->subject) |
|
67 | - . ' by ' . $this->italic($item->author->name) . chr(10); |
|
68 | - $text .= 'Project: ' . $this->bold($item->project->name); |
|
66 | + $text = $this->bold('['.$item->tracker->name.'] '.$item->subject) |
|
67 | + . ' by '.$this->italic($item->author->name).chr(10); |
|
68 | + $text .= 'Project: '.$this->bold($item->project->name); |
|
69 | 69 | if (!empty($item->category->name)) { |
70 | - $text .= ' | Category: ' . $this->bold($item->category->name); |
|
70 | + $text .= ' | Category: '.$this->bold($item->category->name); |
|
71 | 71 | } |
72 | - $text .= ' | Status: ' . $this->bold($item->status->name) . chr(10); |
|
73 | - $text .= ':calendar: Created: ' . $this->bold($created) . ' | Last update: ' . $this->bold($updated) . chr(10); |
|
74 | - $text .= '<https://forge.typo3.org/issues/' . $item->id . '|:arrow_right: View on Forge>'; |
|
72 | + $text .= ' | Status: '.$this->bold($item->status->name).chr(10); |
|
73 | + $text .= ':calendar: Created: '.$this->bold($created).' | Last update: '.$this->bold($updated).chr(10); |
|
74 | + $text .= '<https://forge.typo3.org/issues/'.$item->id.'|:arrow_right: View on Forge>'; |
|
75 | 75 | |
76 | 76 | return $text; |
77 | 77 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | protected function queryGerrit($query) |
20 | 20 | { |
21 | - return $this->remoteCall('https://review.typo3.org/changes/?q=' . urlencode($query)); |
|
21 | + return $this->remoteCall('https://review.typo3.org/changes/?q='.urlencode($query)); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | protected function getFilesForPatch($changeId, $revision) |
31 | 31 | { |
32 | 32 | return $this->remoteCall( |
33 | - 'https://review.typo3.org/changes/' . $changeId . '/revisions/' . $revision . '/files' |
|
33 | + 'https://review.typo3.org/changes/'.$changeId.'/revisions/'.$revision.'/files' |
|
34 | 34 | ); |
35 | 35 | } |
36 | 36 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $result = false; |
52 | 52 | if (!curl_errno($ch)) { |
53 | 53 | curl_close($ch); |
54 | - $result = json_decode(str_replace(")]}'" . chr(10), '', $data)); |
|
54 | + $result = json_decode(str_replace(")]}'".chr(10), '', $data)); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | return $result; |
@@ -64,6 +64,6 @@ |
||
64 | 64 | { |
65 | 65 | $delimiter = strpos($message, ':') !== false ? ':' : ' '; |
66 | 66 | $parts = explode($delimiter, $message); |
67 | - return '\\T3Bot\\Commands\\' . ucfirst(strtolower($parts[0])) . 'Command'; |
|
67 | + return '\\T3Bot\\Commands\\'.ucfirst(strtolower($parts[0])).'Command'; |
|
68 | 68 | } |
69 | 69 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | protected function processAll() : string |
51 | 51 | { |
52 | - return 'Yeah, ' . $this->getBeerCountAll() . ' :t3beer: spend to all people'; |
|
52 | + return 'Yeah, '.$this->getBeerCountAll().' :t3beer: spend to all people'; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $rows = $this->getBeerTop10(); |
65 | 65 | $text = ['*Yeah, here are the TOP 10*']; |
66 | 66 | foreach ($rows as $row) { |
67 | - $text[] = '<@' . $row['username'] . '> has received ' . $row['cnt'] . ' :t3beer:'; |
|
67 | + $text[] = '<@'.$row['username'].'> has received '.$row['cnt'].' :t3beer:'; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | return implode(chr(10), $text); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | if (strpos($username, '<') === 0 && $username[1] === '@') { |
86 | 86 | $username = str_replace(['<', '>', '@'], '', $username); |
87 | 87 | |
88 | - return '<@' . $username . '> has received ' . $this->getBeerCountByUsername($username) . ' :t3beer: so far'; |
|
88 | + return '<@'.$username.'> has received '.$this->getBeerCountByUsername($username).' :t3beer: so far'; |
|
89 | 89 | } |
90 | 90 | return '*Sorry, a username must start with a @-sign:*'; |
91 | 91 | } |
@@ -109,10 +109,10 @@ discard block |
||
109 | 109 | 'from_user' => $from_user, |
110 | 110 | 'tstamp' => time() |
111 | 111 | ]); |
112 | - return 'Yeah, one more :t3beer: for <@' . $username . '>' . chr(10) . '<@' . $username . '> has received ' |
|
113 | - . $this->getBeerCountByUsername($username) . ' :t3beer: so far'; |
|
112 | + return 'Yeah, one more :t3beer: for <@'.$username.'>'.chr(10).'<@'.$username.'> has received ' |
|
113 | + . $this->getBeerCountByUsername($username).' :t3beer: so far'; |
|
114 | 114 | } |
115 | - return 'You spend one :t3beer: to <@' . $username . '> within in last 24 hours. Too much beer is unhealthy ;)'; |
|
115 | + return 'You spend one :t3beer: to <@'.$username.'> within in last 24 hours. Too much beer is unhealthy ;)'; |
|
116 | 116 | } |
117 | 117 | return '*Sorry, a username must start with a @-sign:*'; |
118 | 118 | } |
@@ -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 | } |
@@ -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; |