Completed
Push — 2.2 ( 709002...7184e8 )
by Kevin
04:01
created
src/BigFileCache.php 2 patches
Doc Comments   +6 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,6 @@  discard block
 block discarded – undo
69 69
      * @param LoggerInterface|LogInterface $log
70 70
      * @param string $cacheDirectory
71 71
      * @param boolean $relativeToSystemTempDirectory
72
-     * @param int $hashDepth
73 72
      */
74 73
     function __construct($defaultTimeToLive, $log, $cacheDirectory, $relativeToSystemTempDirectory)
75 74
     {
@@ -263,6 +262,9 @@  discard block
 block discarded – undo
263 262
 		return $dir.$subFolder;
264 263
 	}
265 264
 
265
+	/**
266
+	 * @param string $key
267
+	 */
266 268
 	protected function getFileName($key) {
267 269
         $subFolder = $this->getDirectory($key);
268 270
 		// Remove any "/" and ":" from the name, and replace those with "_" ...
@@ -281,6 +283,9 @@  discard block
 block discarded – undo
281 283
 		return $subFolder.md5($key).'.cache';
282 284
 	}
283 285
 
286
+    /**
287
+     * @param string $dir
288
+     */
284 289
     private static function rrmdir($dir) {
285 290
         if (is_dir($dir)) {
286 291
             $objects = scandir($dir);
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 
257 257
         if ($key){
258 258
             $subFolder = substr(hash("sha256", $key), 0, $this->hashDepth) . "/";
259
-        }else{
259
+        } else{
260 260
             $subFolder = "";
261 261
         }
262 262
 
@@ -286,9 +286,11 @@  discard block
 block discarded – undo
286 286
             $objects = scandir($dir);
287 287
             foreach ($objects as $object) {
288 288
                 if ($object != "." && $object != "..") {
289
-                    if (filetype($dir."/".$object) == "dir")
290
-                        self::rrmdir($dir."/".$object);
291
-                    else unlink   ($dir."/".$object);
289
+                    if (filetype($dir."/".$object) == "dir") {
290
+                                            self::rrmdir($dir."/".$object);
291
+                    } else {
292
+                    	unlink   ($dir."/".$object);
293
+                    }
292 294
                 }
293 295
             }
294 296
             reset($objects);
Please login to merge, or discard this patch.
src/PhpFileCache.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
         if(strpos($serializeData, 'r:') !== false || (is_object($value) && !method_exists($value, '__set_state'))){
111 111
             $code   = sprintf('<?php return unserialize(%s);', var_export($serializeData, true));
112 112
             file_put_contents($filename, $code);
113
-        }else{
113
+        } else{
114 114
             $data  = var_export($data, true);
115 115
             $code   = sprintf('<?php return %s;', $data);
116 116
             file_put_contents($filename, $code);
Please login to merge, or discard this patch.