Test Setup Failed
Pull Request — master (#831)
by
unknown
04:05 queued 31s
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
@@ -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' => __('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/FolderController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,20 +11,20 @@
 block discarded – undo
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' => __('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
             ]);
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, __('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/Lfm.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $lfm_type = 'file';
76 76
 
77 77
         $request_type = lcfirst(Str::singular($this->input('type') ?: ''));
78
-        $available_types = array_keys($this->config->get('lfm.folder_categories') ?: []);
78
+        $available_types = array_keys($this->config->get('lfm.folder_categories') ?: [ ]);
79 79
 
80 80
         if (in_array($request_type, $available_types)) {
81 81
             $lfm_type = $request_type;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
         $view_type = 'grid';
93 93
         $target_display_type = $this->input('show_list') ?: $startup_view;
94 94
 
95
-        if (in_array($target_display_type, ['list', 'grid'])) {
95
+        if (in_array($target_display_type, [ 'list', 'grid' ])) {
96 96
             $view_type = $target_display_type;
97 97
         }
98 98
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     public function allowShareFolder()
178 178
     {
179
-        if (! $this->allowMultiUser()) {
179
+        if (!$this->allowMultiUser()) {
180 180
             return true;
181 181
         }
182 182
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
      * @param  mixed  $variables   Variables the message needs.
231 231
      * @return string
232 232
      */
233
-    public function error($error_type, $variables = [])
233
+    public function error($error_type, $variables = [ ])
234 234
     {
235 235
         throw new \Exception(__(self::PACKAGE_NAME . '::lfm.error-' . $error_type, $variables));
236 236
     }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         $as = 'unisharp.lfm.';
247 247
         $namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\';
248 248
 
249
-        Route::group(compact('middleware', 'as', 'namespace'), function () {
249
+        Route::group(compact('middleware', 'as', 'namespace'), function() {
250 250
 
251 251
             // display main layout
252 252
             Route::get('/', [
Please login to merge, or discard this patch.