Completed
Push — master ( fcfab9...3a1193 )
by Jan
03:55
created
src/Services/AttachmentHelper.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         if ($fs->isAbsolutePath($tmp_base_path)) {
58 58
             $this->base_path = $tmp_base_path;
59 59
         } else {
60
-            $this->base_path = realpath($kernel->getProjectDir() . DIRECTORY_SEPARATOR . $tmp_base_path);
60
+            $this->base_path = realpath($kernel->getProjectDir().DIRECTORY_SEPARATOR.$tmp_base_path);
61 61
         }
62 62
     }
63 63
 
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 
160 160
         $sz = 'BKMGTP';
161 161
         $factor = (int) floor((strlen($bytes) - 1) / 3);
162
-        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor];
162
+        return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor];
163 163
     }
164 164
 
165 165
     /**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     {
172 172
         $mapping = [PartAttachment::class => 'part'];
173 173
 
174
-        $path = $this->base_path . DIRECTORY_SEPARATOR . $mapping[get_class($attachment)] . DIRECTORY_SEPARATOR . $attachment->getElement()->getID();
174
+        $path = $this->base_path.DIRECTORY_SEPARATOR.$mapping[get_class($attachment)].DIRECTORY_SEPARATOR.$attachment->getElement()->getID();
175 175
         return $path;
176 176
     }
177 177
 
@@ -193,17 +193,17 @@  discard block
 block discarded – undo
193 193
         //Sanatize filename
194 194
         $originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
195 195
         $safeFilename = transliterator_transliterate('Any-Latin; Latin-ASCII; [^A-Za-z0-9_] remove; Lower()', $originalFilename);
196
-        $newFilename = $safeFilename . '.' . $file->getClientOriginalExtension();
196
+        $newFilename = $safeFilename.'.'.$file->getClientOriginalExtension();
197 197
 
198 198
         //If a file with this name is already existing add a number to the filename
199
-        if (file_exists($folder . DIRECTORY_SEPARATOR . $newFilename)) {
199
+        if (file_exists($folder.DIRECTORY_SEPARATOR.$newFilename)) {
200 200
             $bak = $newFilename;
201 201
 
202 202
             $number = 1;
203
-            $newFilename = $folder . DIRECTORY_SEPARATOR . $safeFilename . '-' . $number . '.' . $file->getClientOriginalExtension();
203
+            $newFilename = $folder.DIRECTORY_SEPARATOR.$safeFilename.'-'.$number.'.'.$file->getClientOriginalExtension();
204 204
             while (file_exists($newFilename)) {
205 205
                 $number++;
206
-                $newFilename = $folder . DIRECTORY_SEPARATOR . $safeFilename . '-' . $number . '.' . $file->getClientOriginalExtension();
206
+                $newFilename = $folder.DIRECTORY_SEPARATOR.$safeFilename.'-'.$number.'.'.$file->getClientOriginalExtension();
207 207
             }
208 208
         }
209 209
 
Please login to merge, or discard this patch.
src/Controller/PartController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             $attachments = $form['attachments'];
86 86
             foreach ($attachments as $attachment) {
87 87
                 /** @var $attachment FormInterface */
88
-                $attachmentHelper->upload( $attachment->getData(), $attachment['file']->getData());
88
+                $attachmentHelper->upload($attachment->getData(), $attachment['file']->getData());
89 89
             }
90 90
 
91 91
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             $this->addFlash('info', $translator->trans('part.edited_flash'));
95 95
             //Reload form, so the SIUnitType entries use the new part unit
96 96
             $form = $this->createForm(PartBaseType::class, $part);
97
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
97
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
98 98
             $this->addFlash('error', $translator->trans('part.edited_flash.invalid'));
99 99
         }
100 100
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             $this->addFlash('success', $translator->trans('part.created_flash'));
135 135
 
136 136
             return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
137
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
137
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
138 138
             $this->addFlash('error', $translator->trans('part.created_flash.invalid'));
139 139
         }
140 140
 
Please login to merge, or discard this patch.