Passed
Pull Request — main (#52)
by Sílvio
03:18
created
src/Helpers/CacheRedisHelper.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -13,29 +13,29 @@  discard block
 block discarded – undo
13 13
 class CacheRedisHelper
14 14
 {
15 15
 
16
-  /**
17
-  * serializes or unserializes data based on the $serialize flag.
18
-  * 
19
-  * @param mixed $data
20
-  * @param bool  $serialize
21
-  * @return mixed
22
-  */
23
-  public static function serialize(mixed $data, bool $serialize = true): mixed
24
-  {
16
+    /**
17
+     * serializes or unserializes data based on the $serialize flag.
18
+     * 
19
+     * @param mixed $data
20
+     * @param bool  $serialize
21
+     * @return mixed
22
+     */
23
+    public static function serialize(mixed $data, bool $serialize = true): mixed
24
+    {
25 25
     if($serialize) {
26
-      return serialize($data);
26
+        return serialize($data);
27 27
     }
28 28
 
29 29
     return unserialize($data);
30 30
 
31
-  }
31
+    }
32 32
 
33 33
     /**
34
-    * Validates a cache item.
35
-    *  
36
-    * @param array $item
37
-    * @return void
38
-    */
34
+     * Validates a cache item.
35
+     *  
36
+     * @param array $item
37
+     * @return void
38
+     */
39 39
     public static function validateCacheItem(array $item): void
40 40
     {
41 41
         CacheerHelper::validateCacheItem(
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
         return CacheerHelper::mergeCacheData($cacheData);
56 56
     }
57 57
 
58
-  /**
59
-  * Generates an array identifier for cache data.
60
-  * 
61
-  * @param mixed $currentCacheData
62
-  * @param mixed $cacheData
63
-  * @return array
64
-  */
65
-  public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData): array
66
-  {
67
-      return CacheerHelper::arrayIdentifier($currentCacheData, $cacheData);
68
-  }
58
+    /**
59
+     * Generates an array identifier for cache data.
60
+     * 
61
+     * @param mixed $currentCacheData
62
+     * @param mixed $cacheData
63
+     * @return array
64
+     */
65
+    public static function arrayIdentifier(mixed $currentCacheData, mixed $cacheData): array
66
+    {
67
+        return CacheerHelper::arrayIdentifier($currentCacheData, $cacheData);
68
+    }
69 69
 
70 70
 }
71 71
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
   */
23 23
   public static function serialize(mixed $data, bool $serialize = true): mixed
24 24
   {
25
-    if($serialize) {
25
+    if ($serialize) {
26 26
       return serialize($data);
27 27
     }
28 28
 
Please login to merge, or discard this patch.
src/Service/CacheMutator.php 2 patches
Indentation   +52 added lines, -52 removed lines patch added patch discarded remove patch
@@ -13,29 +13,29 @@  discard block
 block discarded – undo
13 13
 class CacheMutator
14 14
 {
15 15
     /**
16
-    * @var Cacheer
17
-    */
16
+     * @var Cacheer
17
+     */
18 18
     private Cacheer $cacheer;
19 19
 
20 20
     /**
21
-    * CacheMutator constructor.
22
-    *
23
-    * @param Cacheer $cacheer
24
-    */
21
+     * CacheMutator constructor.
22
+     *
23
+     * @param Cacheer $cacheer
24
+     */
25 25
     public function __construct(Cacheer $cacheer)
26 26
     {
27 27
         $this->cacheer = $cacheer;
28 28
     }
29 29
 
30 30
     /**
31
-    * Adds a cache item if it does not already exist.
32
-    *
33
-    * @param string $cacheKey
34
-    * @param mixed $cacheData
35
-    * @param string $namespace
36
-    * @param int|string $ttl
37
-    * @return bool
38
-    */
31
+     * Adds a cache item if it does not already exist.
32
+     *
33
+     * @param string $cacheKey
34
+     * @param mixed $cacheData
35
+     * @param string $namespace
36
+     * @param int|string $ttl
37
+     * @return bool
38
+     */
39 39
     public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600): bool
40 40
     {
41 41
         if (!empty($this->cacheer->getCache($cacheKey, $namespace))) {
@@ -49,13 +49,13 @@  discard block
 block discarded – undo
49 49
     }
50 50
 
51 51
     /**
52
-    * Appends data to an existing cache item.
53
-    *
54
-    * @param string $cacheKey
55
-    * @param mixed $cacheData
56
-    * @param string $namespace
57
-    * @return bool
58
-    */
52
+     * Appends data to an existing cache item.
53
+     *
54
+     * @param string $cacheKey
55
+     * @param mixed $cacheData
56
+     * @param string $namespace
57
+     * @return bool
58
+     */
59 59
     public function appendCache(string $cacheKey, mixed $cacheData, string $namespace = ''): bool
60 60
     {
61 61
         $this->cacheer->cacheStore->appendCache($cacheKey, $cacheData, $namespace);
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
     }
66 66
 
67 67
     /**
68
-    * Clears a specific cache item.
69
-    *
70
-    * @param string $cacheKey
71
-    * @param string $namespace
72
-    * @return bool
73
-    */
68
+     * Clears a specific cache item.
69
+     *
70
+     * @param string $cacheKey
71
+     * @param string $namespace
72
+     * @return bool
73
+     */
74 74
     public function clearCache(string $cacheKey, string $namespace = ''): bool
75 75
     {
76 76
         $this->cacheer->cacheStore->clearCache($cacheKey, $namespace);
@@ -80,13 +80,13 @@  discard block
 block discarded – undo
80 80
     }
81 81
 
82 82
     /**
83
-    * Decrements a numeric cache item by a specified amount.
84
-    *
85
-    * @param string $cacheKey
86
-    * @param int $amount
87
-    * @param string $namespace
88
-    * @return bool
89
-    */
83
+     * Decrements a numeric cache item by a specified amount.
84
+     *
85
+     * @param string $cacheKey
86
+     * @param int $amount
87
+     * @param string $namespace
88
+     * @return bool
89
+     */
90 90
     public function decrement(string $cacheKey, int $amount = 1, string $namespace = ''): bool
91 91
     {
92 92
         return $this->increment($cacheKey, ($amount * -1), $namespace);
@@ -108,10 +108,10 @@  discard block
 block discarded – undo
108 108
     }
109 109
 
110 110
     /**
111
-    * Flushes the entire cache.
112
-    *
113
-    * @return bool
114
-    */
111
+     * Flushes the entire cache.
112
+     *
113
+     * @return bool
114
+     */
115 115
     public function flushCache(): bool
116 116
     {
117 117
         $this->cacheer->cacheStore->flushCache();
@@ -160,13 +160,13 @@  discard block
 block discarded – undo
160 160
     }
161 161
 
162 162
     /**
163
-    * Puts multiple cache items in a batch.
164
-    *
165
-    * @param array $items
166
-    * @param string $namespace
167
-    * @param int $batchSize
168
-    * @return bool
169
-    */
163
+     * Puts multiple cache items in a batch.
164
+     *
165
+     * @param array $items
166
+     * @param string $namespace
167
+     * @param int $batchSize
168
+     * @return bool
169
+     */
170 170
     public function putMany(array $items, string $namespace = '', int $batchSize = 100): bool
171 171
     {
172 172
         $this->cacheer->cacheStore->putMany($items, $namespace, $batchSize);
@@ -176,13 +176,13 @@  discard block
 block discarded – undo
176 176
     }
177 177
 
178 178
     /**
179
-    * Renews the cache item with a new TTL.
180
-    *
181
-    * @param string $cacheKey
182
-    * @param int|string $ttl
183
-    * @param string $namespace
184
-    * @return bool
185
-    */
179
+     * Renews the cache item with a new TTL.
180
+     *
181
+     * @param string $cacheKey
182
+     * @param int|string $ttl
183
+     * @param string $namespace
184
+     * @return bool
185
+     */
186 186
     public function renewCache(string $cacheKey, int|string $ttl = 3600, string $namespace = ''): bool
187 187
     {
188 188
         $this->cacheer->cacheStore->renewCache($cacheKey, $ttl, $namespace);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     * @param int|string $ttl
37 37
     * @return bool
38 38
     */
39
-    public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600): bool
39
+    public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600): bool
40 40
     {
41 41
         if (!empty($this->cacheer->getCache($cacheKey, $namespace))) {
42 42
             return true;
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      * @param int|string $ttl
151 151
      * @return bool
152 152
      */
153
-    public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600): bool
153
+    public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600): bool
154 154
     {
155 155
         $data = CacheerHelper::prepareForStorage($cacheData, $this->cacheer->isCompressionEnabled(), $this->cacheer->getEncryptionKey());
156 156
         $this->cacheer->cacheStore->putCache($cacheKey, $data, $namespace, $ttl);
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     * @param string $namespace
184 184
     * @return bool
185 185
     */
186
-    public function renewCache(string $cacheKey, int|string $ttl = 3600, string $namespace = ''): bool
186
+    public function renewCache(string $cacheKey, int | string $ttl = 3600, string $namespace = ''): bool
187 187
     {
188 188
         $this->cacheer->cacheStore->renewCache($cacheKey, $ttl, $namespace);
189 189
         $this->cacheer->syncState();
Please login to merge, or discard this patch.
src/Cacheer.php 2 patches
Indentation   +174 added lines, -174 removed lines patch added patch discarded remove patch
@@ -23,56 +23,56 @@  discard block
 block discarded – undo
23 23
 final class Cacheer implements CacheerInterface
24 24
 {
25 25
     /**
26
-    * @var string
27
-    */
26
+     * @var string
27
+     */
28 28
     private string $message;
29 29
 
30 30
     /**
31
-    * @var boolean
32
-    */
31
+     * @var boolean
32
+     */
33 33
     private bool $success;
34 34
 
35 35
     /**
36
-    * @var boolean
37
-    */
36
+     * @var boolean
37
+     */
38 38
     private bool $formatted = false;
39 39
 
40 40
     /**
41
-    * @var bool
42
-    */
41
+     * @var bool
42
+     */
43 43
     private bool $compression = false;
44 44
 
45 45
     /**
46
-    * @var string|null
47
-    */
46
+     * @var string|null
47
+     */
48 48
     private ?string $encryptionKey = null;
49 49
 
50 50
     /**
51
-    * @var FileCacheStore|DatabaseCacheStore|RedisCacheStore|ArrayCacheStore
52
-    */
51
+     * @var FileCacheStore|DatabaseCacheStore|RedisCacheStore|ArrayCacheStore
52
+     */
53 53
     public RedisCacheStore|DatabaseCacheStore|ArrayCacheStore|FileCacheStore $cacheStore;
54 54
 
55 55
     /**
56
-    * @var array
57
-    */
56
+     * @var array
57
+     */
58 58
     public array $options = [];
59 59
 
60 60
     /**
61
-    * @var CacheRetriever
62
-    */
61
+     * @var CacheRetriever
62
+     */
63 63
     private CacheRetriever $retriever;
64 64
 
65 65
     /**
66
-    * @var CacheMutator
67
-    */
66
+     * @var CacheMutator
67
+     */
68 68
     private CacheMutator $mutator;
69 69
 
70 70
 /**
71
-    * Cacheer constructor.
72
-    *
73
-    * @param array $options
74
-    * @param bool  $formatted
75
-    * @throws RuntimeException|Exceptions\CacheFileException
71
+ * Cacheer constructor.
72
+ *
73
+ * @param array $options
74
+ * @param bool  $formatted
75
+ * @throws RuntimeException|Exceptions\CacheFileException
76 76
  */
77 77
     public function __construct(array $options = [], bool $formatted = false)
78 78
     {
@@ -84,122 +84,122 @@  discard block
 block discarded – undo
84 84
     }
85 85
 
86 86
     /**
87
-    * Adds data to the cache if it does not already exist.
88
-    *
89
-    * @param string $cacheKey
90
-    * @param mixed  $cacheData
91
-    * @param string $namespace
92
-    * @param int|string $ttl
93
-    * @return bool
94
-    */
87
+     * Adds data to the cache if it does not already exist.
88
+     *
89
+     * @param string $cacheKey
90
+     * @param mixed  $cacheData
91
+     * @param string $namespace
92
+     * @param int|string $ttl
93
+     * @return bool
94
+     */
95 95
     public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600): bool
96 96
     {
97 97
         return $this->mutator->add($cacheKey, $cacheData, $namespace, $ttl);
98 98
     }
99 99
 
100 100
     /**
101
-    * Appends data to an existing cache item.
102
-    * 
103
-    * @param string $cacheKey
104
-    * @param mixed  $cacheData
105
-    * @param string $namespace
106
-    * @return bool
107
-    */
101
+     * Appends data to an existing cache item.
102
+     * 
103
+     * @param string $cacheKey
104
+     * @param mixed  $cacheData
105
+     * @param string $namespace
106
+     * @return bool
107
+     */
108 108
     public function appendCache(string $cacheKey, mixed $cacheData, string $namespace = ''): bool
109 109
     {
110 110
         return $this->mutator->appendCache($cacheKey, $cacheData, $namespace);
111 111
     }
112 112
 
113 113
     /**
114
-    * Clears a specific cache item.
115
-    * 
116
-    * @param string $cacheKey
117
-    * @param string $namespace
118
-    * @return bool
119
-    */
114
+     * Clears a specific cache item.
115
+     * 
116
+     * @param string $cacheKey
117
+     * @param string $namespace
118
+     * @return bool
119
+     */
120 120
     public function clearCache(string $cacheKey, string $namespace = ''): bool
121 121
     {
122 122
         return $this->mutator->clearCache($cacheKey, $namespace);
123 123
     }
124 124
 
125 125
     /**
126
-    * Decrements a cache item by a specified amount.
127
-    *  
128
-    * @param string $cacheKey
129
-    * @param int $amount
130
-    * @param string $namespace
131
-    * @return bool
132
-    */
126
+     * Decrements a cache item by a specified amount.
127
+     *  
128
+     * @param string $cacheKey
129
+     * @param int $amount
130
+     * @param string $namespace
131
+     * @return bool
132
+     */
133 133
     public function decrement(string $cacheKey, int $amount = 1, string $namespace = ''): bool
134 134
     {
135 135
         return $this->mutator->decrement($cacheKey, $amount, $namespace);
136 136
     }
137 137
 
138 138
     /**
139
-    * Store data in the cache permanently.
140
-    *
141
-    * @param string $cacheKey
142
-    * @param mixed $cacheData
143
-    * @return bool
144
-    */
139
+     * Store data in the cache permanently.
140
+     *
141
+     * @param string $cacheKey
142
+     * @param mixed $cacheData
143
+     * @return bool
144
+     */
145 145
     public function forever(string $cacheKey, mixed $cacheData): bool
146 146
     {
147 147
         return $this->mutator->forever($cacheKey, $cacheData);
148 148
     }
149 149
 
150 150
     /**
151
-    * Flushes all cache items.
152
-    *
153
-    * @return bool
154
-    */
151
+     * Flushes all cache items.
152
+     *
153
+     * @return bool
154
+     */
155 155
     public function flushCache(): bool
156 156
     {
157 157
         return $this->mutator->flushCache();
158 158
     }
159 159
 
160 160
     /**
161
-    * Retrieves a cache item and deletes it from the cache.
162
-    * 
163
-    * @param string $cacheKey
164
-    * @param string $namespace
165
-    * @return mixed
166
-    */
161
+     * Retrieves a cache item and deletes it from the cache.
162
+     * 
163
+     * @param string $cacheKey
164
+     * @param string $namespace
165
+     * @return mixed
166
+     */
167 167
     public function getAndForget(string $cacheKey, string $namespace = ''): mixed
168 168
     {
169 169
         return $this->retriever->getAndForget($cacheKey, $namespace);
170 170
     }
171 171
 
172 172
     /**
173
-    * Gets all items in a specific namespace.
174
-    * 
175
-    * @param string $namespace
176
-    * @return CacheDataFormatter|mixed
177
-    */
173
+     * Gets all items in a specific namespace.
174
+     * 
175
+     * @param string $namespace
176
+     * @return CacheDataFormatter|mixed
177
+     */
178 178
     public function getAll(string $namespace = ''): mixed
179 179
     {
180 180
         return $this->retriever->getAll($namespace);
181 181
     }
182 182
 
183 183
     /**
184
-    * Retrieves a single cache item.
185
-    * 
186
-    * @param string $cacheKey
187
-    * @param string $namespace
188
-    * @param string|int $ttl
189
-    * @return CacheDataFormatter|mixed
190
-    */
184
+     * Retrieves a single cache item.
185
+     * 
186
+     * @param string $cacheKey
187
+     * @param string $namespace
188
+     * @param string|int $ttl
189
+     * @return CacheDataFormatter|mixed
190
+     */
191 191
     public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600): mixed
192 192
     {
193 193
         return $this->retriever->getCache($cacheKey, $namespace, $ttl);
194 194
     }
195 195
 
196 196
     /**
197
-    * Retrieves multiple cache items by their keys.
198
-    * 
199
-    * @param array $cacheKeys
200
-    * @param string $namespace
201
-    * @param string|int $ttl
202
-    * @return CacheDataFormatter|array
197
+     * Retrieves multiple cache items by their keys.
198
+     * 
199
+     * @param array $cacheKeys
200
+     * @param string $namespace
201
+     * @param string|int $ttl
202
+     * @return CacheDataFormatter|array
203 203
      */
204 204
     public function getMany(array $cacheKeys, string $namespace = '', string|int $ttl = 3600): CacheDataFormatter|array
205 205
     {
@@ -207,132 +207,132 @@  discard block
 block discarded – undo
207 207
     }
208 208
 
209 209
     /**
210
-    * Checks if a cache item exists.
211
-    *
212
-    * @param string $cacheKey
213
-    * @param string $namespace
214
-    * @return bool
215
-    */
210
+     * Checks if a cache item exists.
211
+     *
212
+     * @param string $cacheKey
213
+     * @param string $namespace
214
+     * @return bool
215
+     */
216 216
     public function has(string $cacheKey, string $namespace = ''): bool
217 217
     {
218 218
         return $this->retriever->has($cacheKey, $namespace);
219 219
     }
220 220
 
221 221
     /**
222
-    * Increments a cache item by a specified amount.
223
-    * 
224
-    * @param string $cacheKey
225
-    * @param int $amount
226
-    * @param string $namespace
227
-    * @return bool
228
-    */
222
+     * Increments a cache item by a specified amount.
223
+     * 
224
+     * @param string $cacheKey
225
+     * @param int $amount
226
+     * @param string $namespace
227
+     * @return bool
228
+     */
229 229
     public function increment(string $cacheKey, int $amount = 1, string $namespace = ''): bool
230 230
     {
231 231
         return $this->mutator->increment($cacheKey, $amount, $namespace);
232 232
     }
233 233
 
234 234
     /**
235
-    * Checks if the last operation was successful.
236
-    * 
237
-    * @return bool
238
-    */
235
+     * Checks if the last operation was successful.
236
+     * 
237
+     * @return bool
238
+     */
239 239
     public function isSuccess(): bool
240 240
     {
241 241
         return $this->success;
242 242
     }
243 243
 
244 244
     /**
245
-    * Stores an item in the cache with a specific TTL.
246
-    * 
247
-    * @param string $cacheKey
248
-    * @param mixed  $cacheData
249
-    * @param string $namespace
250
-    * @param string|int $ttl
251
-    * @return bool
252
-    */
245
+     * Stores an item in the cache with a specific TTL.
246
+     * 
247
+     * @param string $cacheKey
248
+     * @param mixed  $cacheData
249
+     * @param string $namespace
250
+     * @param string|int $ttl
251
+     * @return bool
252
+     */
253 253
     public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string|int $ttl = 3600): bool
254 254
     {
255 255
         return $this->mutator->putCache($cacheKey, $cacheData, $namespace, $ttl);
256 256
     }
257 257
 
258 258
     /**
259
-    * Stores multiple items in the cache.
260
-    *  
261
-    * @param array   $items
262
-    * @param string  $namespace
263
-    * @param integer $batchSize
264
-    * @return bool
265
-    */
259
+     * Stores multiple items in the cache.
260
+     *  
261
+     * @param array   $items
262
+     * @param string  $namespace
263
+     * @param integer $batchSize
264
+     * @return bool
265
+     */
266 266
     public function putMany(array $items, string $namespace = '', int $batchSize = 100): bool
267 267
     {
268 268
         return $this->mutator->putMany($items, $namespace, $batchSize);
269 269
     }
270 270
 
271 271
     /**
272
-    * Renews the cache for a specific key with a new TTL.
273
-    * 
274
-    * @param string $cacheKey
275
-    * @param string|int $ttl
276
-    * @param string $namespace
277
-    * @return bool
278
-    */
272
+     * Renews the cache for a specific key with a new TTL.
273
+     * 
274
+     * @param string $cacheKey
275
+     * @param string|int $ttl
276
+     * @param string $namespace
277
+     * @return bool
278
+     */
279 279
     public function renewCache(string $cacheKey, string|int $ttl = 3600, string $namespace = ''): bool
280 280
     {
281 281
         return $this->mutator->renewCache($cacheKey, $ttl, $namespace);
282 282
     }
283 283
 
284 284
     /**
285
-    * Retrieves a cache item or executes a callback to store it if not found.
286
-    * 
287
-    * @param string $cacheKey
288
-    * @param int|string $ttl
289
-    * @param Closure $callback
290
-    * @return mixed
291
-    */
285
+     * Retrieves a cache item or executes a callback to store it if not found.
286
+     * 
287
+     * @param string $cacheKey
288
+     * @param int|string $ttl
289
+     * @param Closure $callback
290
+     * @return mixed
291
+     */
292 292
     public function remember(string $cacheKey, int|string $ttl, Closure $callback): mixed
293 293
     {
294 294
         return $this->retriever->remember($cacheKey, $ttl, $callback);
295 295
     }
296 296
 
297 297
     /**
298
-    * Retrieves a cache item or executes a callback to store it permanently if not found.
299
-    * 
300
-    * @param string $cacheKey
301
-    * @param Closure $callback
302
-    * @return mixed
303
-    */
298
+     * Retrieves a cache item or executes a callback to store it permanently if not found.
299
+     * 
300
+     * @param string $cacheKey
301
+     * @param Closure $callback
302
+     * @return mixed
303
+     */
304 304
     public function rememberForever(string $cacheKey, Closure $callback): mixed
305 305
     {
306 306
         return $this->retriever->rememberForever($cacheKey, $callback);
307 307
     }
308 308
 
309 309
     /**
310
-    * Returns a CacheConfig instance for configuration management.
311
-    * 
312
-    * @return CacheConfig
313
-    */
310
+     * Returns a CacheConfig instance for configuration management.
311
+     * 
312
+     * @return CacheConfig
313
+     */
314 314
     public function setConfig(): CacheConfig
315 315
     {
316 316
         return new CacheConfig($this);
317 317
     }
318 318
 
319 319
     /**
320
-    * Sets the cache driver based on the configuration.
321
-    * 
322
-    * @return CacheDriver
323
-    */
320
+     * Sets the cache driver based on the configuration.
321
+     * 
322
+     * @return CacheDriver
323
+     */
324 324
     public function setDriver(): CacheDriver
325 325
     {
326 326
         return new CacheDriver($this);
327 327
     }
328 328
 
329 329
     /**
330
-    * Sets a message for the cache operation.
331
-    *
332
-    * @param string  $message
333
-    * @param boolean $success
334
-    * @return void
335
-    */
330
+     * Sets a message for the cache operation.
331
+     *
332
+     * @param string  $message
333
+     * @param boolean $success
334
+     * @return void
335
+     */
336 336
     private function setMessage(string $message, bool $success): void
337 337
     {
338 338
         $this->message = $message;
@@ -340,10 +340,10 @@  discard block
 block discarded – undo
340 340
     }
341 341
 
342 342
     /**
343
-    * Retrieves the message from the last operation.
344
-    * 
345
-    * @return string
346
-    */
343
+     * Retrieves the message from the last operation.
344
+     * 
345
+     * @return string
346
+     */
347 347
     public function getMessage(): string
348 348
     {
349 349
         return $this->message;
@@ -392,32 +392,32 @@  discard block
 block discarded – undo
392 392
     }
393 393
 
394 394
     /**
395
-    * Enables or disables the formatter for cache data.
396
-    * 
397
-    * @return void
398
-    */
395
+     * Enables or disables the formatter for cache data.
396
+     * 
397
+     * @return void
398
+     */
399 399
     public function useFormatter(): void
400 400
     {
401 401
         $this->formatted = !$this->formatted;
402 402
     }
403 403
 
404 404
     /**
405
-    * Validates the options provided for the Cacheer instance.
406
-    * 
407
-    * @param array $options
408
-    * @return void
409
-    */
405
+     * Validates the options provided for the Cacheer instance.
406
+     * 
407
+     * @param array $options
408
+     * @return void
409
+     */
410 410
     private function validateOptions(array $options): void
411 411
     {
412 412
         $this->options = $options;
413 413
     }
414 414
 
415 415
     /**
416
-    * Enable or disable data compression
417
-    *
418
-    * @param bool $status
419
-    * @return $this
420
-    */
416
+     * Enable or disable data compression
417
+     *
418
+     * @param bool $status
419
+     * @return $this
420
+     */
421 421
     public function useCompression(bool $status = true): Cacheer
422 422
     {
423 423
         $this->compression = $status;
@@ -425,11 +425,11 @@  discard block
 block discarded – undo
425 425
     }
426 426
 
427 427
     /**
428
-    * Enable encryption for cached data
429
-    *
430
-    * @param string $key
431
-    * @return $this
432
-    */
428
+     * Enable encryption for cached data
429
+     *
430
+     * @param string $key
431
+     * @return $this
432
+     */
433 433
     public function useEncryption(string $key): Cacheer
434 434
     {
435 435
         $this->encryptionKey = $key;
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     /**
51 51
     * @var FileCacheStore|DatabaseCacheStore|RedisCacheStore|ArrayCacheStore
52 52
     */
53
-    public RedisCacheStore|DatabaseCacheStore|ArrayCacheStore|FileCacheStore $cacheStore;
53
+    public RedisCacheStore | DatabaseCacheStore | ArrayCacheStore | FileCacheStore $cacheStore;
54 54
 
55 55
     /**
56 56
     * @var array
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     * @param int|string $ttl
93 93
     * @return bool
94 94
     */
95
-    public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int|string $ttl = 3600): bool
95
+    public function add(string $cacheKey, mixed $cacheData, string $namespace = '', int | string $ttl = 3600): bool
96 96
     {
97 97
         return $this->mutator->add($cacheKey, $cacheData, $namespace, $ttl);
98 98
     }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
     * @param string|int $ttl
189 189
     * @return CacheDataFormatter|mixed
190 190
     */
191
-    public function getCache(string $cacheKey, string $namespace = '', string|int $ttl = 3600): mixed
191
+    public function getCache(string $cacheKey, string $namespace = '', string | int $ttl = 3600): mixed
192 192
     {
193 193
         return $this->retriever->getCache($cacheKey, $namespace, $ttl);
194 194
     }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     * @param string|int $ttl
202 202
     * @return CacheDataFormatter|array
203 203
      */
204
-    public function getMany(array $cacheKeys, string $namespace = '', string|int $ttl = 3600): CacheDataFormatter|array
204
+    public function getMany(array $cacheKeys, string $namespace = '', string | int $ttl = 3600): CacheDataFormatter | array
205 205
     {
206 206
         return $this->retriever->getMany($cacheKeys, $namespace, $ttl);
207 207
     }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
     * @param string|int $ttl
251 251
     * @return bool
252 252
     */
253
-    public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string|int $ttl = 3600): bool
253
+    public function putCache(string $cacheKey, mixed $cacheData, string $namespace = '', string | int $ttl = 3600): bool
254 254
     {
255 255
         return $this->mutator->putCache($cacheKey, $cacheData, $namespace, $ttl);
256 256
     }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
     * @param string $namespace
277 277
     * @return bool
278 278
     */
279
-    public function renewCache(string $cacheKey, string|int $ttl = 3600, string $namespace = ''): bool
279
+    public function renewCache(string $cacheKey, string | int $ttl = 3600, string $namespace = ''): bool
280 280
     {
281 281
         return $this->mutator->renewCache($cacheKey, $ttl, $namespace);
282 282
     }
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
     * @param Closure $callback
290 290
     * @return mixed
291 291
     */
292
-    public function remember(string $cacheKey, int|string $ttl, Closure $callback): mixed
292
+    public function remember(string $cacheKey, int | string $ttl, Closure $callback): mixed
293 293
     {
294 294
         return $this->retriever->remember($cacheKey, $ttl, $callback);
295 295
     }
Please login to merge, or discard this patch.