Test Setup Failed
Push — master ( 29a2b5...863955 )
by Stream
12:52 queued 04:39
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/LfmItem.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
     private $lfm;
10 10
     private $helper;
11 11
 
12
-    private $columns = ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'];
13
-    public $attributes = [];
12
+    private $columns = [ 'name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url' ];
13
+    public $attributes = [ ];
14 14
 
15 15
     public function __construct(LfmPath $lfm, Lfm $helper)
16 16
     {
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
     {
23 23
         if (!array_key_exists($var_name, $this->attributes)) {
24 24
             $function_name = camel_case($var_name);
25
-            $this->attributes[$var_name] = $this->$function_name();
25
+            $this->attributes[ $var_name ] = $this->$function_name();
26 26
         }
27 27
 
28
-        return $this->attributes[$var_name];
28
+        return $this->attributes[ $var_name ];
29 29
     }
30 30
 
31 31
     public function fill()
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function isFile()
56 56
     {
57
-        return ! $this->isDirectory();
57
+        return !$this->isDirectory();
58 58
     }
59 59
 
60 60
     /**
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             return false;
171 171
         }
172 172
 
173
-        if (in_array($this->mimeType(), ['image/gif', 'image/svg+xml'])) {
173
+        if (in_array($this->mimeType(), [ 'image/gif', 'image/svg+xml' ])) {
174 174
             return false;
175 175
         }
176 176
 
@@ -191,9 +191,9 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function humanFilesize($bytes, $decimals = 2)
193 193
     {
194
-        $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
194
+        $size = [ 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ];
195 195
         $factor = floor((strlen($bytes) - 1) / 3);
196 196
 
197
-        return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[$factor]);
197
+        return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[ $factor ]);
198 198
     }
199 199
 }
Please login to merge, or discard this patch.
src/LaravelFilemanagerServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,28 +17,28 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function boot()
19 19
     {
20
-        $this->loadTranslationsFrom(__DIR__.'/lang', 'laravel-filemanager');
20
+        $this->loadTranslationsFrom(__DIR__ . '/lang', 'laravel-filemanager');
21 21
 
22
-        $this->loadViewsFrom(__DIR__.'/views', 'laravel-filemanager');
22
+        $this->loadViewsFrom(__DIR__ . '/views', 'laravel-filemanager');
23 23
 
24 24
         $this->publishes([
25 25
             __DIR__ . '/config/lfm.php' => base_path('config/lfm.php'),
26 26
         ], 'lfm_config');
27 27
 
28 28
         $this->publishes([
29
-            __DIR__.'/../public' => public_path('vendor/laravel-filemanager'),
29
+            __DIR__ . '/../public' => public_path('vendor/laravel-filemanager'),
30 30
         ], 'lfm_public');
31 31
 
32 32
         $this->publishes([
33
-            __DIR__.'/views'  => base_path('resources/views/vendor/laravel-filemanager'),
33
+            __DIR__ . '/views'  => base_path('resources/views/vendor/laravel-filemanager'),
34 34
         ], 'lfm_view');
35 35
 
36 36
         $this->publishes([
37
-            __DIR__.'/Handlers/LfmConfigHandler.php' => base_path('app/Handlers/LfmConfigHandler.php'),
37
+            __DIR__ . '/Handlers/LfmConfigHandler.php' => base_path('app/Handlers/LfmConfigHandler.php'),
38 38
         ], 'lfm_handler');
39 39
 
40 40
         if (config('lfm.use_package_routes')) {
41
-            Route::group(['prefix' => 'laravel-filemanager', 'middleware' => ['web', 'auth']], function () {
41
+            Route::group([ 'prefix' => 'laravel-filemanager', 'middleware' => [ 'web', 'auth' ] ], function() {
42 42
                 \UniSharp\LaravelFilemanager\Lfm::routes();
43 43
             });
44 44
         }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     public function register()
53 53
     {
54
-        $this->app->singleton('laravel-filemanager', function () {
54
+        $this->app->singleton('laravel-filemanager', function() {
55 55
             return true;
56 56
         });
57 57
     }
Please login to merge, or discard this patch.
src/Lfm.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
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('/', [
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/UploadController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     public function __construct()
15 15
     {
16 16
         parent::__construct();
17
-        $this->errors = [];
17
+        $this->errors = [ ];
18 18
     }
19 19
 
20 20
     /**
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
     public function upload()
27 27
     {
28 28
         $uploaded_files = request()->file('upload');
29
-        $error_bag = [];
29
+        $error_bag = [ ];
30 30
         $new_filename = null;
31 31
 
32
-        foreach (is_array($uploaded_files) ? $uploaded_files : [$uploaded_files] as $file) {
32
+        foreach (is_array($uploaded_files) ? $uploaded_files : [ $uploaded_files ] as $file) {
33 33
             try {
34 34
                 $new_filename = $this->lfm->upload($file);
35 35
             } catch (\Exception $e) {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             $response = count($error_bag) > 0 ? $error_bag : parent::$success_response;
47 47
         } else { // upload via ckeditor 'Upload' tab
48 48
             if (is_null($new_filename)) {
49
-                $response = $error_bag[0];
49
+                $response = $error_bag[ 0 ];
50 50
             } else {
51 51
                 $response = view(Lfm::PACKAGE_NAME . '::use')
52 52
                     ->withFile($this->lfm->setName($new_filename)->url());
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.