@@ -147,7 +147,7 @@ discard block |
||
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 |
||
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 |
||
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(); |