@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | public function next(): string |
| 203 | 203 | { |
| 204 | - $id = Cache::lock($this->getCacheKey('lock'))->get(function () { |
|
| 204 | + $id = Cache::lock($this->getCacheKey('lock'))->get(function() { |
|
| 205 | 205 | $timestamp = $this->timeGen(); |
| 206 | 206 | |
| 207 | 207 | // 如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常 |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | private function getLastTimestamp(): ?Carbon |
| 269 | 269 | { |
| 270 | - return Cache::rememberForever($this->getCacheKey('last timestamp'), function () { |
|
| 270 | + return Cache::rememberForever($this->getCacheKey('last timestamp'), function() { |
|
| 271 | 271 | return null; |
| 272 | 272 | }); |
| 273 | 273 | } |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | private function getSequence(Carbon $tts): int |
| 287 | 287 | { |
| 288 | 288 | $key = $this->getCacheKey([$tts->timestamp, $tts->millisecond]); |
| 289 | - $sequence = Cache::remember($key, 1, function () { |
|
| 289 | + $sequence = Cache::remember($key, 1, function() { |
|
| 290 | 290 | return -1; |
| 291 | 291 | }); |
| 292 | 292 | $sequence = ($sequence + 1) & $this->sequenceMask; |