Passed
Push — master ( 215d58...b8b246 )
by herry
03:17
created
src/Snowflake.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
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生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
             'worker_id' => 0,
255 255
             'data_center_id' => 0,
256 256
             'timestamp' => 0
257
-        ])->map(function ($value, $key) use ($len, $snowflakeId) {
257
+        ])->map(function($value, $key) use ($len, $snowflakeId) {
258 258
             $shift = $this->getData(Str::camel($key) . 'Shift', 0);
259 259
             if ($len < $shift) {
260 260
                 throw new InvalidArgumentException(sprintf('\'%s\' is not valid snowflake id.', strval('0b' . $snowflakeId)));
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      */
287 287
     private function getLastTimestamp(): ?Carbon
288 288
     {
289
-        return Cache::rememberForever($this->getCacheKey('last timestamp'), function () {
289
+        return Cache::rememberForever($this->getCacheKey('last timestamp'), function() {
290 290
             return null;
291 291
         });
292 292
     }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     private function getSequence(Carbon $tts): int
306 306
     {
307 307
         $key = $this->getCacheKey([$tts->timestamp, $tts->millisecond]);
308
-        $sequence = Cache::remember($key, 1, function () {
308
+        $sequence = Cache::remember($key, 1, function() {
309 309
             return -1;
310 310
         });
311 311
         $sequence = ($sequence + 1) & $this->sequenceMask;
Please login to merge, or discard this patch.