@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | ->select('e'); |
| 130 | 130 | //Add fields criteria |
| 131 | 131 | foreach ($properties as $key => $property) { |
| 132 | - $qb->orWhere('e.' . $property . ' LIKE ?' . $key); |
|
| 132 | + $qb->orWhere('e.'.$property.' LIKE ?'.$key); |
|
| 133 | 133 | $qb->setParameter($key, static::BBCODE_CRITERIA); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | foreach ($results as $result) { |
| 142 | 142 | /** @var NamedDBElement $result */ |
| 143 | 143 | $io->writeln( |
| 144 | - 'Convert entity: ' . $result->getName() . ' (' . $result->getIDString() . ')', |
|
| 144 | + 'Convert entity: '.$result->getName().' ('.$result->getIDString().')', |
|
| 145 | 145 | OutputInterface::VERBOSITY_VERBOSE |
| 146 | 146 | ); |
| 147 | 147 | foreach ($properties as $property) { |
@@ -49,8 +49,8 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function getGitBranchName() |
| 51 | 51 | { |
| 52 | - if (file_exists($this->project_dir . '/.git/HEAD')) { |
|
| 53 | - $git = file($this->project_dir . '/.git/HEAD'); |
|
| 52 | + if (file_exists($this->project_dir.'/.git/HEAD')) { |
|
| 53 | + $git = file($this->project_dir.'/.git/HEAD'); |
|
| 54 | 54 | $head = explode('/', $git[0], 3); |
| 55 | 55 | return trim($head[2]); |
| 56 | 56 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function getGitCommitHash(int $length = 7) |
| 67 | 67 | { |
| 68 | - $filename = $this->project_dir . '/.git/refs/remotes/origin/' . $this->getGitBranchName(); |
|
| 68 | + $filename = $this->project_dir.'/.git/refs/remotes/origin/'.$this->getGitBranchName(); |
|
| 69 | 69 | if (file_exists($filename)) { |
| 70 | 70 | $head = file($filename); |
| 71 | 71 | $hash = $head[0]; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | //Show permissions to user |
| 145 | - $builder = $this->createFormBuilder()->add('permissions',PermissionsType::class, [ |
|
| 145 | + $builder = $this->createFormBuilder()->add('permissions', PermissionsType::class, [ |
|
| 146 | 146 | 'mapped' => false, |
| 147 | 147 | 'disabled' => true, |
| 148 | 148 | 'inherit' => true, |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | $page_need_reload = false; |
| 170 | 170 | |
| 171 | - if(!$user instanceof User) { |
|
| 171 | + if (!$user instanceof User) { |
|
| 172 | 172 | return new \RuntimeException("This controller only works only for Part-DB User objects!"); |
| 173 | 173 | } |
| 174 | 174 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | 'required' => false, |
| 78 | 78 | 'attr' => ['class' => 'selectpicker'], |
| 79 | 79 | 'choices' => User::AVAILABLE_THEMES, |
| 80 | - 'choice_label' => function ($entity, $key, $value) { |
|
| 80 | + 'choice_label' => function($entity, $key, $value) { |
|
| 81 | 81 | return $value; |
| 82 | 82 | }, |
| 83 | 83 | 'placeholder' => $this->trans->trans('user_settings.theme.placeholder'), |
@@ -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'], |
@@ -165,7 +165,7 @@ |
||
| 165 | 165 | |
| 166 | 166 | $sz = 'BKMGTP'; |
| 167 | 167 | $factor = (int) floor((strlen($bytes) - 1) / 3); |
| 168 | - return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor) . @$sz[$factor]; |
|
| 168 | + return sprintf("%.{$decimals}f", $bytes / 1024 ** $factor).@$sz[$factor]; |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } catch (AttachmentDownloadException $ex) { |
| 116 | 116 | $this->addFlash( |
| 117 | 117 | 'error', |
| 118 | - $this->translator->trans('attachment.download_failed') . ' ' . $ex->getMessage() |
|
| 118 | + $this->translator->trans('attachment.download_failed').' '.$ex->getMessage() |
|
| 119 | 119 | ); |
| 120 | 120 | } |
| 121 | 121 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | //Rebuild form, so it is based on the updated data. Important for the parent field! |
| 128 | 128 | //We can not use dynamic form events here, because the parent entity list is build from database! |
| 129 | 129 | $form = $this->createForm($this->form_class, $entity, ['attachment_class' => $this->attachment_class]); |
| 130 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
| 130 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
| 131 | 131 | $this->addFlash('error', $this->translator->trans('entity.edit_flash.invalid')); |
| 132 | 132 | } |
| 133 | 133 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } catch (AttachmentDownloadException $ex) { |
| 172 | 172 | $this->addFlash( |
| 173 | 173 | 'error', |
| 174 | - $this->translator->trans('attachment.download_failed') . ' ' . $ex->getMessage() |
|
| 174 | + $this->translator->trans('attachment.download_failed').' '.$ex->getMessage() |
|
| 175 | 175 | ); |
| 176 | 176 | } |
| 177 | 177 | } |
@@ -180,10 +180,10 @@ discard block |
||
| 180 | 180 | $em->flush(); |
| 181 | 181 | $this->addFlash('success', $this->translator->trans('entity.created_flash')); |
| 182 | 182 | |
| 183 | - return $this->redirectToRoute($this->route_base . '_edit', ['id' => $new_entity->getID()]); |
|
| 183 | + return $this->redirectToRoute($this->route_base.'_edit', ['id' => $new_entity->getID()]); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | - if ($form->isSubmitted() && ! $form->isValid()) { |
|
| 186 | + if ($form->isSubmitted() && !$form->isValid()) { |
|
| 187 | 187 | $this->addFlash('error', $this->translator->trans('entity.created_flash.invalid')); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | |
| 204 | 204 | foreach ($errors as $name => $error) { |
| 205 | 205 | /** @var $error ConstraintViolationList */ |
| 206 | - $this->addFlash('error', $name . ':' . $error); |
|
| 206 | + $this->addFlash('error', $name.':'.$error); |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | //Show errors to user: |
| 223 | 223 | foreach ($errors as $name => $error) { |
| 224 | 224 | /** @var $error ConstraintViolationList */ |
| 225 | - $this->addFlash('error', $name . ':' . $error); |
|
| 225 | + $this->addFlash('error', $name.':'.$error); |
|
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | 228 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $this->addFlash('success', 'attachment_type.deleted'); |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | - return $this->redirectToRoute($this->route_base . '_new'); |
|
| 269 | + return $this->redirectToRoute($this->route_base.'_new'); |
|
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | protected function _exportAll(EntityManagerInterface $em, EntityExporter $exporter, Request $request) |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | $entities = $em->getRepository($this->entity_class)->findAll(); |
| 279 | 279 | |
| 280 | - return $exporter->exportEntityFromRequest($entities,$request); |
|
| 280 | + return $exporter->exportEntityFromRequest($entities, $request); |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | protected function _exportEntity(NamedDBElement $entity, EntityExporter $exporter, Request $request) |
@@ -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()); |