@@ -84,6 +84,9 @@ discard block |
||
| 84 | 84 | $this->updatePrefixes($authedUser->getUsername()); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | + /** |
|
| 88 | + * @param string $text |
|
| 89 | + */ |
|
| 87 | 90 | public function matchesPrefix($prefix, $text) : array |
| 88 | 91 | { |
| 89 | 92 | if ($prefix === self::NO_PREFIX) { |
@@ -195,6 +198,9 @@ discard block |
||
| 195 | 198 | return $this->authedUser; |
| 196 | 199 | } |
| 197 | 200 | |
| 201 | + /** |
|
| 202 | + * @param string $authedUsername |
|
| 203 | + */ |
|
| 198 | 204 | protected function updatePrefixes($authedUsername) |
| 199 | 205 | { |
| 200 | 206 | $updatedPriorityMap = []; |
@@ -130,6 +130,9 @@ discard block |
||
| 130 | 130 | return $readable ? $readable : $entity; |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | + /** |
|
| 134 | + * @param string $readable |
|
| 135 | + */ |
|
| 133 | 136 | public function formatUser(string $entity, $readable = null) : string |
| 134 | 137 | { |
| 135 | 138 | if ($readable) { |
@@ -144,6 +147,9 @@ discard block |
||
| 144 | 147 | return $entity; |
| 145 | 148 | } |
| 146 | 149 | |
| 150 | + /** |
|
| 151 | + * @param string $readable |
|
| 152 | + */ |
|
| 147 | 153 | public function formatChannel(string $entity, $readable = null) : string |
| 148 | 154 | { |
| 149 | 155 | if ($readable) { |
@@ -158,6 +164,9 @@ discard block |
||
| 158 | 164 | return $entity; |
| 159 | 165 | } |
| 160 | 166 | |
| 167 | + /** |
|
| 168 | + * @param string $param |
|
| 169 | + */ |
|
| 161 | 170 | protected function isMessageChanged(array $data, $param = null): bool |
| 162 | 171 | { |
| 163 | 172 | return isset($data['subtype']) |
@@ -114,11 +114,11 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | $this->getSlack()->reconnect()->then( |
| 117 | - function () { |
|
| 117 | + function() { |
|
| 118 | 118 | $this->getLog()->info('Reconnected'); |
| 119 | 119 | $this->monitor = $this->startConnectionMonitor(); |
| 120 | 120 | }, |
| 121 | - function () { |
|
| 121 | + function() { |
|
| 122 | 122 | $this->getLog()->error('Reconnect failed, shutting down.'); |
| 123 | 123 | $this->shutDown(); |
| 124 | 124 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | protected function logMessage($data) |
| 208 | 208 | { |
| 209 | 209 | if ($this->messageLog !== null) { |
| 210 | - file_put_contents($this->messageLog, json_encode($data) . "\n", FILE_APPEND); |
|
| 210 | + file_put_contents($this->messageLog, json_encode($data)."\n", FILE_APPEND); |
|
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | $this->ping(); |
| 225 | 225 | |
| 226 | - return $this->loop->addPeriodicTimer($interval, function () { |
|
| 226 | + return $this->loop->addPeriodicTimer($interval, function() { |
|
| 227 | 227 | $this->checkPong(); |
| 228 | 228 | $this->ping(); |
| 229 | 229 | }); |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | |
| 257 | 257 | $this->getSlack()->ping() |
| 258 | 258 | ->then( |
| 259 | - function (Payload $payload) { |
|
| 259 | + function(Payload $payload) { |
|
| 260 | 260 | $this->getLog()->info($payload->toJson()); |
| 261 | 261 | $this->pong = true; |
| 262 | 262 | } |