Completed
Push — master ( ac238c...da4625 )
by Jan
04:59
created
src/Services/AttachmentHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
         $sz = 'BKMGTP';
149 149
         $factor = (int) floor((strlen($bytes) - 1) / 3);
150
-        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor];
150
+        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor];
151 151
     }
152 152
 
153 153
     /**
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             MeasurementUnitAttachment::class => 'measurement_unit', StorelocationAttachment::class => 'storelocation',
165 165
             SupplierAttachment::class => 'supplier', UserAttachment::class => 'user'];
166 166
 
167
-        $path = $this->base_path . DIRECTORY_SEPARATOR . $mapping[get_class($attachment)] . DIRECTORY_SEPARATOR . $attachment->getElement()->getID();
167
+        $path = $this->base_path.DIRECTORY_SEPARATOR.$mapping[get_class($attachment)].DIRECTORY_SEPARATOR.$attachment->getElement()->getID();
168 168
         return $path;
169 169
     }
170 170
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
         //Sanatize filename
187 187
         $originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
188
-        $newFilename = $attachment->getName() . '-' . uniqid('', false) . '.' . $file->guessExtension();
188
+        $newFilename = $attachment->getName().'-'.uniqid('', false).'.'.$file->guessExtension();
189 189
 
190 190
         //Move our temporay attachment to its final location
191 191
         $file_path = $file->move($folder, $newFilename)->getRealPath();
Please login to merge, or discard this patch.