Test Setup Failed
Pull Request — master (#874)
by
unknown
08:05
created
src/LfmPath.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 
96 96
     public function folders()
97 97
     {
98
-        $all_folders = array_map(function ($directory_path) {
98
+        $all_folders = array_map(function($directory_path) {
99 99
             return $this->pretty($directory_path);
100 100
         }, $this->storage->directories());
101 101
 
102
-        $folders = array_filter($all_folders, function ($directory) {
102
+        $folders = array_filter($all_folders, function($directory) {
103 103
             return $directory->name !== $this->helper->getThumbFolderName();
104 104
         });
105 105
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
     public function files()
110 110
     {
111
-        $files = array_map(function ($file_path) {
111
+        $files = array_map(function($file_path) {
112 112
             return $this->pretty($file_path);
113 113
         }, $this->storage->files());
114 114
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $working_dir = $this->path('working_dir');
153 153
         $parent_dir = substr($working_dir, 0, strrpos($working_dir, '/'));
154 154
 
155
-        $parent_directories = array_map(function ($directory_path) {
155
+        $parent_directories = array_map(function($directory_path) {
156 156
             return app(static::class)->translateToLfmPath($directory_path);
157 157
         }, app(static::class)->dir($parent_dir)->directories());
158 158
 
@@ -196,20 +196,20 @@  discard block
 block discarded – undo
196 196
     public function sortByColumn($arr_items)
197 197
     {
198 198
         $sort_by = $this->helper->input('sort_type');
199
-        if (in_array($sort_by, ['name', 'time'])) {
199
+        if (in_array($sort_by, [ 'name', 'time' ])) {
200 200
             $key_to_sort = $sort_by;
201 201
         } else {
202 202
             $key_to_sort = 'name';
203 203
         }
204 204
 
205
-        uasort($arr_items, function ($a, $b) use ($key_to_sort) {
205
+        uasort($arr_items, function($a, $b) use ($key_to_sort) {
206 206
             return strcmp($a->{$key_to_sort}, $b->{$key_to_sort});
207 207
         });
208 208
 
209 209
         return $arr_items;
210 210
     }
211 211
 
212
-    public function error($error_type, $variables = [])
212
+    public function error($error_type, $variables = [ ])
213 213
     {
214 214
         return $this->helper->error($error_type, $variables);
215 215
     }
@@ -238,10 +238,10 @@  discard block
 block discarded – undo
238 238
     {
239 239
         if (empty($file)) {
240 240
             return $this->error('file-empty');
241
-        } elseif (! $file instanceof UploadedFile) {
241
+        } elseif (!$file instanceof UploadedFile) {
242 242
             return $this->error('instance');
243 243
         } elseif ($file->getError() == UPLOAD_ERR_INI_SIZE) {
244
-            return $this->error('file-size', ['max' => ini_get('upload_max_filesize')]);
244
+            return $this->error('file-size', [ 'max' => ini_get('upload_max_filesize') ]);
245 245
         } elseif ($file->getError() != UPLOAD_ERR_OK) {
246 246
             throw new \Exception('File failed to upload. Error code: ' . $file->getError());
247 247
         }
Please login to merge, or discard this patch.
src/Middlewares/CreateDefaultFolder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 
28 28
     private function checkDefaultFolderExists($type = 'share')
29 29
     {
30
-        if (! $this->helper->allowFolderType($type)) {
30
+        if (!$this->helper->allowFolderType($type)) {
31 31
             return;
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/Middlewares/MultiUser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 
23 23
             if ($previous_dir == null) {
24 24
                 $request->merge(compact('working_dir'));
25
-            } elseif (! $this->validDir($previous_dir)) {
25
+            } elseif (!$this->validDir($previous_dir)) {
26 26
                 $request->replace(compact('working_dir'));
27 27
             }
28 28
         }
Please login to merge, or discard this patch.
src/Controllers/RedirectController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     {
11 11
         $storage = Storage::disk($this->helper->config('disk'));
12 12
 
13
-        if (! $storage->exists($file_path)) {
13
+        if (!$storage->exists($file_path)) {
14 14
             abort(404);
15 15
         }
16 16
 
Please login to merge, or discard this patch.
src/Controllers/CropController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
         $image_path = $this->lfm->setName($image_name)->path('absolute');
32 32
         $crop_path = $image_path;
33 33
 
34
-        if (! $overWrite) {
34
+        if (!$overWrite) {
35 35
             $fileParts = explode('.', $image_name);
36
-            $fileParts[count($fileParts) - 2] = $fileParts[count($fileParts) - 2] . '_cropped_' . time();
36
+            $fileParts[ count($fileParts) - 2 ] = $fileParts[ count($fileParts) - 2 ] . '_cropped_' . time();
37 37
             $crop_path = $this->lfm->setName(implode('.', $fileParts))->path('absolute');
38 38
         }
39 39
 
Please login to merge, or discard this patch.
src/Controllers/ItemsController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     public function getItems()
18 18
     {
19 19
         return [
20
-            'items' => array_map(function ($item) {
20
+            'items' => array_map(function($item) {
21 21
                 return $item->fill()->attributes;
22 22
             }, array_merge($this->lfm->folders(), $this->lfm->files())),
23 23
             'display' => $this->helper->getDisplayMode(),
@@ -28,19 +28,19 @@  discard block
 block discarded – undo
28 28
     public function move()
29 29
     {
30 30
         $items = request('items');
31
-        $folder_types = array_filter(['user', 'share'], function ($type) {
31
+        $folder_types = array_filter([ 'user', 'share' ], function($type) {
32 32
             return $this->helper->allowFolderType($type);
33 33
         });
34 34
         return view('laravel-filemanager::move')
35 35
             ->with([
36
-                'root_folders' => array_map(function ($type) use ($folder_types) {
36
+                'root_folders' => array_map(function($type) use ($folder_types) {
37 37
                     $path = $this->lfm->dir($this->helper->getRootFolder($type));
38 38
 
39 39
                     return (object) [
40 40
                         'name' => trans('laravel-filemanager::lfm.title-' . $type),
41 41
                         'url' => $path->path('working_dir'),
42 42
                         'children' => $path->folders(),
43
-                        'has_next' => ! ($type == end($folder_types)),
43
+                        'has_next' => !($type == end($folder_types)),
44 44
                     ];
45 45
                 }, $folder_types),
46 46
             ])
Please login to merge, or discard this patch.
src/Controllers/RenameController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
             return parent::error('rename');
34 34
         }
35 35
 
36
-        if (! $is_directory) {
36
+        if (!$is_directory) {
37 37
             $extension = $old_file->extension();
38 38
             if ($extension) {
39 39
                 $new_name = str_replace('.' . $extension, '', $new_name) . '.' . $extension;
Please login to merge, or discard this patch.
src/Controllers/LfmController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,17 +46,17 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Controllers/DeleteController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
                 }
Please login to merge, or discard this patch.