@@ -149,7 +149,7 @@ |
||
149 | 149 | ->add('theme', ChoiceType::class, [ |
150 | 150 | 'required' => false, |
151 | 151 | 'choices' => User::AVAILABLE_THEMES, |
152 | - 'choice_label' => function ($entity, $key, $value) { |
|
152 | + 'choice_label' => function($entity, $key, $value) { |
|
153 | 153 | return $value; |
154 | 154 | }, |
155 | 155 | 'attr' => ['class' => 'selectpicker'], |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } catch (AttachmentDownloadException $ex) { |
105 | 105 | $this->addFlash( |
106 | 106 | 'error', |
107 | - $translator->trans('attachment.download_failed') . ' ' . $ex->getMessage() |
|
107 | + $translator->trans('attachment.download_failed').' '.$ex->getMessage() |
|
108 | 108 | ); |
109 | 109 | } |
110 | 110 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $this->addFlash('info', $translator->trans('part.edited_flash')); |
116 | 116 | //Reload form, so the SIUnitType entries use the new part unit |
117 | 117 | $form = $this->createForm(PartBaseType::class, $part); |
118 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
118 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
119 | 119 | $this->addFlash('error', $translator->trans('part.edited_flash.invalid')); |
120 | 120 | } |
121 | 121 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | { |
138 | 138 | $this->denyAccessUnlessGranted('delete', $part); |
139 | 139 | |
140 | - if ($this->isCsrfTokenValid('delete' . $part->getId(), $request->request->get('_token'))) { |
|
140 | + if ($this->isCsrfTokenValid('delete'.$part->getId(), $request->request->get('_token'))) { |
|
141 | 141 | $entityManager = $this->getDoctrine()->getManager(); |
142 | 142 | |
143 | 143 | //Remove part |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } catch (AttachmentDownloadException $ex) { |
191 | 191 | $this->addFlash( |
192 | 192 | 'error', |
193 | - $translator->trans('attachment.download_failed') . ' ' . $ex->getMessage() |
|
193 | + $translator->trans('attachment.download_failed').' '.$ex->getMessage() |
|
194 | 194 | ); |
195 | 195 | } |
196 | 196 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); |
203 | 203 | } |
204 | 204 | |
205 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
205 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
206 | 206 | $this->addFlash('error', $translator->trans('part.created_flash.invalid')); |
207 | 207 | } |
208 | 208 |
@@ -129,7 +129,7 @@ |
||
129 | 129 | //Check the secure file checkbox, if file is in securefile location |
130 | 130 | $builder->get('secureFile')->addEventListener( |
131 | 131 | FormEvents::PRE_SET_DATA, |
132 | - function (FormEvent $event) { |
|
132 | + function(FormEvent $event) { |
|
133 | 133 | $attachment = $event->getForm()->getParent()->getData(); |
134 | 134 | if ($attachment instanceof Attachment) { |
135 | 135 | $event->setData($attachment->isSecure()); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | protected $httpClient; |
73 | 73 | protected $mimeTypes; |
74 | 74 | |
75 | - public function __construct (AttachmentPathResolver $pathResolver, bool $allow_attachments_downloads, |
|
75 | + public function __construct(AttachmentPathResolver $pathResolver, bool $allow_attachments_downloads, |
|
76 | 76 | HttpClientInterface $httpClient, MimeTypesInterface $mimeTypes) |
77 | 77 | { |
78 | 78 | $this->pathResolver = $pathResolver; |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $attachment->getName() |
122 | 122 | ); |
123 | 123 | |
124 | - return $safeName . '-' . uniqid('', false) . '.' . $extension; |
|
124 | + return $safeName.'-'.uniqid('', false).'.'.$extension; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | //Ensure the given attachment class is known to mapping |
142 | 142 | if (!isset($this->folder_mapping[get_class($attachment)])) { |
143 | 143 | throw new \InvalidArgumentException( |
144 | - 'The given attachment class is not known! The passed class was: ' . get_class($attachment) |
|
144 | + 'The given attachment class is not known! The passed class was: '.get_class($attachment) |
|
145 | 145 | ); |
146 | 146 | } |
147 | 147 | //Ensure the attachment has an assigned element |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | |
154 | 154 | //Build path |
155 | 155 | return |
156 | - $base_path . DIRECTORY_SEPARATOR //Base path |
|
157 | - . $this->folder_mapping[get_class($attachment)] . DIRECTORY_SEPARATOR . $attachment->getElement()->getID(); |
|
156 | + $base_path.DIRECTORY_SEPARATOR //Base path |
|
157 | + . $this->folder_mapping[get_class($attachment)].DIRECTORY_SEPARATOR.$attachment->getElement()->getID(); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | $ext = pathinfo($filename, PATHINFO_EXTENSION); |
229 | 229 | $new_path = $this->generateAttachmentPath($attachment, $secure_location) |
230 | - . DIRECTORY_SEPARATOR . $this->generateAttachmentFilename($attachment, $ext); |
|
230 | + . DIRECTORY_SEPARATOR.$this->generateAttachmentFilename($attachment, $ext); |
|
231 | 231 | |
232 | 232 | //Move file to new directory |
233 | 233 | $fs = new Filesystem(); |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | |
258 | 258 | $fs = new Filesystem(); |
259 | 259 | $attachment_folder = $this->generateAttachmentPath($attachment, $options['secure_attachment']); |
260 | - $tmp_path = $attachment_folder . DIRECTORY_SEPARATOR . $this->generateAttachmentFilename($attachment, 'tmp'); |
|
260 | + $tmp_path = $attachment_folder.DIRECTORY_SEPARATOR.$this->generateAttachmentFilename($attachment, 'tmp'); |
|
261 | 261 | |
262 | 262 | try { |
263 | 263 | $response = $this->httpClient->request('GET', $url, [ |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | ]); |
266 | 266 | |
267 | 267 | if (200 !== $response->getStatusCode()) { |
268 | - throw new AttachmentDownloadException('Status code: ' . $response->getStatusCode()); |
|
268 | + throw new AttachmentDownloadException('Status code: '.$response->getStatusCode()); |
|
269 | 269 | } |
270 | 270 | |
271 | 271 | //Open a temporary file in the attachment folder |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } |
307 | 307 | |
308 | 308 | //Rename the file to its new name and save path to attachment entity |
309 | - $new_path = $attachment_folder . DIRECTORY_SEPARATOR . $this->generateAttachmentFilename($attachment, $new_ext); |
|
309 | + $new_path = $attachment_folder.DIRECTORY_SEPARATOR.$this->generateAttachmentFilename($attachment, $new_ext); |
|
310 | 310 | $fs->rename($tmp_path, $new_path); |
311 | 311 | |
312 | 312 | //Make our file path relative to %BASE% |
@@ -49,9 +49,9 @@ 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 | $securePath = $this->pathResolver->getSecurePath(); |
54 | - $io->note("The secure media path is ". $securePath); |
|
54 | + $io->note("The secure media path is ".$securePath); |
|
55 | 55 | |
56 | 56 | $finder = new Finder(); |
57 | 57 | //We look for files in the media folder only |
@@ -110,8 +110,8 @@ discard block |
||
110 | 110 | */ |
111 | 111 | protected function removeEmptySubFolders($path) |
112 | 112 | { |
113 | - $empty=true; |
|
114 | - foreach (glob($path . DIRECTORY_SEPARATOR . "*") as $file) |
|
113 | + $empty = true; |
|
114 | + foreach (glob($path.DIRECTORY_SEPARATOR."*") as $file) |
|
115 | 115 | { |
116 | 116 | $empty &= is_dir($file) && $this->removeEmptySubFolders($file); |
117 | 117 | } |
@@ -55,7 +55,7 @@ |
||
55 | 55 | $banner = $this->getParameter('banner'); |
56 | 56 | if (empty($banner)) { |
57 | 57 | $banner_path = $this->kernel->getProjectDir() |
58 | - . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'banner.md'; |
|
58 | + . DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'banner.md'; |
|
59 | 59 | |
60 | 60 | return file_get_contents($banner_path); |
61 | 61 | } |
@@ -173,6 +173,6 @@ |
||
173 | 173 | |
174 | 174 | $sz = 'BKMGTP'; |
175 | 175 | $factor = (int) floor((strlen($bytes) - 1) / 3); |
176 | - return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor]; |
|
176 | + return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor]; |
|
177 | 177 | } |
178 | 178 | } |
179 | 179 | \ No newline at end of file |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | protected function configureOptions(OptionsResolver $resolver) |
57 | 57 | { |
58 | 58 | $resolver->setDefaults([ |
59 | - 'limit' => 15, //Given only 15 entries |
|
59 | + 'limit' => 15, //Given only 15 entries |
|
60 | 60 | //'allowed_extensions' => [], //Filter the filenames. For example ['jpg', 'jpeg'] to only get jpegs. |
61 | 61 | //'placeholders' => Attachment::BUILTIN_PLACEHOLDER, //By default use all builtin ressources, |
62 | 62 | 'empty_returns_all' => false //Return the whole list of ressources when empty keyword is given |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | public function getListOfRessources() : array |
73 | 73 | { |
74 | 74 | try { |
75 | - return $this->cache->get('attachment_builtin_ressources', function () { |
|
75 | + return $this->cache->get('attachment_builtin_ressources', function() { |
|
76 | 76 | $results = []; |
77 | 77 | |
78 | 78 | $finder = new Finder(); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | } */ |
147 | 147 | |
148 | 148 | //Ignore case |
149 | - $regex = '/.*' . $keyword . '.*/i'; |
|
149 | + $regex = '/.*'.$keyword.'.*/i'; |
|
150 | 150 | |
151 | 151 | return preg_grep($regex, $base_list); |
152 | 152 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | self::$utc_timezone |
74 | 74 | ); |
75 | 75 | |
76 | - if (! $converted) { |
|
76 | + if (!$converted) { |
|
77 | 77 | throw ConversionException::conversionFailedFormat( |
78 | 78 | $value, |
79 | 79 | $this->getName(), |