Completed
Push — master ( 16139d...720e1c )
by Jan
04:22
created
src/Controller/PartController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Form/AdminPages/ImportType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,12 +66,12 @@
 block discarded – undo
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' => ';',
Please login to merge, or discard this patch.
src/Form/AdminPages/MassCreationForm.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
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' => '',
Please login to merge, or discard this patch.
src/Form/AdminPages/BaseEntityAdminForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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',
Please login to merge, or discard this patch.
src/Form/Part/PartBaseType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -217,12 +217,12 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
src/DataTables/PartsDataTable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -70,12 +70,12 @@  discard block
 block discarded – undo
70 70
         }
71 71
 
72 72
         if (isset($options['tag'])) {
73
-            $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%' . $options['tag'] . '%');
73
+            $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%'.$options['tag'].'%');
74 74
         }
75 75
 
76 76
         if (isset($options['search'])) {
77 77
             $builder->AndWhere('part.name LIKE :search')->orWhere('part.description LIKE :search')->orWhere('part.comment LIKE :search')
78
-                ->setParameter('search', '%' . $options['search'] . '%');
78
+                ->setParameter('search', '%'.$options['search'].'%');
79 79
         }
80 80
     }
81 81
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
         $dataTable
89 89
             ->add('name', TextColumn::class, [
90 90
                 'label' => $this->translator->trans('part.table.name'),
91
-                'render' => function ($value, Part $context) {
91
+                'render' => function($value, Part $context) {
92 92
                     return $this->urlGenerator->infoHTML($context);
93 93
                 },
94 94
             ])
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             ->createAdapter(ORMAdapter::class, [
168 168
                 'entity' => Part::class,
169 169
                 'criteria' => [
170
-                    function (QueryBuilder $builder) use ($options) {
170
+                    function(QueryBuilder $builder) use ($options) {
171 171
                         $this->buildCriteria($builder, $options);
172 172
                     },
173 173
                     new SearchCriteriaProvider()
Please login to merge, or discard this patch.