@@ -52,7 +52,7 @@ discard block  | 
                                                    ||
| 52 | 52 | static::rebuildCacheFolders();  | 
                                                        
| 53 | 53 | return static::getCachePath($type, true);  | 
                                                        
| 54 | 54 |          } elseif (!$path) { | 
                                                        
| 55 | -            throw new IOException('Cache folders are not writable: ' . $cache); | 
                                                        |
| 55 | +            throw new IOException('Cache folders are not writable: '.$cache); | 
                                                        |
| 56 | 56 | }  | 
                                                        
| 57 | 57 | return $path;  | 
                                                        
| 58 | 58 | }  | 
                                                        
@@ -95,12 +95,12 @@ discard block  | 
                                                    ||
| 95 | 95 | }  | 
                                                        
| 96 | 96 | |
| 97 | 97 |          if ($type === static::TYPE_THUMB) { | 
                                                        
| 98 | - $suffix = $width . $height . ($crop ? '1' : '0') . '.jpg';  | 
                                                        |
| 98 | + $suffix = $width.$height.($crop ? '1' : '0').'.jpg';  | 
                                                        |
| 99 | 99 |          } else { | 
                                                        
| 100 | - $suffix = $width . $height;  | 
                                                        |
| 100 | + $suffix = $width.$height;  | 
                                                        |
| 101 | 101 | }  | 
                                                        
| 102 | 102 | |
| 103 | - return $domainFolder . static::getThumbFilename($url) . $suffix;  | 
                                                        |
| 103 | + return $domainFolder.static::getThumbFilename($url).$suffix;  | 
                                                        |
| 104 | 104 | }  | 
                                                        
