Test Failed
Push — master ( 241100...2372f3 )
by Stream
08:09 queued 10s
created
src/LfmItem.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@  discard block
 block discarded – undo
10 10
     private $lfm;
11 11
     private $helper;
12 12
 
13
-    private $columns = ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'];
14
-    public $attributes = [];
13
+    private $columns = [ 'name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url' ];
14
+    public $attributes = [ ];
15 15
 
16 16
     public function __construct(LfmPath $lfm, Lfm $helper)
17 17
     {
@@ -23,10 +23,10 @@  discard block
 block discarded – undo
23 23
     {
24 24
         if (!array_key_exists($var_name, $this->attributes)) {
25 25
             $function_name = Str::camel($var_name);
26
-            $this->attributes[$var_name] = $this->$function_name();
26
+            $this->attributes[ $var_name ] = $this->$function_name();
27 27
         }
28 28
 
29
-        return $this->attributes[$var_name];
29
+        return $this->attributes[ $var_name ];
30 30
     }
31 31
 
32 32
     public function fill()
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
     public function isFile()
57 57
     {
58
-        return ! $this->isDirectory();
58
+        return !$this->isDirectory();
59 59
     }
60 60
 
61 61
     /**
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             return false;
180 180
         }
181 181
 
182
-        if (in_array($this->mimeType(), ['image/gif', 'image/svg+xml'])) {
182
+        if (in_array($this->mimeType(), [ 'image/gif', 'image/svg+xml' ])) {
183 183
             return false;
184 184
         }
185 185
 
@@ -200,9 +200,9 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function humanFilesize($bytes, $decimals = 2)
202 202
     {
203
-        $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
203
+        $size = [ 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ];
204 204
         $factor = floor((strlen($bytes) - 1) / 3);
205 205
 
206
-        return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[$factor]);
206
+        return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[ $factor ]);
207 207
     }
208 208
 }
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
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         $items = array_merge($this->lfm->folders(), $this->lfm->files());
23 23
 
24 24
         return [
25
-            'items' => array_map(function ($item) {
25
+            'items' => array_map(function($item) {
26 26
                 return $item->fill()->attributes;
27 27
             }, array_slice($items, ($currentPage - 1) * $perPage, $perPage)),
28 28
             'paginator' => [
@@ -38,19 +38,19 @@  discard block
 block discarded – undo
38 38
     public function move()
39 39
     {
40 40
         $items = request('items');
41
-        $folder_types = array_filter(['user', 'share'], function ($type) {
41
+        $folder_types = array_filter([ 'user', 'share' ], function($type) {
42 42
             return $this->helper->allowFolderType($type);
43 43
         });
44 44
         return view('laravel-filemanager::move')
45 45
             ->with([
46
-                'root_folders' => array_map(function ($type) use ($folder_types) {
46
+                'root_folders' => array_map(function($type) use ($folder_types) {
47 47
                     $path = $this->lfm->dir($this->helper->getRootFolder($type));
48 48
 
49 49
                     return (object) [
50 50
                         'name' => trans('laravel-filemanager::lfm.title-' . $type),
51 51
                         'url' => $path->path('working_dir'),
52 52
                         'children' => $path->folders(),
53
-                        'has_next' => ! ($type == end($folder_types)),
53
+                        'has_next' => !($type == end($folder_types)),
54 54
                     ];
55 55
                 }, $folder_types),
56 56
             ])
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 : array(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/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' => 'filemanager', 'middleware' => ['web', 'auth']], function () {
41
+            Route::group([ 'prefix' => '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.