Test Failed
Push — master ( 9df01b...bf5903 )
by Fran
03:33
created
src/base/Cache.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         GeneratorHelper::createDir(dirname($path));
52 52
         if (false === FileHelper::writeFile($path, $data)) {
53
-            throw new ConfigException(_('No se tienen los permisos suficientes para escribir en el fichero ') . $path);
53
+            throw new ConfigException(_('No se tienen los permisos suficientes para escribir en el fichero ').$path);
54 54
         }
55 55
     }
56 56
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     {
66 66
         Logger::log('Gathering data from cache', LOG_DEBUG, ['path' => $path]);
67 67
         $data = null;
68
-        $absolutePath = ($absolute) ? $path : CACHE_DIR . DIRECTORY_SEPARATOR . $path;
68
+        $absolutePath = ($absolute) ? $path : CACHE_DIR.DIRECTORY_SEPARATOR.$path;
69 69
         if (file_exists($absolutePath)) {
70 70
             $data = FileHelper::readFile($absolutePath);
71 71
         }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     private function hasExpiredCache($path, $expires = 300, $absolute = false)
83 83
     {
84 84
         Logger::log('Checking expiration', LOG_DEBUG, ['path' => $path]);
85
-        $absolutePath = ($absolute) ? $path : CACHE_DIR . DIRECTORY_SEPARATOR . $path;
85
+        $absolutePath = ($absolute) ? $path : CACHE_DIR.DIRECTORY_SEPARATOR.$path;
86 86
         $lasModificationDate = filemtime($absolutePath);
87 87
         return ($lasModificationDate + $expires <= time());
88 88
     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     {
152 152
         Logger::log('Store data in cache', LOG_DEBUG, ['path' => $path]);
153 153
         $data = Cache::transformData($data, $transform);
154
-        $absolutePath = ($absolute) ? $path : CACHE_DIR . DIRECTORY_SEPARATOR . $path;
154
+        $absolutePath = ($absolute) ? $path : CACHE_DIR.DIRECTORY_SEPARATOR.$path;
155 155
         $this->saveTextToFile($data, $absolutePath);
156 156
     }
157 157
 
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
     {
168 168
         $data = null;
169 169
         Logger::log('Reading data from cache', LOG_DEBUG, ['path' => $path]);
170
-        if (file_exists(CACHE_DIR . DIRECTORY_SEPARATOR . $path)) {
170
+        if (file_exists(CACHE_DIR.DIRECTORY_SEPARATOR.$path)) {
171 171
             if (is_callable($function) && $this->hasExpiredCache($path, $expires)) {
172 172
                 $data = call_user_func($function);
173 173
                 $this->storeData($path, $data, $transform, false, $expires);
174
-            } else {
174
+            }else {
175 175
                 $data = $this->getDataFromFile($path, $transform);
176 176
             }
177 177
         }
@@ -228,10 +228,10 @@  discard block
 block discarded – undo
228 228
      * Flush cache when save a registry
229 229
      */
230 230
     public function flushCache() {
231
-        if(Config::getParam('cache.data.enable', false)) {
231
+        if (Config::getParam('cache.data.enable', false)) {
232 232
             Logger::log('Flushing cache', LOG_DEBUG);
233 233
             $action = Security::getInstance()->getSessionKey("__CACHE__");
234
-            $hashPath = FileHelper::generateCachePath($action, $action['params']) . '..' . DIRECTORY_SEPARATOR . ' .. ' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
234
+            $hashPath = FileHelper::generateCachePath($action, $action['params']).'..'.DIRECTORY_SEPARATOR.' .. '.DIRECTORY_SEPARATOR.'..'.DIRECTORY_SEPARATOR;
235 235
             FileHelper::deleteDir($hashPath);
236 236
         }
237 237
     }
Please login to merge, or discard this patch.