| 105 | 105 | |
| 106 | 106 | /**  | 
                                                        
@@ -149,10 +149,10 @@ discard block  | 
                                                    ||
| 149 | 149 | protected static function createDomainThumbCacheFolder(string $domain, string $type): void  | 
                                                        
| 150 | 150 |      { | 
                                                        
| 151 | 151 | $cachePath = static::getCachePath($type);  | 
                                                        
| 152 | - $domainFolder = $cachePath . $domain;  | 
                                                        |
| 152 | + $domainFolder = $cachePath.$domain;  | 
                                                        |
| 153 | 153 |          if (!file_exists($domainFolder)) { | 
                                                        
| 154 | 154 | mkdir($domainFolder, 0775, false);  | 
                                                        
| 155 | - touch($domainFolder . '/' . static::$CLEAN_FILE);  | 
                                                        |
| 155 | + touch($domainFolder.'/'.static::$CLEAN_FILE);  | 
                                                        |
| 156 | 156 | }  | 
                                                        
| 157 | 157 | static::createHtaccessFile($cachePath, $type === static::TYPE_THUMB);  | 
                                                        
| 158 | 158 | }  | 
                                                        
@@ -170,13 +170,13 @@ discard block  | 
                                                    ||
| 170 | 170 | protected static function createHtaccessFile(string $path, bool $allowed = false): void  | 
                                                        
| 171 | 171 |      { | 
                                                        
| 172 | 172 |          $apacheVersion = ConfigManager::get('settings.apache_version', ''); | 
                                                        
| 173 | - $htaccessFile = $path . '.htaccess';  | 
                                                        |
| 173 | + $htaccessFile = $path.'.htaccess';  | 
                                                        |
| 174 | 174 |          if (file_exists($htaccessFile)) { | 
                                                        
| 175 | 175 | return;  | 
                                                        
| 176 | 176 | }  | 
                                                        
| 177 | - $templateFile = file_exists(FileUtils::RESOURCES_PATH . 'htaccess' . $apacheVersion . '_template')  | 
                                                        |
| 178 | - ? FileUtils::RESOURCES_PATH . 'htaccess' . $apacheVersion . '_template'  | 
                                                        |
| 179 | - : FileUtils::RESOURCES_PATH . 'htaccess_template';  | 
                                                        |
| 177 | + $templateFile = file_exists(FileUtils::RESOURCES_PATH.'htaccess'.$apacheVersion.'_template')  | 
                                                        |
| 178 | + ? FileUtils::RESOURCES_PATH.'htaccess'.$apacheVersion.'_template'  | 
                                                        |
| 179 | + : FileUtils::RESOURCES_PATH.'htaccess_template';  | 
                                                        |
| 180 | 180 | $template = TemplatePolyfill::get($templateFile);  | 
                                                        
| 181 | 181 | $template->setVar([  | 
                                                        
| 182 | 182 | 'new_all' => $allowed ? 'granted' : 'denied',  | 
                                                        
@@ -211,7 +211,7 @@ discard block  | 
                                                    ||
| 211 | 211 | protected static function checkCacheType(string $type): bool  | 
                                                        
| 212 | 212 |      { | 
                                                        
| 213 | 213 |          if ($type != static::TYPE_THUMB && $type != static::TYPE_FINDER) { | 
                                                        
| 214 | -            throw new CacheException('Unknown cache type ' . $type); | 
                                                        |
| 214 | +            throw new CacheException('Unknown cache type '.$type); | 
                                                        |
| 215 | 215 | }  | 
                                                        
| 216 | 216 | |
| 217 | 217 | return true;  | 
                                                        
@@ -226,20 +226,20 @@ discard block  | 
                                                    ||
| 226 | 226 | protected static function rebuildCacheFolders(): void  | 
                                                        
| 227 | 227 |      { | 
                                                        
| 228 | 228 |          $mainFolder = ConfigManager::get('settings.path.cache', 'cache/'); | 
                                                        
| 229 | -        if (! is_dir($mainFolder)) { | 
                                                        |
| 229 | +        if (!is_dir($mainFolder)) { | 
                                                        |
| 230 | 230 | mkdir($mainFolder, 0755);  | 
                                                        
| 231 | 231 | }  | 
                                                        
| 232 | -        if (! is_dir($mainFolder . static::TYPE_THUMB)) { | 
                                                        |
| 233 | - mkdir($mainFolder . static::TYPE_THUMB, 0755);  | 
                                                        |
| 232 | +        if (!is_dir($mainFolder.static::TYPE_THUMB)) { | 
                                                        |
| 233 | + mkdir($mainFolder.static::TYPE_THUMB, 0755);  | 
                                                        |
| 234 | 234 | }  | 
                                                        
| 235 | -        if (! is_readable($mainFolder . static::TYPE_THUMB . DIRECTORY_SEPARATOR . '.gitkeep')) { | 
                                                        |
| 236 | - touch($mainFolder . static::TYPE_THUMB . DIRECTORY_SEPARATOR . '.gitkeep');  | 
                                                        |
| 235 | +        if (!is_readable($mainFolder.static::TYPE_THUMB.DIRECTORY_SEPARATOR.'.gitkeep')) { | 
                                                        |
| 236 | + touch($mainFolder.static::TYPE_THUMB.DIRECTORY_SEPARATOR.'.gitkeep');  | 
                                                        |
| 237 | 237 | }  | 
                                                        
| 238 | -        if (! is_dir($mainFolder . static::TYPE_FINDER)) { | 
                                                        |
| 239 | - mkdir($mainFolder . static::TYPE_FINDER, 0755);  | 
                                                        |
| 238 | +        if (!is_dir($mainFolder.static::TYPE_FINDER)) { | 
                                                        |
| 239 | + mkdir($mainFolder.static::TYPE_FINDER, 0755);  | 
                                                        |
| 240 | 240 | }  | 
                                                        
| 241 | -        if (! is_readable($mainFolder . static::TYPE_THUMB . DIRECTORY_SEPARATOR . '.gitkeep')) { | 
                                                        |
| 242 | - touch($mainFolder . static::TYPE_FINDER . DIRECTORY_SEPARATOR . '.gitkeep');  | 
                                                        |
| 241 | +        if (!is_readable($mainFolder.static::TYPE_THUMB.DIRECTORY_SEPARATOR.'.gitkeep')) { | 
                                                        |
| 242 | + touch($mainFolder.static::TYPE_FINDER.DIRECTORY_SEPARATOR.'.gitkeep');  | 
                                                        |
| 243 | 243 | }  | 
                                                        
| 244 | 244 | }  | 
                                                        
| 245 | 245 | |