@@ -16,12 +16,12 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | // Merge package configuration |
| 18 | 18 | $this->mergeConfigFrom( |
| 19 | - __DIR__ . '/../../config/super_cache_invalidate.php', |
|
| 19 | + __DIR__.'/../../config/super_cache_invalidate.php', |
|
| 20 | 20 | 'super_cache_invalidate' |
| 21 | 21 | ); |
| 22 | 22 | |
| 23 | 23 | // Register the helper as a singleton |
| 24 | - $this->app->singleton('supercache.invalidation', function () { |
|
| 24 | + $this->app->singleton('supercache.invalidation', function() { |
|
| 25 | 25 | return new SuperCacheInvalidationHelper(); |
| 26 | 26 | }); |
| 27 | 27 | } |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | // Publish configuration |
| 35 | 35 | $this->publishes([ |
| 36 | - __DIR__ . '/../../config/super_cache_invalidate.php' => config_path('super_cache_invalidate.php'), |
|
| 36 | + __DIR__.'/../../config/super_cache_invalidate.php' => config_path('super_cache_invalidate.php'), |
|
| 37 | 37 | ], 'config'); |
| 38 | 38 | |
| 39 | 39 | // Publish migrations |
| 40 | - $this->loadMigrationsFrom(__DIR__ . '/../../database/migrations'); |
|
| 40 | + $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); |
|
| 41 | 41 | |
| 42 | 42 | // Register commands |
| 43 | 43 | if ($this->app->runningInConsole()) { |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // Group events by type and identifier |
| 77 | - $eventsByIdentifier = $events->groupBy(function ($event) { |
|
| 78 | - return $event->type . ':' . $event->identifier; |
|
| 77 | + $eventsByIdentifier = $events->groupBy(function($event) { |
|
| 78 | + return $event->type.':'.$event->identifier; |
|
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | 81 | $batchIdentifiers = []; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | foreach ($eventsGroup as $event) { |
| 101 | 101 | $eventAssociations = $associations->get($event->id, collect()); |
| 102 | 102 | foreach ($eventAssociations as $assoc) { |
| 103 | - $assocKey = $assoc->associated_type . ':' . $assoc->associated_identifier; |
|
| 103 | + $assocKey = $assoc->associated_type.':'.$assoc->associated_identifier; |
|
| 104 | 104 | $allIdentifiers[] = $assocKey; |
| 105 | 105 | } |
| 106 | 106 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | foreach ($eventsGroup as $event) { |
| 119 | 119 | $eventAssociations = $associations->get($event->id, collect()); |
| 120 | 120 | foreach ($eventAssociations as $assoc) { |
| 121 | - $assocKey = $assoc->associated_type . ':' . $assoc->associated_identifier; |
|
| 121 | + $assocKey = $assoc->associated_type.':'.$assoc->associated_identifier; |
|
| 122 | 122 | $associatedIdentifiers[$assocKey] = [ |
| 123 | 123 | 'type' => $assoc->associated_type, |
| 124 | 124 | 'identifier' => $assoc->associated_identifier, |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | protected function getLastInvalidationTimes(array $identifiers): array |
| 193 | 193 | { |
| 194 | 194 | // Extract types and identifiers into tuples |
| 195 | - $tuples = array_map(static function ($key) { |
|
| 195 | + $tuples = array_map(static function($key) { |
|
| 196 | 196 | return explode(':', $key, 2); |
| 197 | 197 | }, $identifiers); |
| 198 | 198 | |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | // Build associative array |
| 206 | 206 | $lastInvalidationTimes = []; |
| 207 | 207 | foreach ($records as $record) { |
| 208 | - $key = $record->identifier_type . ':' . $record->identifier; |
|
| 208 | + $key = $record->identifier_type.':'.$record->identifier; |
|
| 209 | 209 | $lastInvalidationTimes[$key] = Carbon::parse($record->last_invalidated); |
| 210 | 210 | } |
| 211 | 211 | |
@@ -398,9 +398,9 @@ discard block |
||
| 398 | 398 | $shardId = (int) $this->option('shard'); |
| 399 | 399 | $priority = (int) $this->option('priority'); |
| 400 | 400 | $limit = $this->option('limit') ?? config('super_cache_invalidate.processing_limit'); |
| 401 | - $limit = (int)$limit; |
|
| 401 | + $limit = (int) $limit; |
|
| 402 | 402 | $tagBatchSize = $this->option('tag-batch-size') ?? config('super_cache_invalidate.tag_batch_size'); |
| 403 | - $tagBatchSize = (int)$tagBatchSize; |
|
| 403 | + $tagBatchSize = (int) $tagBatchSize; |
|
| 404 | 404 | $lockTimeout = (int) config('super_cache_invalidate.lock_timeout'); |
| 405 | 405 | |
| 406 | 406 | if ($shardId === 0 && $priority === 0) { |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | try { |
| 421 | 421 | $this->processEvents($shardId, $priority, $limit, $tagBatchSize); |
| 422 | 422 | } catch (\Exception $e) { |
| 423 | - $this->error('An error occourred in ' . __METHOD__ . ': ' . $e->getTraceAsString()); |
|
| 423 | + $this->error('An error occourred in '.__METHOD__.': '.$e->getTraceAsString()); |
|
| 424 | 424 | } finally { |
| 425 | 425 | $this->helper->releaseShardLock($shardId, $lockValue); |
| 426 | 426 | } |