@@ -233,14 +233,14 @@ discard block |
||
| 233 | 233 | */ |
| 234 | 234 | public function deleteCacheItem(string $cacheKey, $key) |
| 235 | 235 | { |
| 236 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($cacheKey, $key) { |
|
| 236 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($cacheKey, $key) { |
|
| 237 | 237 | if (!$arrayData) { |
| 238 | 238 | return true; //there isn't anything so it's deleted |
| 239 | 239 | } else { |
| 240 | 240 | unset($arrayData[$key]); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - return $this->cache->set($cacheKey, $arrayData)->then(function ($result) { |
|
| 243 | + return $this->cache->set($cacheKey, $arrayData)->then(function($result) { |
|
| 244 | 244 | if ($result !== true) { |
| 245 | 245 | $this->logger->errorWriteCache(); |
| 246 | 246 | } |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function deleteCache(array $keys) |
| 258 | 258 | { |
| 259 | - return $this->cache->deleteMultiple($keys)->then(function ($result) { |
|
| 259 | + return $this->cache->deleteMultiple($keys)->then(function($result) { |
|
| 260 | 260 | if ($result !== true) { |
| 261 | 261 | $this->logger->errorClearCache(); |
| 262 | 262 | } |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public function getCacheItem(string $cacheKey, $key) |
| 274 | 274 | { |
| 275 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($key) { |
|
| 275 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($key) { |
|
| 276 | 276 | if ($arrayData && array_key_exists($key, $arrayData)) { |
| 277 | 277 | return $arrayData[$key]; |
| 278 | 278 | } else { |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | public function doSet(string $cacheKey, string $key, $data, $ttl = false) |
| 321 | 321 | { |
| 322 | 322 | $ttl = $this->checkTtl($ttl); |
| 323 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($ttl, $key, $data, $cacheKey) { |
|
| 323 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($ttl, $key, $data, $cacheKey) { |
|
| 324 | 324 | if (!$arrayData) { |
| 325 | 325 | $arrayData = array(); |
| 326 | 326 | $arrayData[$key] = $data; |
@@ -328,7 +328,7 @@ discard block |
||
| 328 | 328 | $arrayData[$key] = $data; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - return $this->cache->set($cacheKey, $arrayData, $ttl)->then(function ($result) { |
|
| 331 | + return $this->cache->set($cacheKey, $arrayData, $ttl)->then(function($result) { |
|
| 332 | 332 | if ($result !== true) { |
| 333 | 333 | $this->logger->errorWriteCache(); |
| 334 | 334 | } |
@@ -350,10 +350,10 @@ discard block |
||
| 350 | 350 | { |
| 351 | 351 | |
| 352 | 352 | $ttl = $this->checkTtl($ttl); |
| 353 | - return $this->cache->get($cacheKey)->then(function ($arrayData) use ($ttl, $key, $data, $cacheKey) { |
|
| 353 | + return $this->cache->get($cacheKey)->then(function($arrayData) use ($ttl, $key, $data, $cacheKey) { |
|
| 354 | 354 | $arrayData[$key][] = $data; |
| 355 | 355 | |
| 356 | - return $this->cache->set($cacheKey, $arrayData, $ttl)->then(function ($result) { |
|
| 356 | + return $this->cache->set($cacheKey, $arrayData, $ttl)->then(function($result) { |
|
| 357 | 357 | if ($result !== true) { |
| 358 | 358 | $this->logger->errorWriteCache(); |
| 359 | 359 | } |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | */ |
| 372 | 372 | public function callHandlerByChatId(int $chatId, $update, $container) |
| 373 | 373 | { |
| 374 | - return $this->cache->get($this->getConversationKey($chatId))->then(function ($conversation) use ($update, $container) { |
|
| 374 | + return $this->cache->get($this->getConversationKey($chatId))->then(function($conversation) use ($update, $container) { |
|
| 375 | 375 | if (!empty($conversation["state"])) { |
| 376 | 376 | $handler = $conversation["state"]; |
| 377 | 377 | $handler = unserialize($handler); |
@@ -380,9 +380,9 @@ discard block |
||
| 380 | 380 | } |
| 381 | 381 | call_user_func($handler, new Context($update, $container)); |
| 382 | 382 | } |
| 383 | - }, function ($err) use ($update) { |
|
| 383 | + }, function($err) use ($update) { |
|
| 384 | 384 | $this->logger->errorUpdate($update, $err); |
| 385 | - })->/** @scrutinizer ignore-call */ otherwise(function ($err) use ($update, $chatId) { |
|
| 385 | + })->/** @scrutinizer ignore-call */ otherwise(function($err) use ($update, $chatId) { |
|
| 386 | 386 | $this->logger->errorUpdate($err, $update); |
| 387 | 387 | $this->deleteConversationCache($chatId); |
| 388 | 388 | }); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | { |
| 202 | 202 | // merge values with "|" (eg. "accept|refuse|later"), then ListenerResolver will check the callback data |
| 203 | 203 | // against that regex. |
| 204 | - $id = '/'.implode('|', $data).'/'; |
|
| 204 | + $id = '/' . implode('|', $data) . '/'; |
|
| 205 | 205 | $listener = new Listener($callback, $this->container, $id); |
| 206 | 206 | $this->listeners['cb_query_data'][$id] = $listener; |
| 207 | 207 | return $listener; |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | */ |
| 458 | 458 | protected function feedMiddlewareStack() |
| 459 | 459 | { |
| 460 | - array_walk_recursive($this->listeners, function ($value) { |
|
| 460 | + array_walk_recursive($this->listeners, function($value) { |
|
| 461 | 461 | if ($value instanceof Listener) { |
| 462 | 462 | foreach ($this->middleware as $m) { |
| 463 | 463 | $value->middleware($m); |