@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | $this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'laracache'); |
19 | 19 | |
20 | - $this->app->bind('laracache', function () { |
|
20 | + $this->app->bind('laracache', function() { |
|
21 | 21 | return new LaraCache; |
22 | 22 | }); |
23 | 23 | } |
@@ -30,8 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | if ($model) { |
32 | 32 | $model::cache()->updateAll(); |
33 | - } |
|
34 | - else { |
|
33 | + } else { |
|
35 | 34 | $list = self::list(); |
36 | 35 | |
37 | 36 | /** @var mixed $model */ |
@@ -64,8 +63,7 @@ discard block |
||
64 | 63 | { |
65 | 64 | if ($model) { |
66 | 65 | $model::cache()->deleteAll($forever); |
67 | - } |
|
68 | - else { |
|
66 | + } else { |
|
69 | 67 | $list = self::list(); |
70 | 68 | |
71 | 69 | /** @var mixed $model */ |
@@ -78,12 +78,10 @@ |
||
78 | 78 | if (!in_array($name, $list[$this->model])) { |
79 | 79 | $list[$this->model][] = $name; |
80 | 80 | } |
81 | - } |
|
82 | - else { |
|
81 | + } else { |
|
83 | 82 | $list[$this->model] = [$name]; |
84 | 83 | } |
85 | - } |
|
86 | - else { |
|
84 | + } else { |
|
87 | 85 | $list = [ |
88 | 86 | $this->model => [$name] |
89 | 87 | ]; |
@@ -13,8 +13,7 @@ |
||
13 | 13 | foreach ($data->models as $model) { |
14 | 14 | $this->deleteAll($model); |
15 | 15 | } |
16 | - } |
|
17 | - else { |
|
16 | + } else { |
|
18 | 17 | $model = $data->models[0]; |
19 | 18 | |
20 | 19 | empty($data->entities) |
@@ -49,8 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | return $data; |
52 | - } |
|
53 | - else { |
|
52 | + } else { |
|
54 | 53 | throw CacheGroupValueIsNotValid::make($groupName); |
55 | 54 | } |
56 | 55 | } |
@@ -62,8 +61,7 @@ discard block |
||
62 | 61 | models: [$item['model']], |
63 | 62 | entities: $item['entities'] |
64 | 63 | ); |
65 | - } |
|
66 | - else { |
|
64 | + } else { |
|
67 | 65 | throw CacheGroupValueIsNotValid::make($groupName); |
68 | 66 | } |
69 | 67 | } |
@@ -13,8 +13,7 @@ |
||
13 | 13 | foreach ($data->models as $model) { |
14 | 14 | $this->updateAll($model); |
15 | 15 | } |
16 | - } |
|
17 | - else { |
|
16 | + } else { |
|
18 | 17 | $model = $data->models[0]; |
19 | 18 | |
20 | 19 | empty($data->entities) |
@@ -4,14 +4,14 @@ |
||
4 | 4 | |
5 | 5 | abstract class CacheEnum |
6 | 6 | { |
7 | - public function __construct(protected int|string $value) {} |
|
7 | + public function __construct(protected int | string $value) {} |
|
8 | 8 | |
9 | 9 | public static function __callStatic(string $name, array $arguments): self |
10 | 10 | { |
11 | 11 | return new static($name); |
12 | 12 | } |
13 | 13 | |
14 | - public function getValue(): int|string |
|
14 | + public function getValue(): int | string |
|
15 | 15 | { |
16 | 16 | return $this->value; |
17 | 17 | } |
@@ -126,7 +126,7 @@ |
||
126 | 126 | $this->queueConnection = $queue['connection'] ?? config('queue.default'); |
127 | 127 | } |
128 | 128 | else { |
129 | - $this->isQueueable = (bool)$queue; |
|
129 | + $this->isQueueable = (bool) $queue; |
|
130 | 130 | $this->queueName = 'default'; |
131 | 131 | $this->queueConnection = config('queue.default'); |
132 | 132 | } |
@@ -124,8 +124,7 @@ |
||
124 | 124 | $this->isQueueable = $queue['status'] ?? false; |
125 | 125 | $this->queueName = $queue['name'] ?? 'default'; |
126 | 126 | $this->queueConnection = $queue['connection'] ?? config('queue.default'); |
127 | - } |
|
128 | - else { |
|
127 | + } else { |
|
129 | 128 | $this->isQueueable = (bool)$queue; |
130 | 129 | $this->queueName = 'default'; |
131 | 130 | $this->queueConnection = config('queue.default'); |
@@ -65,8 +65,7 @@ |
||
65 | 65 | RefreshCache::dispatch($this->model, $entity->name, $event) |
66 | 66 | ->onConnection($entity->queueConnection) |
67 | 67 | ->onQueue($entity->queueName); |
68 | - } |
|
69 | - else { |
|
68 | + } else { |
|
70 | 69 | $this->updateCacheEntity($entity->name, $event, $entity); |
71 | 70 | } |
72 | 71 | } |