Completed
Push — master ( 2872e3...07dcbc )
by Jan
05:46
created
src/Services/AttachmentHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
         $sz = 'BKMGTP';
159 159
         $factor = (int) floor((strlen($bytes) - 1) / 3);
160
-        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor];
160
+        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor];
161 161
     }
162 162
 
163 163
     /**
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             MeasurementUnitAttachment::class => 'measurement_unit', StorelocationAttachment::class => 'storelocation',
175 175
             SupplierAttachment::class => 'supplier', UserAttachment::class => 'user'];
176 176
 
177
-        $path = $this->pathResolver->getMediaPath() . DIRECTORY_SEPARATOR . $mapping[get_class($attachment)] . DIRECTORY_SEPARATOR . $attachment->getElement()->getID();
177
+        $path = $this->pathResolver->getMediaPath().DIRECTORY_SEPARATOR.$mapping[get_class($attachment)].DIRECTORY_SEPARATOR.$attachment->getElement()->getID();
178 178
         return $path;
179 179
     }
180 180
 
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
         //Sanatize filename
199 199
         $originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
200
-        $newFilename = $attachment->getName() . '-' . uniqid('', false) . '.' . $file->getClientOriginalExtension();
200
+        $newFilename = $attachment->getName().'-'.uniqid('', false).'.'.$file->getClientOriginalExtension();
201 201
 
202 202
         //Move our temporay attachment to its final location
203 203
         $file_path = $file->move($folder, $newFilename)->getRealPath();
Please login to merge, or discard this patch.