@@ -49,7 +49,7 @@ discard block |
||
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 |
||
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 | } |
@@ -114,7 +114,7 @@ discard block |
||
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 |
||
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 |
||
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) { |
@@ -53,7 +53,7 @@ |
||
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 | ]); |
@@ -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(); |