@@ -201,14 +201,14 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function deleteCacheItem(string $cacheKey, $key) |
| 203 | 203 | { |
| 204 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($cacheKey, $key) { |
|
| 204 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($cacheKey, $key) { |
|
| 205 | 205 | if (!$arrayData) { |
| 206 | 206 | return true; //there isn't anything so it's deleted |
| 207 | 207 | } else { |
| 208 | 208 | unset($arrayData[$key]); |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | - return $this->cache->set($cacheKey, $arrayData)->then(function ($result) { |
|
| 211 | + return $this->cache->set($cacheKey, $arrayData)->then(function($result) { |
|
| 212 | 212 | if ($result !== true) { |
| 213 | 213 | $this->logger->errorWriteCache($result); |
| 214 | 214 | } |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | */ |
| 225 | 225 | public function deleteCache(array $keys) |
| 226 | 226 | { |
| 227 | - return $this->cache->deleteMultiple($keys)->then(function ($result) { |
|
| 227 | + return $this->cache->deleteMultiple($keys)->then(function($result) { |
|
| 228 | 228 | if ($result !== true) { |
| 229 | 229 | $this->logger->errorClearCache($result); |
| 230 | 230 | } |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public function getCacheItem(string $cacheKey, $key) |
| 242 | 242 | { |
| 243 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($key) { |
|
| 243 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($key) { |
|
| 244 | 244 | if ($arrayData && array_key_exists($key, $arrayData)) { |
| 245 | 245 | return $arrayData[$key]; |
| 246 | 246 | } else { |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public function doSet(string $cacheKey, string $key, $data) |
| 274 | 274 | { |
| 275 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($key, $data, $cacheKey) { |
|
| 275 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($key, $data, $cacheKey) { |
|
| 276 | 276 | if (!$arrayData) { |
| 277 | 277 | $arrayData = array(); |
| 278 | 278 | $arrayData[$key] = $data; |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | $arrayData[$key] = $data; |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - return $this->cache->set($cacheKey, $arrayData)->then(function ($result) { |
|
| 283 | + return $this->cache->set($cacheKey, $arrayData)->then(function($result) { |
|
| 284 | 284 | if ($result !== true) { |
| 285 | 285 | $this->logger->errorWriteCache($result); |
| 286 | 286 | } |
@@ -298,14 +298,14 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | public function callHandlerByChatId(int $chatId, $update, $container) |
| 300 | 300 | { |
| 301 | - return $this->cache->get($this->getConversationKey($chatId))->then(function (array $conversation) use ($update, $chatId, $container) { |
|
| 301 | + return $this->cache->get($this->getConversationKey($chatId))->then(function(array $conversation) use ($update, $chatId, $container) { |
|
| 302 | 302 | if (!empty($conversation)) { |
| 303 | 303 | $handler = $conversation["state"]; |
| 304 | 304 | $handler(new Context($update, $container)); |
| 305 | 305 | } |
| 306 | - }, function ($err) use ($container, $update) { |
|
| 306 | + }, function($err) use ($container, $update) { |
|
| 307 | 307 | $this->logger->errorUpdate($update, $err); |
| 308 | - })->otherwise(function ($err, $update, $chatId) { |
|
| 308 | + })->otherwise(function($err, $update, $chatId) { |
|
| 309 | 309 | $this->logger->errorUpdate($err, $update); |
| 310 | 310 | $this->deleteConversationCache($chatId); |
| 311 | 311 | }); |