Test Failed
Pull Request — master (#1065)
by
unknown
06:46
created
src/Lfm.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             $path_parts = pathinfo($path);
62 62
         }
63 63
 
64
-        return substr($path_parts[$part_name], 1);
64
+        return substr($path_parts[ $part_name ], 1);
65 65
     }
66 66
 
67 67
     public function allowFolderType($type)
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
         $lfm_type = 'file';
91 91
 
92 92
         $request_type = lcfirst(Str::singular($this->input('type') ?: ''));
93
-        $available_types = array_keys($this->config->get('lfm.folder_categories') ?: []);
93
+        $available_types = array_keys($this->config->get('lfm.folder_categories') ?: [ ]);
94 94
 
95 95
         if (in_array($request_type, $available_types)) {
96 96
             $lfm_type = $request_type;
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         $view_type = 'grid';
108 108
         $target_display_type = $this->input('show_list') ?: $startup_view;
109 109
 
110
-        if (in_array($target_display_type, ['list', 'grid'])) {
110
+        if (in_array($target_display_type, [ 'list', 'grid' ])) {
111 111
             $view_type = $target_display_type;
112 112
         }
113 113
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function allowShareFolder()
193 193
     {
194
-        if (! $this->allowMultiUser()) {
194
+        if (!$this->allowMultiUser()) {
195 195
             return true;
196 196
         }
197 197
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
      * @param  mixed  $variables   Variables the message needs.
246 246
      * @return string
247 247
      */
248
-    public function error($error_type, $variables = [])
248
+    public function error($error_type, $variables = [ ])
249 249
     {
250 250
         throw new \Exception(trans(self::PACKAGE_NAME . '::lfm.error-' . $error_type, $variables));
251 251
     }
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         $as = 'unisharp.lfm.';
262 262
         $namespace = '\\UniSharp\\LaravelFilemanager\\Controllers\\';
263 263
 
264
-        Route::group(compact('middleware', 'as', 'namespace'), function () {
264
+        Route::group(compact('middleware', 'as', 'namespace'), function() {
265 265
 
266 266
             // display main layout
267 267
             Route::get('/', [
Please login to merge, or discard this patch.
src/Exceptions/FileSizeExceedIniMaximumException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 {
7 7
     public function __construct()
8 8
     {
9
-        $this->message = trans('laravel-filemanager::lfm.error-file-size', ['max' => ini_get('upload_max_filesize')]);
9
+        $this->message = trans('laravel-filemanager::lfm.error-file-size', [ 'max' => ini_get('upload_max_filesize') ]);
10 10
     }
11 11
 }
Please login to merge, or discard this patch.
src/LfmUploadValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
     {
66 66
         $mimetype = $this->file->getMimeType();
67 67
 
68
-        $excutable = ['text/x-php'];
68
+        $excutable = [ 'text/x-php' ];
69 69
 
70 70
         if (in_array($mimetype, $excutable)) {
71 71
             throw new ExcutableFileException();
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,7 +64,7 @@  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
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      */
79 79
     public function applyIniOverrides()
80 80
     {
81
-        $overrides = config('lfm.php_ini_overrides', []);
81
+        $overrides = config('lfm.php_ini_overrides', [ ]);
82 82
 
83 83
         if ($overrides && is_array($overrides) && count($overrides) === 0) {
84 84
             return;
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
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
     public function __construct()
16 16
     {
17 17
         parent::__construct();
18
-        $this->errors = [];
18
+        $this->errors = [ ];
19 19
     }
20 20
 
21 21
     /**
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
     public function upload()
29 29
     {
30 30
         $uploaded_files = request()->file('upload');
31
-        $error_bag = [];
31
+        $error_bag = [ ];
32 32
         $new_filename = null;
33 33
 
34
-        foreach (is_array($uploaded_files) ? $uploaded_files : [$uploaded_files] as $file) {
34
+        foreach (is_array($uploaded_files) ? $uploaded_files : [ $uploaded_files ] as $file) {
35 35
             try {
36 36
                 $this->lfm->validateUploadedFile($file);
37 37
 
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         } else { // upload via ckeditor5 expects json responses
52 52
             if (is_null($new_filename)) {
53 53
                 $response = [
54
-                    'error' => [ 'message' =>  $error_bag[0] ]
54
+                    'error' => [ 'message' =>  $error_bag[ 0 ] ]
55 55
                 ];
56 56
             } else {
57 57
                 $url = $this->lfm->setName($new_filename)->url();
Please login to merge, or discard this patch.
src/LfmItem.php 1 patch
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -12,26 +12,25 @@  discard block
 block discarded – undo
12 12
     private $isDirectory;
13 13
     private $mimeType = null;
14 14
 
15
-    private $columns = [];
16
-    public $attributes = [];
15
+    private $columns = [ ];
16
+    public $attributes = [ ];
17 17
 
18 18
     public function __construct(LfmPath $lfm, Lfm $helper, $isDirectory = false)
19 19
     {
20 20
         $this->lfm = $lfm->thumb(false);
21 21
         $this->helper = $helper;
22 22
         $this->isDirectory = $isDirectory;
23
-        $this->columns = $helper->config('item_columns') ?:
24
-            ['name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url'];
23
+        $this->columns = $helper->config('item_columns') ?: [ 'name', 'url', 'time', 'icon', 'is_file', 'is_image', 'thumb_url' ];
25 24
     }
26 25
 
27 26
     public function __get($var_name)
28 27
     {
29 28
         if (!array_key_exists($var_name, $this->attributes)) {
30 29
             $function_name = Str::camel($var_name);
31
-            $this->attributes[$var_name] = $this->$function_name();
30
+            $this->attributes[ $var_name ] = $this->$function_name();
32 31
         }
33 32
 
34
-        return $this->attributes[$var_name];
33
+        return $this->attributes[ $var_name ];
35 34
     }
36 35
 
37 36
     public function fill()
@@ -60,7 +59,7 @@  discard block
 block discarded – undo
60 59
 
61 60
     public function isFile()
62 61
     {
63
-        return ! $this->isDirectory();
62
+        return !$this->isDirectory();
64 63
     }
65 64
 
66 65
     /**
@@ -175,7 +174,7 @@  discard block
 block discarded – undo
175 174
             return false;
176 175
         }
177 176
 
178
-        if (in_array($this->mimeType(), ['image/gif', 'image/svg+xml'])) {
177
+        if (in_array($this->mimeType(), [ 'image/gif', 'image/svg+xml' ])) {
179 178
             return false;
180 179
         }
181 180
 
@@ -196,9 +195,9 @@  discard block
 block discarded – undo
196 195
      */
197 196
     public function humanFilesize($bytes, $decimals = 2)
198 197
     {
199
-        $size = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
198
+        $size = [ 'B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB' ];
200 199
         $factor = floor((strlen($bytes) - 1) / 3);
201 200
 
202
-        return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[$factor]);
201
+        return sprintf("%.{$decimals}f %s", $bytes / pow(1024, $factor), @$size[ $factor ]);
203 202
     }
204 203
 }
Please login to merge, or discard this patch.
src/LfmPath.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 use UniSharp\LaravelFilemanager\Events\FileWasUploaded;
10 10
 use UniSharp\LaravelFilemanager\Events\ImageIsUploading;
11 11
 use UniSharp\LaravelFilemanager\Events\ImageWasUploaded;
12
-<<<<<<< HEAD
12
+<< << <<< HEAD
13 13
 use Illuminate\Support\Str;
14 14
 =======
15 15
 use UniSharp\LaravelFilemanager\LfmUploadValidator;
@@ -329,6 +329,4 @@  discard block
 block discarded – undo
329 329
         $image = Image::make($original_image->get())
330 330
             ->fit($thumbWidth, $thumbHeight);
331 331
 
332
-        $this->storage->put($image->stream()->detach(), 'public');
333
-    }
334
-}
332
+        $this->storage->put($image->stream
335 333
\ No newline at end of file
Please login to merge, or discard this patch.