Passed
Push — dependabot/npm_and_yarn/string... ( b56eb5...bc569b )
by
unknown
45:46 queued 33s
created
src/Media/UploadMedia.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         if (is_string($file)) {
58 58
             $image_name = json_decode($file)->output->name;
59 59
             $asset      = $this->addAsset(json_decode($file)->output->image, $type, null, $image_name, $model);
60
-        } else {
60
+        }else {
61 61
             $image_name = $file->getClientOriginalName();
62 62
             $asset      = $this->addAsset($file, $type, null, $image_name, $model);
63 63
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
         if (is_string($file)) {
82 82
             $asset = AssetUploader::uploadFromBase64($file, $filename);
83
-        } else {
83
+        }else {
84 84
             $asset = AssetUploader::upload($file, $filename);
85 85
         }
86 86
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
     private function removeFiles(HasMedia $model, array $files)
115 115
     {
116 116
         if (isset($files['delete']) && is_array($files['delete']) && !empty($files['delete'])) {
117
-            foreach($model->assets()->whereIn('id', $files['delete'])->get() as $asset){
117
+            foreach ($model->assets()->whereIn('id', $files['delete'])->get() as $asset) {
118 118
                 $asset->delete();
119 119
             }
120 120
         }
@@ -126,9 +126,9 @@  discard block
 block discarded – undo
126 126
      */
127 127
     private function sluggifyFilename($filename): string
128 128
     {
129
-        $extension = substr($filename, strrpos($filename, '.') + 1);
129
+        $extension = substr($filename, strrpos($filename, '.')+1);
130 130
         $filename  = substr($filename, 0, strrpos($filename, '.'));
131
-        $filename  = str_slug($filename) . '.' . $extension;
131
+        $filename  = str_slug($filename).'.'.$extension;
132 132
 
133 133
         return $filename;
134 134
     }
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
                 if ($file instanceof UploadedFile && !$file->isValid()) {
145 145
                     if ($file->getError() == UPLOAD_ERR_INI_SIZE) {
146 146
                         throw new FileTooBigException(
147
-                            'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. ' .
148
-                            'upload_max_filesize: ' . (int)ini_get('upload_max_filesize') . 'MB, ' .
149
-                            'post_max_size: ' . (int)(ini_get('post_max_size')) . 'MB'
147
+                            'Cannot upload file because it exceeded the allowed upload_max_filesize: upload_max_filesize is smaller than post size. '.
148
+                            'upload_max_filesize: '.(int)ini_get('upload_max_filesize').'MB, '.
149
+                            'post_max_size: '.(int)(ini_get('post_max_size')).'MB'
150 150
                         );
151 151
                     }
152 152
                 }
Please login to merge, or discard this patch.