@@ -30,25 +30,25 @@ discard block |
||
30 | 30 | |
31 | 31 | return [ |
32 | 32 | 'daddy' => ['daddy', 'My daddy is Frank Nägler aka <@neoblack>'], |
33 | - 'n8' => ['n8', 'Good night ' . $username . '! :sleeping:'], |
|
34 | - 'nacht' => ['nacht', 'Good night ' . $username . '! :sleeping:'], |
|
35 | - 'night' => ['night', 'Good night ' . $username . '! :sleeping:'], |
|
36 | - 'hello' => ['hello', 'Hello ' . $username . ', nice to see you!'], |
|
37 | - 'hallo' => ['hallo', 'Hello ' . $username . ', nice to see you!'], |
|
38 | - 'ciao' => ['ciao', 'Bye, bye ' . $username . ', cu later alligator! :wave:'], |
|
39 | - 'cu' => ['cu', 'Bye, bye ' . $username . ', cu later alligator! :wave:'], |
|
40 | - 'thx' => ['thx', 'You are welcome ' . $username . '!'], |
|
41 | - 'thank' => ['thank', 'You are welcome ' . $username . '!'], |
|
42 | - 'drink' => ['drink', 'Coffee or beer ' . $username . '?'], |
|
43 | - 'coffee' => ['coffee', 'Here is a :coffee: for you ' . $username . '!'], |
|
44 | - 'beer' => ['beer', 'Here is a :t3beer: for you ' . $username . '!'], |
|
45 | - 'coke' => ['coke', 'Coke is unhealthy ' . $username . '!'], |
|
46 | - 'cola' => ['cola', 'Coke is unhealthy ' . $username . '!'], |
|
47 | - 'cookie' => ['cookie', 'Here is a :cookie: for you ' . $username . '!'], |
|
33 | + 'n8' => ['n8', 'Good night '.$username.'! :sleeping:'], |
|
34 | + 'nacht' => ['nacht', 'Good night '.$username.'! :sleeping:'], |
|
35 | + 'night' => ['night', 'Good night '.$username.'! :sleeping:'], |
|
36 | + 'hello' => ['hello', 'Hello '.$username.', nice to see you!'], |
|
37 | + 'hallo' => ['hallo', 'Hello '.$username.', nice to see you!'], |
|
38 | + 'ciao' => ['ciao', 'Bye, bye '.$username.', cu later alligator! :wave:'], |
|
39 | + 'cu' => ['cu', 'Bye, bye '.$username.', cu later alligator! :wave:'], |
|
40 | + 'thx' => ['thx', 'You are welcome '.$username.'!'], |
|
41 | + 'thank' => ['thank', 'You are welcome '.$username.'!'], |
|
42 | + 'drink' => ['drink', 'Coffee or beer '.$username.'?'], |
|
43 | + 'coffee' => ['coffee', 'Here is a :coffee: for you '.$username.'!'], |
|
44 | + 'beer' => ['beer', 'Here is a :t3beer: for you '.$username.'!'], |
|
45 | + 'coke' => ['coke', 'Coke is unhealthy '.$username.'!'], |
|
46 | + 'cola' => ['cola', 'Coke is unhealthy '.$username.'!'], |
|
47 | + 'cookie' => ['cookie', 'Here is a :cookie: for you '.$username.'!'], |
|
48 | 48 | 'typo3' => ['typo3', ':typo3: TYPO3 CMS is the best open source CMS of the world!'], |
49 | 49 | 'dark' => ['dark', 'sure, we have cookies :cookie:'], |
50 | 50 | //'cat' => ['cat', 'ok, here is some cat content '.$cats[array_rand($cats)]], |
51 | - 'love' => ['love', 'I love you too, ' . $username . ':kiss:'], |
|
51 | + 'love' => ['love', 'I love you too, '.$username.':kiss:'], |
|
52 | 52 | 'no-matching' => ['foobar', null], |
53 | 53 | ]; |
54 | 54 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | { |
65 | 65 | $this->initCommandWithPayload(BottyCommand::class, [ |
66 | 66 | 'user' => 'U54321', |
67 | - 'text' => 'botty ' . $keyword, |
|
67 | + 'text' => 'botty '.$keyword, |
|
68 | 68 | ]); |
69 | 69 | $result = $this->command->process(); |
70 | 70 | if ($response === null) { |
@@ -82,7 +82,7 @@ |
||
82 | 82 | { |
83 | 83 | $this->initCommandWithPayload(ForgeCommand::class, [ |
84 | 84 | 'user' => 'U54321', |
85 | - 'text' => 'forge:show ' . $issueNumber, |
|
85 | + 'text' => 'forge:show '.$issueNumber, |
|
86 | 86 | ]); |
87 | 87 | $result = $this->command->process(); |
88 | 88 |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | { |
152 | 152 | $this->initCommandWithPayload(ReviewCommand::class, [ |
153 | 153 | 'user' => 'U54321', |
154 | - 'text' => 'review:show ' . $refId, |
|
154 | + 'text' => 'review:show '.$refId, |
|
155 | 155 | ]); |
156 | 156 | /** @var Message $result */ |
157 | 157 | $result = $this->command->process(); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | /** @var Message $result */ |
176 | 176 | $result = $this->command->process(); |
177 | 177 | $expectedString = '*[BUGFIX] Prevent fatal error when uploading file with invalid filename* ' |
178 | - . '<https://review.typo3.org/47640|Review #47640 now>' . chr(10); |
|
178 | + . '<https://review.typo3.org/47640|Review #47640 now>'.chr(10); |
|
179 | 179 | $expectedString .= '*[BUGFIX] Cast autoload and classAliasMap to Array* ' |
180 | 180 | . '<https://review.typo3.org/23456|Review #23456 now>'; |
181 | 181 | static::assertEquals($expectedString, $result); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $controller |
37 | 37 | ->expects(static::once()) |
38 | 38 | ->method('postToSlack'); |
39 | - $controller->process('change-merged', __DIR__ . '/../Fixtures/Valid/change-merged.json'); |
|
39 | + $controller->process('change-merged', __DIR__.'/../Fixtures/Valid/change-merged.json'); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | static::isInstanceOf(Message::class), |
55 | 55 | static::equalTo('#rst-channel') |
56 | 56 | ); |
57 | - $controller->process('change-merged', __DIR__ . '/../Fixtures/Valid/change-merged-with-added-rst.json'); |
|
57 | + $controller->process('change-merged', __DIR__.'/../Fixtures/Valid/change-merged-with-added-rst.json'); |
|
58 | 58 | $GLOBALS['config']['gerrit']['change-merged']['channels'] = $mergeChannel; |
59 | 59 | } |
60 | 60 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | static::isInstanceOf(Message::class), |
74 | 74 | static::equalTo('#rst-channel') |
75 | 75 | ); |
76 | - $controller->process('change-merged', __DIR__ . '/../Fixtures/Valid/change-merged-with-deleted-rst.json'); |
|
76 | + $controller->process('change-merged', __DIR__.'/../Fixtures/Valid/change-merged-with-deleted-rst.json'); |
|
77 | 77 | $GLOBALS['config']['gerrit']['change-merged']['channels'] = $mergeChannel; |
78 | 78 | } |
79 | 79 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | static::isInstanceOf(Message::class), |
93 | 93 | static::equalTo('#rst-channel') |
94 | 94 | ); |
95 | - $controller->process('change-merged', __DIR__ . '/../Fixtures/Valid/change-merged-with-changed-rst.json'); |
|
95 | + $controller->process('change-merged', __DIR__.'/../Fixtures/Valid/change-merged-with-changed-rst.json'); |
|
96 | 96 | $GLOBALS['config']['gerrit']['change-merged']['channels'] = $mergeChannel; |
97 | 97 | } |
98 | 98 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $controller |
106 | 106 | ->expects(static::once()) |
107 | 107 | ->method('postToSlack'); |
108 | - $controller->process('patchset-created', __DIR__ . '/../Fixtures/Valid/patchset-created.json'); |
|
108 | + $controller->process('patchset-created', __DIR__.'/../Fixtures/Valid/patchset-created.json'); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $controller |
118 | 118 | ->expects(static::never()) |
119 | 119 | ->method('postToSlack'); |
120 | - $controller->process('change-merged', __DIR__ . '/../Fixtures/Invalid/change-merged.json'); |
|
120 | + $controller->process('change-merged', __DIR__.'/../Fixtures/Invalid/change-merged.json'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $controller |
130 | 130 | ->expects(static::never()) |
131 | 131 | ->method('postToSlack'); |
132 | - $controller->process('patchset-created', __DIR__ . '/../Fixtures/Invalid/patchset-created.json'); |
|
132 | + $controller->process('patchset-created', __DIR__.'/../Fixtures/Invalid/patchset-created.json'); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | $controller |
142 | 142 | ->expects(static::never()) |
143 | 143 | ->method('postToSlack'); |
144 | - $controller->process('change-merged', __DIR__ . '/../Fixtures/Invalid/change-merged-invalid-token.json'); |
|
144 | + $controller->process('change-merged', __DIR__.'/../Fixtures/Invalid/change-merged-invalid-token.json'); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $controller |
154 | 154 | ->expects(static::never()) |
155 | 155 | ->method('postToSlack'); |
156 | - $controller->process('patchset-created', __DIR__ . '/../Fixtures/Invalid/patchset-created-invalid-token.json'); |
|
156 | + $controller->process('patchset-created', __DIR__.'/../Fixtures/Invalid/patchset-created-invalid-token.json'); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $controller |
166 | 166 | ->expects(static::once()) |
167 | 167 | ->method('addMessageToQueue'); |
168 | - $controller->process('change-merged', __DIR__ . '/../Fixtures/Valid/change-merged.json'); |
|
168 | + $controller->process('change-merged', __DIR__.'/../Fixtures/Valid/change-merged.json'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $controller |
178 | 178 | ->expects(static::once()) |
179 | 179 | ->method('addMessageToQueue'); |
180 | - $controller->process('patchset-created', __DIR__ . '/../Fixtures/Valid/patchset-created.json'); |
|
180 | + $controller->process('patchset-created', __DIR__.'/../Fixtures/Valid/patchset-created.json'); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | public function validWebhookDataProvider() |
37 | 37 | { |
38 | 38 | return [ |
39 | - 'webhook' => [__DIR__ . '/../Fixtures/Valid/webhook.json'], |
|
40 | - 'webhook_danger' => [__DIR__ . '/../Fixtures/Valid/webhook_danger.json'], |
|
41 | - 'webhook_info' => [__DIR__ . '/../Fixtures/Valid/webhook_info.json'], |
|
42 | - 'webhook_notice' => [__DIR__ . '/../Fixtures/Valid/webhook_notice.json'], |
|
43 | - 'webhook_ok' => [__DIR__ . '/../Fixtures/Valid/webhook_ok.json'], |
|
44 | - 'webhook_warning' => [__DIR__ . '/../Fixtures/Valid/webhook_warning.json'], |
|
39 | + 'webhook' => [__DIR__.'/../Fixtures/Valid/webhook.json'], |
|
40 | + 'webhook_danger' => [__DIR__.'/../Fixtures/Valid/webhook_danger.json'], |
|
41 | + 'webhook_info' => [__DIR__.'/../Fixtures/Valid/webhook_info.json'], |
|
42 | + 'webhook_notice' => [__DIR__.'/../Fixtures/Valid/webhook_notice.json'], |
|
43 | + 'webhook_ok' => [__DIR__.'/../Fixtures/Valid/webhook_ok.json'], |
|
44 | + 'webhook_warning' => [__DIR__.'/../Fixtures/Valid/webhook_warning.json'], |
|
45 | 45 | ]; |
46 | 46 | } |
47 | 47 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $controller |
55 | 55 | ->expects(static::never()) |
56 | 56 | ->method('postToSlack'); |
57 | - $controller->process('unknow', __DIR__ . '/../Fixtures/Valid/webhook.json'); |
|
57 | + $controller->process('unknow', __DIR__.'/../Fixtures/Valid/webhook.json'); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $controller |
80 | 80 | ->expects(static::never()) |
81 | 81 | ->method('postToSlack'); |
82 | - $controller->process('t3o-registrations', __DIR__ . '/../Fixtures/Invalid/webhook.json'); |
|
82 | + $controller->process('t3o-registrations', __DIR__.'/../Fixtures/Invalid/webhook.json'); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $controller |
92 | 92 | ->expects(static::once()) |
93 | 93 | ->method('addMessageToQueue'); |
94 | - $controller->process('t3o-registrations', __DIR__ . '/../Fixtures/Valid/webhook.json'); |
|
94 | + $controller->process('t3o-registrations', __DIR__.'/../Fixtures/Valid/webhook.json'); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -75,7 +75,7 @@ |
||
75 | 75 | <div class="result" style="text-align: left;"> |
76 | 76 | <pre><?php foreach ($result as $row) { |
77 | 77 | ?> |
78 | -<?= $row . "\n" ?> |
|
78 | +<?= $row."\n" ?> |
|
79 | 79 | <?php |
80 | 80 | } ?></pre> |
81 | 81 | </div> |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | $command = !empty($params[0]) ? $params[0] : 'help'; |
89 | 89 | $this->params = $params; |
90 | - $method = 'process' . ucfirst(strtolower($command)); |
|
90 | + $method = 'process'.ucfirst(strtolower($command)); |
|
91 | 91 | if (method_exists($this, $method)) { |
92 | 92 | return $this->{$method}(); |
93 | 93 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $data = []; |
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 = []; |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | break; |
243 | 243 | } |
244 | 244 | $attachment->setTitle($item->subject); |
245 | - $attachment->setTitleLink('https://review.typo3.org/' . $item->_number); |
|
245 | + $attachment->setTitleLink('https://review.typo3.org/'.$item->_number); |
|
246 | 246 | |
247 | - $text .= 'Branch: ' . $this->bold($branch) . ' | :calendar: ' . $this->bold($created) |
|
248 | - . ' | ID: ' . $this->bold($item->_number) . "\n"; |
|
249 | - $text .= '<https://review.typo3.org/' . $item->_number . '|:arrow_right: Goto Review>'; |
|
247 | + $text .= 'Branch: '.$this->bold($branch).' | :calendar: '.$this->bold($created) |
|
248 | + . ' | ID: '.$this->bold($item->_number)."\n"; |
|
249 | + $text .= '<https://review.typo3.org/'.$item->_number.'|:arrow_right: Goto Review>'; |
|
250 | 250 | |
251 | 251 | $attachment->setText($text); |
252 | 252 | $attachment->setFallback($text); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public function processMessage() : string |
29 | 29 | { |
30 | 30 | $message = strtolower($this->payload->getData()['text']); |
31 | - $username = '<@' . $this->payload->getData()['user'] . '>'; |
|
31 | + $username = '<@'.$this->payload->getData()['user'].'>'; |
|
32 | 32 | |
33 | 33 | if (strpos($message, 'help') !== false) { |
34 | 34 | $links = [ |
@@ -46,29 +46,29 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $cats = [':smiley_cat:', ':smile_cat:', ':heart_eyes_cat:', ':kissing_cat:', ':smirk_cat:', ':scream_cat:', |
49 | - ':crying_cat_face:', ':joy_cat:' , ':pouting_cat:', ]; |
|
49 | + ':crying_cat_face:', ':joy_cat:', ':pouting_cat:', ]; |
|
50 | 50 | |
51 | 51 | $responses = [ |
52 | 52 | 'daddy' => 'My daddy is Frank Nägler aka <@neoblack>', |
53 | - 'n8' => 'Good night ' . $username . '! :sleeping:', |
|
54 | - 'nacht' => 'Good night ' . $username . '! :sleeping:', |
|
55 | - 'night' => 'Good night ' . $username . '! :sleeping:', |
|
56 | - 'hello' => 'Hello ' . $username . ', nice to see you!', |
|
57 | - 'hallo' => 'Hello ' . $username . ', nice to see you!', |
|
58 | - 'ciao' => 'Bye, bye ' . $username . ', cu later alligator! :wave:', |
|
59 | - 'cu' => 'Bye, bye ' . $username . ', cu later alligator! :wave:', |
|
60 | - 'thx' => 'You are welcome ' . $username . '!', |
|
61 | - 'thank' => 'You are welcome ' . $username . '!', |
|
62 | - 'drink' => 'Coffee or beer ' . $username . '?', |
|
63 | - 'coffee' => 'Here is a :coffee: for you ' . $username . '!', |
|
64 | - 'beer' => 'Here is a :t3beer: for you ' . $username . '!', |
|
65 | - 'coke' => 'Coke is unhealthy ' . $username . '!', |
|
66 | - 'cola' => 'Coke is unhealthy ' . $username . '!', |
|
67 | - 'cookie' => 'Here is a :cookie: for you ' . $username . '!', |
|
53 | + 'n8' => 'Good night '.$username.'! :sleeping:', |
|
54 | + 'nacht' => 'Good night '.$username.'! :sleeping:', |
|
55 | + 'night' => 'Good night '.$username.'! :sleeping:', |
|
56 | + 'hello' => 'Hello '.$username.', nice to see you!', |
|
57 | + 'hallo' => 'Hello '.$username.', nice to see you!', |
|
58 | + 'ciao' => 'Bye, bye '.$username.', cu later alligator! :wave:', |
|
59 | + 'cu' => 'Bye, bye '.$username.', cu later alligator! :wave:', |
|
60 | + 'thx' => 'You are welcome '.$username.'!', |
|
61 | + 'thank' => 'You are welcome '.$username.'!', |
|
62 | + 'drink' => 'Coffee or beer '.$username.'?', |
|
63 | + 'coffee' => 'Here is a :coffee: for you '.$username.'!', |
|
64 | + 'beer' => 'Here is a :t3beer: for you '.$username.'!', |
|
65 | + 'coke' => 'Coke is unhealthy '.$username.'!', |
|
66 | + 'cola' => 'Coke is unhealthy '.$username.'!', |
|
67 | + 'cookie' => 'Here is a :cookie: for you '.$username.'!', |
|
68 | 68 | 'typo3' => ':typo3: TYPO3 CMS is the best open source CMS of the world!', |
69 | 69 | 'dark' => 'sure, we have cookies :cookie:', |
70 | - 'cat' => 'ok, here is some cat content ' . $cats[array_rand($cats)], |
|
71 | - 'love' => 'I love you too, ' . $username . ':kiss:', |
|
70 | + 'cat' => 'ok, here is some cat content '.$cats[array_rand($cats)], |
|
71 | + 'love' => 'I love you too, '.$username.':kiss:', |
|
72 | 72 | ]; |
73 | 73 | $messageToSend = ''; |
74 | 74 | foreach ($responses as $keyword => $response) { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | protected function processAll() : string |
50 | 50 | { |
51 | - return 'Yeah, ' . $this->getBeerCountAll() . ' :t3beer: spend to all people'; |
|
51 | + return 'Yeah, '.$this->getBeerCountAll().' :t3beer: spend to all people'; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $rows = $this->getBeerTop10(); |
64 | 64 | $text = ['*Yeah, here are the TOP 10*']; |
65 | 65 | foreach ($rows as $row) { |
66 | - $text[] = '<@' . $row['username'] . '> has received ' . $row['cnt'] . ' :t3beer:'; |
|
66 | + $text[] = '<@'.$row['username'].'> has received '.$row['cnt'].' :t3beer:'; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return implode(chr(10), $text); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | if (strpos($username, '<') === 0 && $username[1] === '@') { |
85 | 85 | $username = str_replace(['<', '>', '@'], '', $username); |
86 | 86 | |
87 | - return '<@' . $username . '> has received ' . $this->getBeerCountByUsername($username) . ' :t3beer: so far'; |
|
87 | + return '<@'.$username.'> has received '.$this->getBeerCountByUsername($username).' :t3beer: so far'; |
|
88 | 88 | } |
89 | 89 | return '*Sorry, a username must start with a @-sign:*'; |
90 | 90 | } |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | 'tstamp' => time() |
129 | 129 | ]; |
130 | 130 | $this->getDatabaseConnection()->insert('beers', $data); |
131 | - return 'Yeah, one more :t3beer: for <@' . $username . '>' . chr(10) . '<@' . $username . '> has received ' |
|
132 | - . $this->getBeerCountByUsername($username) . ' :t3beer: so far'; |
|
131 | + return 'Yeah, one more :t3beer: for <@'.$username.'>'.chr(10).'<@'.$username.'> has received ' |
|
132 | + . $this->getBeerCountByUsername($username).' :t3beer: so far'; |
|
133 | 133 | } |
134 | - return 'You spend one :t3beer: to <@' . $username . '> within in last 24 hours. Too much beer is unhealthy ;)'; |
|
134 | + return 'You spend one :t3beer: to <@'.$username.'> within in last 24 hours. Too much beer is unhealthy ;)'; |
|
135 | 135 | } |
136 | 136 | return '*Sorry, a username must start with a @-sign:*'; |
137 | 137 | } |