@@ -77,7 +77,7 @@ |
||
| 77 | 77 | { |
| 78 | 78 | $extension = strtolower($this->file->getClientOriginalExtension()); |
| 79 | 79 | |
| 80 | - $excutable_extensions = ['php', 'html']; |
|
| 80 | + $excutable_extensions = [ 'php', 'html' ]; |
|
| 81 | 81 | |
| 82 | 82 | if (in_array($extension, $excutable_extensions)) { |
| 83 | 83 | throw new ExcutableFileException(); |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | public function folders() |
| 99 | 99 | { |
| 100 | - $all_folders = array_map(function ($directory_path) { |
|
| 100 | + $all_folders = array_map(function($directory_path) { |
|
| 101 | 101 | return $this->pretty($directory_path, true); |
| 102 | 102 | }, $this->storage->directories()); |
| 103 | 103 | |
| 104 | - $folders = array_filter($all_folders, function ($directory) { |
|
| 104 | + $folders = array_filter($all_folders, function($directory) { |
|
| 105 | 105 | return $directory->name !== $this->helper->getThumbFolderName(); |
| 106 | 106 | }); |
| 107 | 107 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | public function files() |
| 112 | 112 | { |
| 113 | - $files = array_map(function ($file_path) { |
|
| 113 | + $files = array_map(function($file_path) { |
|
| 114 | 114 | return $this->pretty($file_path); |
| 115 | 115 | }, $this->storage->files()); |
| 116 | 116 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $working_dir = $this->path('working_dir'); |
| 156 | 156 | $parent_dir = substr($working_dir, 0, strrpos($working_dir, '/')); |
| 157 | 157 | |
| 158 | - $parent_directories = array_map(function ($directory_path) { |
|
| 158 | + $parent_directories = array_map(function($directory_path) { |
|
| 159 | 159 | return app(static::class)->translateToLfmPath($directory_path); |
| 160 | 160 | }, app(static::class)->dir($parent_dir)->directories()); |
| 161 | 161 | |
@@ -201,20 +201,20 @@ discard block |
||
| 201 | 201 | public function sortByColumn($arr_items) |
| 202 | 202 | { |
| 203 | 203 | $sort_by = $this->helper->input('sort_type'); |
| 204 | - if (in_array($sort_by, ['name', 'time'])) { |
|
| 204 | + if (in_array($sort_by, [ 'name', 'time' ])) { |
|
| 205 | 205 | $key_to_sort = $sort_by; |
| 206 | 206 | } else { |
| 207 | 207 | $key_to_sort = 'name'; |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - uasort($arr_items, function ($a, $b) use ($key_to_sort) { |
|
| 210 | + uasort($arr_items, function($a, $b) use ($key_to_sort) { |
|
| 211 | 211 | return strcasecmp($a->{$key_to_sort}, $b->{$key_to_sort}); |
| 212 | 212 | }); |
| 213 | 213 | |
| 214 | 214 | return $arr_items; |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | - public function error($error_type, $variables = []) |
|
| 217 | + public function error($error_type, $variables = [ ]) |
|
| 218 | 218 | { |
| 219 | 219 | throw new \Exception($this->helper->error($error_type, $variables)); |
| 220 | 220 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | $validator->nameIsNotDuplicate($this->getNewName($file), $this); |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - $validator->mimetypeIsNotExcutable(config('lfm.disallowed_mimetypes', ['text/x-php', 'text/html', 'text/plain'])); |
|
| 256 | + $validator->mimetypeIsNotExcutable(config('lfm.disallowed_mimetypes', [ 'text/x-php', 'text/html', 'text/plain' ])); |
|
| 257 | 257 | |
| 258 | 258 | $validator->extensionIsNotExcutable(); |
| 259 | 259 | |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | $validator->mimeTypeIsValid($this->helper->availableMimeTypes()); |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | - $validator->extensionIsValid(config('lfm.disallowed_extensions', [])); |
|
| 264 | + $validator->extensionIsValid(config('lfm.disallowed_extensions', [ ])); |
|
| 265 | 265 | |
| 266 | 266 | if (config('lfm.should_validate_size', false)) { |
| 267 | 267 | $validator->sizeIsLowerThanConfiguredMaximum($this->helper->maxUploadSize()); |
@@ -293,11 +293,11 @@ discard block |
||
| 293 | 293 | $file_name_without_extentions = $new_file_name; |
| 294 | 294 | while ($this->setName(($extension) ? $new_file_name_with_extention : $new_file_name)->exists()) { |
| 295 | 295 | if (config('lfm.alphanumeric_filename') === true) { |
| 296 | - $suffix = '_'.$counter; |
|
| 296 | + $suffix = '_' . $counter; |
|
| 297 | 297 | } else { |
| 298 | 298 | $suffix = " ({$counter})"; |
| 299 | 299 | } |
| 300 | - $new_file_name = $file_name_without_extentions.$suffix; |
|
| 300 | + $new_file_name = $file_name_without_extentions . $suffix; |
|
| 301 | 301 | |
| 302 | 302 | if ($extension) { |
| 303 | 303 | $new_file_name_with_extention = $new_file_name . '.' . $extension; |