@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function getErrors() |
48 | 48 | { |
49 | - $arr_errors = []; |
|
49 | + $arr_errors = [ ]; |
|
50 | 50 | |
51 | - if (! extension_loaded('gd') && ! extension_loaded('imagick')) { |
|
51 | + if (!extension_loaded('gd') && !extension_loaded('imagick')) { |
|
52 | 52 | array_push($arr_errors, trans('laravel-filemanager::lfm.message-extension_not_found')); |
53 | 53 | } |
54 | 54 | |
55 | - if (! extension_loaded('exif')) { |
|
55 | + if (!extension_loaded('exif')) { |
|
56 | 56 | array_push($arr_errors, 'EXIF extension not found.'); |
57 | 57 | } |
58 | 58 | |
59 | - if (! extension_loaded('fileinfo')) { |
|
59 | + if (!extension_loaded('fileinfo')) { |
|
60 | 60 | array_push($arr_errors, 'Fileinfo extension not found.'); |
61 | 61 | } |
62 | 62 | |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | . $this->helper->currentLfmType() |
65 | 65 | . '.valid_mime'; |
66 | 66 | |
67 | - if (! is_array(config($mine_config_key))) { |
|
67 | + if (!is_array(config($mine_config_key))) { |
|
68 | 68 | array_push($arr_errors, 'Config : ' . $mine_config_key . ' is not a valid array.'); |
69 | 69 | } |
70 | 70 | |
71 | 71 | return $arr_errors; |
72 | 72 | } |
73 | 73 | |
74 | - public function error($error_type, $variables = []) |
|
74 | + public function error($error_type, $variables = [ ]) |
|
75 | 75 | { |
76 | 76 | return $this->helper->error($error_type, $variables); |
77 | 77 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | public function getDelete() |
16 | 16 | { |
17 | 17 | $item_names = request('items'); |
18 | - $errors = []; |
|
18 | + $errors = [ ]; |
|
19 | 19 | |
20 | 20 | foreach ($item_names as $name_to_delete) { |
21 | 21 | $file_to_delete = $this->lfm->pretty($name_to_delete); |
@@ -28,13 +28,13 @@ discard block |
||
28 | 28 | continue; |
29 | 29 | } |
30 | 30 | |
31 | - if (! $this->lfm->setName($name_to_delete)->exists()) { |
|
32 | - array_push($errors, parent::error('folder-not-found', ['folder' => $file_path])); |
|
31 | + if (!$this->lfm->setName($name_to_delete)->exists()) { |
|
32 | + array_push($errors, parent::error('folder-not-found', [ 'folder' => $file_path ])); |
|
33 | 33 | continue; |
34 | 34 | } |
35 | 35 | |
36 | 36 | if ($this->lfm->setName($name_to_delete)->isDirectory()) { |
37 | - if (! $this->lfm->setName($name_to_delete)->directoryIsEmpty()) { |
|
37 | + if (!$this->lfm->setName($name_to_delete)->directoryIsEmpty()) { |
|
38 | 38 | array_push($errors, parent::error('delete-folder')); |
39 | 39 | continue; |
40 | 40 | } |
@@ -11,20 +11,20 @@ |
||
11 | 11 | */ |
12 | 12 | public function getFolders() |
13 | 13 | { |
14 | - $folder_types = array_filter(['user', 'share'], function ($type) { |
|
14 | + $folder_types = array_filter([ 'user', 'share' ], function($type) { |
|
15 | 15 | return $this->helper->allowFolderType($type); |
16 | 16 | }); |
17 | 17 | |
18 | 18 | return view('laravel-filemanager::tree') |
19 | 19 | ->with([ |
20 | - 'root_folders' => array_map(function ($type) use ($folder_types) { |
|
20 | + 'root_folders' => array_map(function($type) use ($folder_types) { |
|
21 | 21 | $path = $this->lfm->dir($this->helper->getRootFolder($type)); |
22 | 22 | |
23 | 23 | return (object) [ |
24 | 24 | 'name' => trans('laravel-filemanager::lfm.title-' . $type), |
25 | 25 | 'url' => $path->path('working_dir'), |
26 | 26 | 'children' => $path->folders(), |
27 | - 'has_next' => ! ($type == end($folder_types)), |
|
27 | + 'has_next' => !($type == end($folder_types)), |
|
28 | 28 | ]; |
29 | 29 | }, $folder_types), |
30 | 30 | ]); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $lfm_type = 'file'; |
75 | 75 | |
76 | 76 | $request_type = lcfirst(str_singular($this->input('type') ?: '')); |
77 | - $available_types = array_keys($this->config->get('lfm.folder_categories') ?: []); |
|
77 | + $available_types = array_keys($this->config->get('lfm.folder_categories') ?: [ ]); |
|
78 | 78 | |
79 | 79 | if (in_array($request_type, $available_types)) { |
80 | 80 | $lfm_type = $request_type; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | $view_type = 'grid'; |
92 | 92 | $target_display_type = $this->input('show_list') ?: $startup_view; |
93 | 93 | |
94 | - if (in_array($target_display_type, ['list', 'grid'])) { |
|
94 | + if (in_array($target_display_type, [ 'list', 'grid' ])) { |
|
95 | 95 | $view_type = $target_display_type; |
96 | 96 | } |
97 | 97 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function allowShareFolder() |
177 | 177 | { |
178 | - if (! $this->allowMultiUser()) { |
|
178 | + if (!$this->allowMultiUser()) { |
|
179 | 179 | return true; |
180 | 180 | } |
181 | 181 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | * @param mixed $variables Variables the message needs. |
230 | 230 | * @return string |
231 | 231 | */ |
232 | - public function error($error_type, $variables = []) |
|
232 | + public function error($error_type, $variables = [ ]) |
|
233 | 233 | { |
234 | 234 | throw new \Exception(trans(self::PACKAGE_NAME . '::lfm.error-' . $error_type, $variables)); |
235 | 235 | } |
@@ -241,11 +241,11 @@ discard block |
||
241 | 241 | */ |
242 | 242 | public static function routes() |
243 | 243 | { |
244 | - $middleware = array_merge([ CreateDefaultFolder::class, MultiUser::class ], \config('lfm.middlewares') ?? []); |
|
244 | + $middleware = array_merge([ CreateDefaultFolder::class, MultiUser::class ], \config('lfm.middlewares') ?? [ ]); |
|
245 | 245 | $as = 'unisharp.lfm.'; |
246 | 246 | $namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\'; |
247 | 247 | |
248 | - Route::group(compact('middleware', 'as', 'namespace'), function () { |
|
248 | + Route::group(compact('middleware', 'as', 'namespace'), function() { |
|
249 | 249 | |
250 | 250 | // display main layout |
251 | 251 | Route::get('/', [ |