@@ -49,7 +49,7 @@ |
||
49 | 49 | public function getConversationHandler($chatId): PromiseInterface |
50 | 50 | { |
51 | 51 | return $this->cache->get($this->getConversationKey($chatId)) |
52 | - ->then(function ($conversation) { |
|
52 | + ->then(function($conversation) { |
|
53 | 53 | if (empty($conversation["state"])) { |
54 | 54 | return null; |
55 | 55 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | { |
85 | 85 | $update->detectUpdateType(); |
86 | 86 | $this->zanzara->resolveListeners($update) |
87 | - ->then(function ($listeners) use ($update) { |
|
87 | + ->then(function($listeners) use ($update) { |
|
88 | 88 | /** @var Listener[] $listeners */ |
89 | 89 | foreach ($listeners as $listener) { |
90 | 90 | $context = new Context($update, $this->container); |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | */ |
200 | 200 | public function deleteCacheItem(string $cacheKey, $key) |
201 | 201 | { |
202 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($cacheKey, $key) { |
|
202 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($cacheKey, $key) { |
|
203 | 203 | if (!$arrayData) { |
204 | 204 | return true; //there isn't anything so it's deleted |
205 | 205 | } else { |
206 | 206 | unset($arrayData[$key]); |
207 | 207 | } |
208 | 208 | |
209 | - return $this->cache->set($cacheKey, $arrayData)->then(function ($result) { |
|
209 | + return $this->cache->set($cacheKey, $arrayData)->then(function($result) { |
|
210 | 210 | if ($result !== true) { |
211 | 211 | $this->logger->errorWriteCache(); |
212 | 212 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function deleteCache(array $keys) |
224 | 224 | { |
225 | - return $this->cache->deleteMultiple($keys)->then(function ($result) { |
|
225 | + return $this->cache->deleteMultiple($keys)->then(function($result) { |
|
226 | 226 | if ($result !== true) { |
227 | 227 | $this->logger->errorClearCache(); |
228 | 228 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function getCacheItem(string $cacheKey, $key) |
240 | 240 | { |
241 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($key) { |
|
241 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($key) { |
|
242 | 242 | if ($arrayData && array_key_exists($key, $arrayData)) { |
243 | 243 | return $arrayData[$key]; |
244 | 244 | } else { |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | public function doSet(string $cacheKey, string $key, $data, $ttl = false) |
287 | 287 | { |
288 | 288 | $ttl = $this->checkTtl($ttl); |
289 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($ttl, $key, $data, $cacheKey) { |
|
289 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($ttl, $key, $data, $cacheKey) { |
|
290 | 290 | if (!$arrayData) { |
291 | 291 | $arrayData = array(); |
292 | 292 | $arrayData[$key] = $data; |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | $arrayData[$key] = $data; |
295 | 295 | } |
296 | 296 | |
297 | - return $this->cache->set($cacheKey, $arrayData, $ttl)->then(function ($result) { |
|
297 | + return $this->cache->set($cacheKey, $arrayData, $ttl)->then(function($result) { |
|
298 | 298 | if ($result !== true) { |
299 | 299 | $this->logger->errorWriteCache(); |
300 | 300 | } |
@@ -316,10 +316,10 @@ discard block |
||
316 | 316 | { |
317 | 317 | |
318 | 318 | $ttl = $this->checkTtl($ttl); |
319 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($ttl, $key, $data, $cacheKey) { |
|
319 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($ttl, $key, $data, $cacheKey) { |
|
320 | 320 | $arrayData[$key][] = $data; |
321 | 321 | |
322 | - return $this->cache->set($cacheKey, $arrayData, $ttl)->then(function ($result) { |
|
322 | + return $this->cache->set($cacheKey, $arrayData, $ttl)->then(function($result) { |
|
323 | 323 | if ($result !== true) { |
324 | 324 | $this->logger->errorWriteCache(); |
325 | 325 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $chatId = $update->getEffectiveChat() ? $update->getEffectiveChat()->getId() : null; |
49 | 49 | if ($chatId) { |
50 | 50 | $this->conversationManager->getConversationHandler($chatId) |
51 | - ->then(function ($handler) use ($deferred, &$listeners) { |
|
51 | + ->then(function($handler) use ($deferred, &$listeners) { |
|
52 | 52 | if ($handler) { |
53 | 53 | $listeners[] = new Listener($handler, $this->container); |
54 | 54 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if ($text) { |
65 | 65 | $chatId = $update->getEffectiveChat()->getId(); |
66 | 66 | $this->conversationManager->getConversationHandler($chatId) |
67 | - ->then(function ($handlerInfo) use ($chatId, $text, $deferred, &$listeners) { |
|
67 | + ->then(function($handlerInfo) use ($chatId, $text, $deferred, &$listeners) { |
|
68 | 68 | if (!$handlerInfo) { |
69 | 69 | $this->findListenerAndPush($listeners, 'messages', $text); |
70 | 70 | $deferred->resolve($listeners); |