Completed
Pull Request — master (#14)
by Simon
13:22
created
Classes/Commands/UtilCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,6 +54,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
config/config.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Classes/Traits/SlackTrait.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Classes/Traits/GerritTrait.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
Classes/Slack/CommandResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,6 +64,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Classes/Commands/BeerCommand.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
Classes/Commands/TellCommand.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Classes/Commands/ForgeCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
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}");
Please login to merge, or discard this patch.
Classes/Commands/ReviewCommand.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
         $countMinus2 = count($result);
60 60
 
61 61
         $returnString = '';
62
-        $returnString .= 'There are currently ' . $this->bold($count) . ' open reviews for project '
63
-            . $this->italic($project) . ' and branch master on <https://review.typo3.org/#/q/project:' . $project
64
-            . '+status:open+branch:master|https://review.typo3.org>' . chr(10);
65
-        $returnString .= $this->bold($countMinus1) . ' of ' . $this->bold($count) . ' open reviews voted with '
66
-            . $this->bold('-1') . ' <https://review.typo3.org/#/q/label:Code-Review%253D-1+is:open+branch:'
67
-            . 'master+project:' . $project . '|Check now> ' . chr(10);
68
-        $returnString .= $this->bold($countMinus2) . ' of ' . $this->bold($count) . ' open reviews voted with '
69
-            . $this->bold('-2') . ' <https://review.typo3.org/#/q/label:Code-Review%253D-2+is:open+branch:'
70
-            . 'master+project:' . $project . '|Check now>';
62
+        $returnString .= 'There are currently '.$this->bold($count).' open reviews for project '
63
+            . $this->italic($project).' and branch master on <https://review.typo3.org/#/q/project:'.$project
64
+            . '+status:open+branch:master|https://review.typo3.org>'.chr(10);
65
+        $returnString .= $this->bold($countMinus1).' of '.$this->bold($count).' open reviews voted with '
66
+            . $this->bold('-1').' <https://review.typo3.org/#/q/label:Code-Review%253D-1+is:open+branch:'
67
+            . 'master+project:'.$project.'|Check now> '.chr(10);
68
+        $returnString .= $this->bold($countMinus2).' of '.$this->bold($count).' open reviews voted with '
69
+            . $this->bold('-2').' <https://review.typo3.org/#/q/label:Code-Review%253D-2+is:open+branch:'
70
+            . 'master+project:'.$project.'|Check now>';
71 71
 
72 72
         return $returnString;
73 73
     }
@@ -98,15 +98,15 @@  discard block
 block discarded – undo
98 98
         if ($username === null) {
99 99
             return 'hey, I need a username!';
100 100
         }
101
-        $results = $this->queryGerrit('is:open owner:"' . $username . '" project:' . $project);
101
+        $results = $this->queryGerrit('is:open owner:"'.$username.'" project:'.$project);
102 102
         if (!empty($results)) {
103
-            $listOfItems = ['*Here are the results for ' . $username . '*:'];
103
+            $listOfItems = ['*Here are the results for '.$username.'*:'];
104 104
             foreach ($results as $item) {
105 105
                 $listOfItems[] = $this->buildReviewLine($item);
106 106
             }
107 107
             return implode(chr(10), $listOfItems);
108 108
         }
109
-        return $username . ' has no open reviews or username is unknown';
109
+        return $username.' has no open reviews or username is unknown';
110 110
     }
111 111
 
112 112
     /**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         $paramsCount = count($this->params);
145 145
         $changeIds = [];
146 146
         for ($i = 1; $i < $paramsCount; ++$i) {
147
-            $changeIds[] = 'change:' . $this->params[$i];
147
+            $changeIds[] = 'change:'.$this->params[$i];
148 148
         }
149 149
         $result = $this->queryGerrit(implode(' OR ', $changeIds));
150 150
         $listOfItems = [];
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     protected function buildReviewMessageOutput(int $refId)
165 165
     {
166
-        $result = $this->queryGerrit('change:' . $refId);
166
+        $result = $this->queryGerrit('change:'.$refId);
167 167
         if (!empty($result)) {
168 168
             foreach ($result as $item) {
169 169
                 if ($item->_number === $refId) {
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             return 'hey, I need a query!';
188 188
         }
189 189
 
190
-        $results = $this->queryGerrit('limit:50 ' . $query);
190
+        $results = $this->queryGerrit('limit:50 '.$query);
191 191
         if (!empty($results)) {
192 192
             $listOfItems = ["*Here are the results for {$query}*:"];
193 193
             foreach ($results as $item) {
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 
216 216
         $cnt = count($result);
217 217
 
218
-        return 'Good job folks, since ' . $date . ' you merged *' . $cnt . '* patches into master';
218
+        return 'Good job folks, since '.$date.' you merged *'.$cnt.'* patches into master';
219 219
     }
220 220
 
221 221
     /**
Please login to merge, or discard this patch.