Completed
Push — master ( 11d45e...42b2c4 )
by Jan
04:33
created
src/Services/AttachmentHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
 
165 165
         $sz = 'BKMGTP';
166 166
         $factor = (int) floor((strlen($bytes) - 1) / 3);
167
-        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor];
167
+        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor];
168 168
     }
169 169
 
170 170
     /**
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
             MeasurementUnitAttachment::class => 'measurement_unit', StorelocationAttachment::class => 'storelocation',
182 182
             SupplierAttachment::class => 'supplier', UserAttachment::class => 'user'];
183 183
 
184
-        $path = $this->pathResolver->getMediaPath() . DIRECTORY_SEPARATOR . $mapping[get_class($attachment)] . DIRECTORY_SEPARATOR . $attachment->getElement()->getID();
184
+        $path = $this->pathResolver->getMediaPath().DIRECTORY_SEPARATOR.$mapping[get_class($attachment)].DIRECTORY_SEPARATOR.$attachment->getElement()->getID();
185 185
         return $path;
186 186
     }
187 187
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
         //Sanatize filename
206 206
         $safeName = transliterator_transliterate('Any-Latin; Latin-ASCII; [^A-Za-z0-9_] remove; Lower()', $attachment->getName());
207
-        $newFilename = $safeName . '-' . uniqid('', false) . '.' . $file->getClientOriginalExtension();
207
+        $newFilename = $safeName.'-'.uniqid('', false).'.'.$file->getClientOriginalExtension();
208 208
 
209 209
         //Move our temporay attachment to its final location
210 210
         $file_path = $file->move($folder, $newFilename)->getRealPath();
Please login to merge, or discard this patch.