@@ -137,9 +137,8 @@ private function verify(array $meta): bool
137
137
138
138
/**
139
139
* Prevents item reading and writing. Lock is released by write() or remove().
140
- * @return void
141
140
*/
142
- public function lock (string $ key )
141
+ public function lock (string $ key ): void
143
142
{
144
143
$ cacheFile = $ this ->getCacheFile ($ key );
145
144
if ($ this ->useDirs && !is_dir ($ dir = dirname ($ cacheFile ))) {
@@ -155,9 +154,8 @@ public function lock(string $key)
155
154
156
155
/**
157
156
* Writes item into the cache.
158
- * @return void
159
157
*/
160
- public function write (string $ key , $ data , array $ dp )
158
+ public function write (string $ key , $ data , array $ dp ): void
161
159
{
162
160
$ meta = [
163
161
self ::META_TIME => microtime (),
@@ -238,9 +236,8 @@ public function write(string $key, $data, array $dp)
238
236
239
237
/**
240
238
* Removes item from the cache.
241
- * @return void
242
239
*/
243
- public function remove (string $ key )
240
+ public function remove (string $ key ): void
244
241
{
245
242
unset($ this ->locks [$ key ]);
246
243
$ this ->delete ($ this ->getCacheFile ($ key ));
@@ -249,9 +246,8 @@ public function remove(string $key)
249
246
250
247
/**
251
248
* Removes items from the cache by conditions & garbage collector.
252
- * @return void
253
249
*/
254
- public function clean (array $ conditions )
250
+ public function clean (array $ conditions ): void
255
251
{
256
252
$ all = !empty ($ conditions [Cache::ALL ]);
257
253
$ collector = empty ($ conditions );
@@ -305,9 +301,8 @@ public function clean(array $conditions)
305
301
* Reads cache data from disk.
306
302
* @param string file path
307
303
* @param int lock mode
308
- * @return array|NULL
309
304
*/
310
- protected function readMetaAndLock (string $ file , int $ lock )
305
+ protected function readMetaAndLock (string $ file , int $ lock ): ? array
311
306
{
312
307
$ handle = @fopen ($ file , 'r+b ' ); // @ - file may not exist
313
308
if (!$ handle ) {
@@ -366,9 +361,8 @@ protected function getCacheFile(string $key): string
366
361
/**
367
362
* Deletes and closes file.
368
363
* @param resource $handle
369
- * @return void
370
364
*/
371
- private static function delete (string $ file , $ handle = NULL )
365
+ private static function delete (string $ file , $ handle = NULL ): void
372
366
{
373
367
if (@unlink ($ file )) { // @ - file may not already exist
374
368
if ($ handle ) {
0 commit comments