Completed
Push — master ( ac238c...da4625 )
by Jan
04:59
created
src/Command/CleanAttachmentsCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         $io = new SymfonyStyle($input, $output);
50 50
 
51 51
         $mediaPath = $this->pathResolver->getMediaPath();
52
-        $io->note("The media path is " . $mediaPath);
52
+        $io->note("The media path is ".$mediaPath);
53 53
 
54 54
         $finder = new Finder();
55 55
         //We look for files in the media folder only
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
      */
107 107
     protected function removeEmptySubFolders($path)
108 108
     {
109
-        $empty=true;
110
-        foreach (glob($path . DIRECTORY_SEPARATOR . "*") as $file)
109
+        $empty = true;
110
+        foreach (glob($path.DIRECTORY_SEPARATOR."*") as $file)
111 111
         {
112 112
             $empty &= is_dir($file) && $this->removeEmptySubFolders($file);
113 113
         }
Please login to merge, or discard this patch.
src/Services/Attachments/AttachmentPathResolver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         }
115 115
 
116 116
         //Otherwise prepend the project path
117
-        $tmp = realpath($this->project_dir . DIRECTORY_SEPARATOR . $param_path);
117
+        $tmp = realpath($this->project_dir.DIRECTORY_SEPARATOR.$param_path);
118 118
 
119 119
         //If path does not exist then disable the placeholder
120 120
         if ($tmp === false) {
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 
139 139
         foreach ($array as $item) {
140 140
             $item = str_replace(['\\'], ['/'], $item);
141
-            $ret[] = '/' . preg_quote($item, '/') . '/';
141
+            $ret[] = '/'.preg_quote($item, '/').'/';
142 142
         }
143 143
 
144 144
         return $ret;
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         //Older path entries are given via %BASE% which was the project root
158 158
 
159 159
         $count = 0;
160
-        $placeholder_path = preg_replace($this->placeholders_regex, $this->pathes, $placeholder_path,-1,$count);
160
+        $placeholder_path = preg_replace($this->placeholders_regex, $this->pathes, $placeholder_path, -1, $count);
161 161
 
162 162
         //A valid placeholder can have only one
163 163
         if ($count !== 1) {
Please login to merge, or discard this patch.
src/Services/BuiltinAttachmentsFinder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
     protected function configureOptions(OptionsResolver $resolver)
54 54
     {
55 55
         $resolver->setDefaults([
56
-            'limit' => 15,  //Given only 15 entries
56
+            'limit' => 15, //Given only 15 entries
57 57
             'filename_filter' => '', //Filter the filenames. For example *.jpg to only get jpegs. Can also be an array
58 58
             'placeholders' => Attachment::BUILTIN_PLACEHOLDER, //By default use all builtin ressources
59 59
         ]);
Please login to merge, or discard this patch.
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.