@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $attachments = $form['attachments']; |
| 95 | 95 | foreach ($attachments as $attachment) { |
| 96 | 96 | /** @var $attachment FormInterface */ |
| 97 | - $attachmentHelper->upload( $attachment->getData(), $attachment['file']->getData()); |
|
| 97 | + $attachmentHelper->upload($attachment->getData(), $attachment['file']->getData()); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $this->addFlash('info', $translator->trans('part.edited_flash')); |
| 104 | 104 | //Reload form, so the SIUnitType entries use the new part unit |
| 105 | 105 | $form = $this->createForm(PartBaseType::class, $part); |
| 106 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
| 106 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
| 107 | 107 | $this->addFlash('error', $translator->trans('part.edited_flash.invalid')); |
| 108 | 108 | } |
| 109 | 109 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | { |
| 126 | 126 | $this->denyAccessUnlessGranted('delete', $part); |
| 127 | 127 | |
| 128 | - if ($this->isCsrfTokenValid('delete' . $part->getId(), $request->request->get('_token'))) { |
|
| 128 | + if ($this->isCsrfTokenValid('delete'.$part->getId(), $request->request->get('_token'))) { |
|
| 129 | 129 | $entityManager = $this->getDoctrine()->getManager(); |
| 130 | 130 | |
| 131 | 131 | //Remove part |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $attachments = $form['attachments']; |
| 170 | 170 | foreach ($attachments as $attachment) { |
| 171 | 171 | /** @var $attachment FormInterface */ |
| 172 | - $attachmentHelper->upload( $attachment->getData(), $attachment['file']->getData()); |
|
| 172 | + $attachmentHelper->upload($attachment->getData(), $attachment['file']->getData()); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | $em->persist($new_part); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $this->addFlash('success', $translator->trans('part.created_flash')); |
| 178 | 178 | |
| 179 | 179 | return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]); |
| 180 | - } elseif ($form->isSubmitted() && ! $form->isValid()) { |
|
| 180 | + } elseif ($form->isSubmitted() && !$form->isValid()) { |
|
| 181 | 181 | $this->addFlash('error', $translator->trans('part.created_flash.invalid')); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -66,12 +66,12 @@ |
||
| 66 | 66 | //Disable import if user is not allowed to create elements. |
| 67 | 67 | $entity = new $data['entity_class'](); |
| 68 | 68 | $perm_name = "create"; |
| 69 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
| 69 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
| 70 | 70 | |
| 71 | 71 | $builder |
| 72 | 72 | |
| 73 | 73 | ->add('format', ChoiceType::class, [ |
| 74 | - 'choices' => ['JSON' => 'json', 'XML' => 'xml','CSV' => 'csv' ,'YAML' => 'yaml'], |
|
| 74 | + 'choices' => ['JSON' => 'json', 'XML' => 'xml', 'CSV' => 'csv', 'YAML' => 'yaml'], |
|
| 75 | 75 | 'label' => $this->trans->trans('export.format'), |
| 76 | 76 | 'disabled' => $disabled]) |
| 77 | 77 | ->add('csv_separator', TextType::class, ['data' => ';', |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | //Disable import if user is not allowed to create elements. |
| 66 | 66 | $entity = new $data['entity_class'](); |
| 67 | 67 | $perm_name = "create"; |
| 68 | - $disabled = ! $this->security->isGranted($perm_name, $entity); |
|
| 68 | + $disabled = !$this->security->isGranted($perm_name, $entity); |
|
| 69 | 69 | |
| 70 | 70 | $builder |
| 71 | 71 | ->add('lines', TextareaType::class, ['data' => '', |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | 'label' => $this->trans->trans('entity.edit.not_selectable'), |
| 84 | 84 | 'help' => $this->trans->trans('entity.edit.not_selectable.help'), |
| 85 | 85 | 'label_attr' => ['class' => 'checkbox-custom'], |
| 86 | - 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity) ]) |
|
| 86 | + 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity)]) |
|
| 87 | 87 | |
| 88 | 88 | ->add('comment', CKEditorType::class, ['required' => false, 'empty_data' => '', |
| 89 | 89 | 'label' => $this->trans->trans('comment.label'), |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | //Buttons |
| 96 | 96 | $builder->add('save', SubmitType::class, [ |
| 97 | - 'label' => $is_new ? $this->trans->trans('entity.create') : $this->trans->trans('entity.edit.save'), |
|
| 97 | + 'label' => $is_new ? $this->trans->trans('entity.create') : $this->trans->trans('entity.edit.save'), |
|
| 98 | 98 | 'attr' => ['class' => $is_new ? 'btn-success' : ''], |
| 99 | 99 | 'disabled' => !$this->security->isGranted($is_new ? 'create' : 'edit', $entity)]) |
| 100 | 100 | ->add('reset', ResetType::class, ['label' => 'entity.edit.reset', |
@@ -217,12 +217,12 @@ |
||
| 217 | 217 | 'label' => $this->trans->trans('part.edit.master_attachment'), |
| 218 | 218 | 'class' => PartAttachment::class, |
| 219 | 219 | 'attr' => ['class' => 'selectpicker'], |
| 220 | - 'choice_attr' => function ($choice, $key, $value) { |
|
| 220 | + 'choice_attr' => function($choice, $key, $value) { |
|
| 221 | 221 | /** @var Attachment $choice */ |
| 222 | 222 | return ['data-subtext' => $choice->getFilename() ?? "URL"]; |
| 223 | 223 | }, |
| 224 | 224 | 'choice_label' => 'name', |
| 225 | - 'query_builder' => function (EntityRepository $er) use ($part) { |
|
| 225 | + 'query_builder' => function(EntityRepository $er) use ($part) { |
|
| 226 | 226 | if ($part->getID() == null) { |
| 227 | 227 | //This query is always false, so we get empty results |
| 228 | 228 | return $er->createQueryBuilder('u')->where('0 = 2'); |
@@ -58,8 +58,8 @@ |
||
| 58 | 58 | |
| 59 | 59 | $resolver->setRequired('property'); |
| 60 | 60 | |
| 61 | - $resolver->setDefault('field', function (Options $option) { |
|
| 62 | - return $option['property'] . '.name'; |
|
| 61 | + $resolver->setDefault('field', function(Options $option) { |
|
| 62 | + return $option['property'].'.name'; |
|
| 63 | 63 | }); |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 | 66 | \ No newline at end of file |
@@ -107,12 +107,12 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | if (isset($options['tag'])) { |
| 110 | - $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%' . $options['tag'] . '%'); |
|
| 110 | + $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%'.$options['tag'].'%'); |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | if (isset($options['search'])) { |
| 114 | 114 | $builder->AndWhere('part.name LIKE :search')->orWhere('part.description LIKE :search')->orWhere('part.comment LIKE :search') |
| 115 | - ->setParameter('search', '%' . $options['search'] . '%'); |
|
| 115 | + ->setParameter('search', '%'.$options['search'].'%'); |
|
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 | |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | $dataTable |
| 126 | 126 | ->add('name', TextColumn::class, [ |
| 127 | 127 | 'label' => $this->translator->trans('part.table.name'), |
| 128 | - 'render' => function ($value, Part $context) { |
|
| 128 | + 'render' => function($value, Part $context) { |
|
| 129 | 129 | return sprintf( |
| 130 | 130 | '<a href="%s">%s</a>', |
| 131 | 131 | $this->urlGenerator->infoURL($context), |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | }, |
| 224 | 224 | 'entity' => Part::class, |
| 225 | 225 | 'criteria' => [ |
| 226 | - function (QueryBuilder $builder) use ($options) { |
|
| 226 | + function(QueryBuilder $builder) use ($options) { |
|
| 227 | 227 | $this->buildCriteria($builder, $options); |
| 228 | 228 | }, |
| 229 | 229 | new SearchCriteriaProvider() |