@@ -137,9 +137,8 @@ private function verify(array $meta): bool
137137
138138 /**
139139 * Prevents item reading and writing. Lock is released by write() or remove().
140- * @return void
141140 */
142- public function lock (string $ key )
141+ public function lock (string $ key ): void
143142 {
144143 $ cacheFile = $ this ->getCacheFile ($ key );
145144 if ($ this ->useDirs && !is_dir ($ dir = dirname ($ cacheFile ))) {
@@ -155,9 +154,8 @@ public function lock(string $key)
155154
156155 /**
157156 * Writes item into the cache.
158- * @return void
159157 */
160- public function write (string $ key , $ data , array $ dp )
158+ public function write (string $ key , $ data , array $ dp ): void
161159 {
162160 $ meta = [
163161 self ::META_TIME => microtime (),
@@ -238,9 +236,8 @@ public function write(string $key, $data, array $dp)
238236
239237 /**
240238 * Removes item from the cache.
241- * @return void
242239 */
243- public function remove (string $ key )
240+ public function remove (string $ key ): void
244241 {
245242 unset($ this ->locks [$ key ]);
246243 $ this ->delete ($ this ->getCacheFile ($ key ));
@@ -249,9 +246,8 @@ public function remove(string $key)
249246
250247 /**
251248 * Removes items from the cache by conditions & garbage collector.
252- * @return void
253249 */
254- public function clean (array $ conditions )
250+ public function clean (array $ conditions ): void
255251 {
256252 $ all = !empty ($ conditions [Cache::ALL ]);
257253 $ collector = empty ($ conditions );
@@ -305,9 +301,8 @@ public function clean(array $conditions)
305301 * Reads cache data from disk.
306302 * @param string file path
307303 * @param int lock mode
308- * @return array|NULL
309304 */
310- protected function readMetaAndLock (string $ file , int $ lock )
305+ protected function readMetaAndLock (string $ file , int $ lock ): ? array
311306 {
312307 $ handle = @fopen ($ file , 'r+b ' ); // @ - file may not exist
313308 if (!$ handle ) {
@@ -366,9 +361,8 @@ protected function getCacheFile(string $key): string
366361 /**
367362 * Deletes and closes file.
368363 * @param resource $handle
369- * @return void
370364 */
371- private static function delete (string $ file , $ handle = NULL )
365+ private static function delete (string $ file , $ handle = NULL ): void
372366 {
373367 if (@unlink ($ file )) { // @ - file may not already exist
374368 if ($ handle ) {
0 commit comments