@@ -114,10 +114,10 @@ |
||
| 114 | 114 | 'over_write_on_duplicate' => false, |
| 115 | 115 | |
| 116 | 116 | // mimetypes of executables to prevent from uploading |
| 117 | - 'disallowed_mimetypes' => ['text/x-php', 'text/html', 'text/plain'], |
|
| 117 | + 'disallowed_mimetypes' => [ 'text/x-php', 'text/html', 'text/plain' ], |
|
| 118 | 118 | |
| 119 | 119 | // Item Columns |
| 120 | - 'item_columns' => ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'], |
|
| 120 | + 'item_columns' => [ 'name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url' ], |
|
| 121 | 121 | |
| 122 | 122 | /* |
| 123 | 123 | |-------------------------------------------------------------------------- |
@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | |
| 97 | 97 | public function folders() |
| 98 | 98 | { |
| 99 | - $all_folders = array_map(function ($directory_path) { |
|
| 99 | + $all_folders = array_map(function($directory_path) { |
|
| 100 | 100 | return $this->pretty($directory_path, true); |
| 101 | 101 | }, $this->storage->directories()); |
| 102 | 102 | |
| 103 | - $folders = array_filter($all_folders, function ($directory) { |
|
| 103 | + $folders = array_filter($all_folders, function($directory) { |
|
| 104 | 104 | return $directory->name !== $this->helper->getThumbFolderName(); |
| 105 | 105 | }); |
| 106 | 106 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | public function files() |
| 111 | 111 | { |
| 112 | - $files = array_map(function ($file_path) { |
|
| 112 | + $files = array_map(function($file_path) { |
|
| 113 | 113 | return $this->pretty($file_path); |
| 114 | 114 | }, $this->storage->files()); |
| 115 | 115 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $working_dir = $this->path('working_dir'); |
| 155 | 155 | $parent_dir = substr($working_dir, 0, strrpos($working_dir, '/')); |
| 156 | 156 | |
| 157 | - $parent_directories = array_map(function ($directory_path) { |
|
| 157 | + $parent_directories = array_map(function($directory_path) { |
|
| 158 | 158 | return app(static::class)->translateToLfmPath($directory_path); |
| 159 | 159 | }, app(static::class)->dir($parent_dir)->directories()); |
| 160 | 160 | |
@@ -200,20 +200,20 @@ discard block |
||
| 200 | 200 | public function sortByColumn($arr_items) |
| 201 | 201 | { |
| 202 | 202 | $sort_by = $this->helper->input('sort_type'); |
| 203 | - if (in_array($sort_by, ['name', 'time'])) { |
|
| 203 | + if (in_array($sort_by, [ 'name', 'time' ])) { |
|
| 204 | 204 | $key_to_sort = $sort_by; |
| 205 | 205 | } else { |
| 206 | 206 | $key_to_sort = 'name'; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | - uasort($arr_items, function ($a, $b) use ($key_to_sort) { |
|
| 209 | + uasort($arr_items, function($a, $b) use ($key_to_sort) { |
|
| 210 | 210 | return strcasecmp($a->{$key_to_sort}, $b->{$key_to_sort}); |
| 211 | 211 | }); |
| 212 | 212 | |
| 213 | 213 | return $arr_items; |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | - public function error($error_type, $variables = []) |
|
| 216 | + public function error($error_type, $variables = [ ]) |
|
| 217 | 217 | { |
| 218 | 218 | throw new \Exception($this->helper->error($error_type, $variables)); |
| 219 | 219 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | $validator->nameIsNotDuplicate($this->getNewName($file), $this); |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - $validator->isNotExcutable(config('lfm.disallowed_mimetypes', ['text/x-php', 'text/html', 'text/plain'])); |
|
| 256 | + $validator->isNotExcutable(config('lfm.disallowed_mimetypes', [ 'text/x-php', 'text/html', 'text/plain' ])); |
|
| 257 | 257 | |
| 258 | 258 | if (config('lfm.should_validate_mime', false)) { |
| 259 | 259 | $validator->mimeTypeIsValid($this->helper->availableMimeTypes()); |
@@ -289,11 +289,11 @@ discard block |
||
| 289 | 289 | $file_name_without_extentions = $new_file_name; |
| 290 | 290 | while ($this->setName(($extension) ? $new_file_name_with_extention : $new_file_name)->exists()) { |
| 291 | 291 | if (config('lfm.alphanumeric_filename') === true) { |
| 292 | - $suffix = '_'.$counter; |
|
| 292 | + $suffix = '_' . $counter; |
|
| 293 | 293 | } else { |
| 294 | 294 | $suffix = " ({$counter})"; |
| 295 | 295 | } |
| 296 | - $new_file_name = $file_name_without_extentions.$suffix; |
|
| 296 | + $new_file_name = $file_name_without_extentions . $suffix; |
|
| 297 | 297 | |
| 298 | 298 | if ($extension) { |
| 299 | 299 | $new_file_name_with_extention = $new_file_name . '.' . $extension; |