@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | if ($this->paused) |
191 | 191 | { |
192 | 192 | $this->paused = false; |
193 | - $this->loopTimer = $this->getLoop()->addPeriodicTimer($this->config['interval'], [ $this, 'handleTick' ]); |
|
193 | + $this->loopTimer = $this->getLoop()->addPeriodicTimer($this->config['interval'], [$this, 'handleTick']); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | } |
282 | 282 | |
283 | 283 | $timer = round($ttl / $this->config['interval']); |
284 | - $this->timers[$key] = [ 'timeout' => $timer, 'ttl' => $ttl ]; |
|
284 | + $this->timers[$key] = ['timeout' => $timer, 'ttl' => $ttl]; |
|
285 | 285 | $this->timersCounter++; |
286 | 286 | return Promise::doResolve($ttl); |
287 | 287 | } |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | */ |
401 | 401 | protected function createConfig($config = []) |
402 | 402 | { |
403 | - return array_merge([ 'interval' => 1e-1 ], $config); |
|
403 | + return array_merge(['interval' => 1e-1], $config); |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | /** |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | protected function handleStart() |
410 | 410 | { |
411 | 411 | $this->resume(); |
412 | - $this->emit('start', [ $this ]); |
|
412 | + $this->emit('start', [$this]); |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | /** |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | } |
430 | 430 | $this->endingPromises = []; |
431 | 431 | |
432 | - $this->emit('stop', [ $this ]); |
|
432 | + $this->emit('stop', [$this]); |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | /** |
@@ -272,7 +272,8 @@ |
||
272 | 272 | { |
273 | 273 | return Promise::doReject(new WriteException('Cache object is not open.')); |
274 | 274 | } |
275 | - if ($ttl <= 0) { |
|
275 | + if ($ttl <= 0) |
|
276 | + { |
|
276 | 277 | return Promise::doReject(new WriteException('TTL needs to be higher than 0.')); |
277 | 278 | } |
278 | 279 | if (!array_key_exists($key, $this->storage)) |