@@ -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 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | //----- Rezise image |
235 | 235 | $original_image = $this->pretty($new_file_name); |
236 | - $image = Image::make($original_image->get())->resize(800, 600,function ($constraint) { |
|
236 | + $image = Image::make($original_image->get())->resize(800, 600, function($constraint) { |
|
237 | 237 | $constraint->aspectRatio(); |
238 | 238 | }); |
239 | 239 | $this->setName($new_file_name)->storage->put($image->stream()); |
@@ -294,11 +294,11 @@ discard block |
||
294 | 294 | $file_name_without_extentions = $new_file_name; |
295 | 295 | while ($this->setName(($extension) ? $new_file_name_with_extention : $new_file_name)->exists()) { |
296 | 296 | if (config('lfm.alphanumeric_filename') === true) { |
297 | - $suffix = '_'.$counter; |
|
297 | + $suffix = '_' . $counter; |
|
298 | 298 | } else { |
299 | 299 | $suffix = " ({$counter})"; |
300 | 300 | } |
301 | - $new_file_name = $file_name_without_extentions.$suffix; |
|
301 | + $new_file_name = $file_name_without_extentions . $suffix; |
|
302 | 302 | |
303 | 303 | if ($extension) { |
304 | 304 | $new_file_name_with_extention = $new_file_name . '.' . $extension; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | |
39 | 39 | $new_name = Str::slug($new_name, '_'); |
40 | 40 | |
41 | - if (! $is_directory) { |
|
41 | + if (!$is_directory) { |
|
42 | 42 | $extension = $old_file->extension(); |
43 | 43 | if ($extension) { |
44 | 44 | $new_name = str_replace('.' . $extension, '', $new_name) . '.' . $extension; |