Completed
Push — master ( 81e464...caa3e8 )
by herry
06:41 queued 02:51
created
src/Models/Traits/Snowflake.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 {
21 21
     protected static function boolSnowflake()
22 22
     {
23
-        static::saving(function ($model) {
23
+        static::saving(function($model) {
24 24
             if (is_null($model->getKey())) {
25 25
                 $model->setIncrementing(false);
26 26
                 $keyName = $model->getKeyName();
Please login to merge, or discard this patch.
src/Snowflake.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
      */
193 193
     public function next(): ?string
194 194
     {
195
-        return Cache::lock($this->getCacheKey('lock'))->get(function () {
195
+        return Cache::lock($this->getCacheKey('lock'))->get(function() {
196 196
             $timestamp = $this->timeGen();
197 197
 
198 198
             // 如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
      */
252 252
     private function getLastTimestamp(): ?Carbon
253 253
     {
254
-        return Cache::rememberForever($this->getCacheKey('last timestamp'), function () {
254
+        return Cache::rememberForever($this->getCacheKey('last timestamp'), function() {
255 255
             return null;
256 256
         });
257 257
     }
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     private function getSequence(Carbon $tts): int
271 271
     {
272 272
         $key = $this->getCacheKey([$tts->timestamp, $tts->millisecond]);
273
-        $sequence = Cache::remember($key, 1, function () {
273
+        $sequence = Cache::remember($key, 1, function() {
274 274
             return -1;
275 275
         });
276 276
         $sequence = ($sequence + 1) & $this->sequenceMask;
Please login to merge, or discard this patch.
src/Providers/SnowflakeServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
         $this->mergeConfigFrom(
25 25
             dirname(__DIR__) . '/../config/snowflake.php', 'snowflake'
26 26
         );
27
-        $this->app->singleton('snowflake', function ($app) {
27
+        $this->app->singleton('snowflake', function($app) {
28 28
             return new Snowflake($app->config['snowflake']);
29 29
         });
30 30
     }
Please login to merge, or discard this patch.