Passed
Push — master ( 490f70...21cf97 )
by Jan
15:26
created
src/Form/AdminPages/SupplierForm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             'required' => false,
72 72
             'label' => 'supplier.edit.default_currency',
73 73
             'disable_not_selectable' => true,
74
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
74
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
75 75
         ]);
76 76
 
77 77
         $builder->add('shipping_costs', BigDecimalMoneyType::class, [
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             'currency' => $this->default_currency,
80 80
             'scale' => 3,
81 81
             'label' => 'supplier.shipping_costs.label',
82
-            'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
82
+            'disabled' => !$this->security->isGranted($is_new ? 'create' : 'move', $entity),
83 83
         ]);
84 84
     }
85 85
 }
Please login to merge, or discard this patch.
src/Controller/SelectAPIController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -107,12 +107,12 @@
 block discarded – undo
107 107
         foreach ($nodes_list as $node) {
108 108
             /** @var AbstractStructuralDBElement $node */
109 109
             $entry = [
110
-                'text' => str_repeat('   ', $node->getLevel()) . htmlspecialchars($node->getName()),
110
+                'text' => str_repeat('   ', $node->getLevel()).htmlspecialchars($node->getName()),
111 111
                 'value' => $node->getID(),
112 112
                 'data-subtext' => $node->getParent() ? $node->getParent()->getFullPath() : null,
113 113
             ];
114 114
 
115
-            $entries[] =  $entry;
115
+            $entries[] = $entry;
116 116
         }
117 117
 
118 118
         return $entries;
Please login to merge, or discard this patch.
src/Services/Parts/PartsTableActionHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@
 block discarded – undo
99 99
                     break;
100 100
 
101 101
                 default:
102
-                    throw new \InvalidArgumentException('The given action is unknown! (' . $action . ')');
102
+                    throw new \InvalidArgumentException('The given action is unknown! ('.$action.')');
103 103
             }
104 104
         }
105 105
     }
Please login to merge, or discard this patch.
src/DataTables/AttachmentDataTable.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
     {
80 80
         $dataTable->add('picture', TextColumn::class, [
81 81
             'label' => '',
82
-            'render' => function ($value, Attachment $context) {
82
+            'render' => function($value, Attachment $context) {
83 83
                 if ($context->isPicture()
84
-                    && ! $context->isExternal()
84
+                    && !$context->isExternal()
85 85
                     && $this->attachmentHelper->isFileExisting($context)) {
86 86
 
87 87
                     $title = htmlspecialchars($context->getName());
88 88
                     if ($context->getFilename()) {
89
-                        $title .= ' (' . htmlspecialchars($context->getFilename()) . ')';
89
+                        $title .= ' ('.htmlspecialchars($context->getFilename()).')';
90 90
                     }
91 91
 
92 92
                     return sprintf(
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
         $dataTable->add('name', TextColumn::class, [
107 107
             'label' => 'attachment.edit.name',
108
-            'render' => function ($value, Attachment $context) {
108
+            'render' => function($value, Attachment $context) {
109 109
                 //Link to external source
110 110
                 if ($context->isExternal()) {
111 111
                     return sprintf(
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
         $dataTable->add('attachment_type', TextColumn::class, [
131 131
             'label' => 'attachment.table.type',
132 132
             'field' => 'attachment_type.name',
133
-            'render' => function ($value, Attachment $context) {
133
+            'render' => function($value, Attachment $context) {
134 134
                 return sprintf(
135 135
                     '<a href="%s">%s</a>',
136 136
                     $this->entityURLGenerator->editURL($context->getAttachmentType()),
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         $dataTable->add('element', TextColumn::class, [
143 143
             'label' => 'attachment.table.element',
144 144
             //'propertyPath' => 'element.name',
145
-            'render' => function ($value, Attachment $context) {
145
+            'render' => function($value, Attachment $context) {
146 146
                 return sprintf(
147 147
                     '<a href="%s">%s</a>',
148 148
                     $this->entityURLGenerator->infoURL($context->getElement()),
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
         $dataTable->add('filesize', TextColumn::class, [
160 160
             'label' => $this->translator->trans('attachment.table.filesize'),
161
-            'render' => function ($value, Attachment $context) {
161
+            'render' => function($value, Attachment $context) {
162 162
                 if ($this->attachmentHelper->isFileExisting($context)) {
163 163
                     return $this->attachmentHelper->getHumanFileSize($context);
164 164
                 }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 
223 223
         $dataTable->createAdapter(ORMAdapter::class, [
224 224
             'entity' => Attachment::class,
225
-            'query' => function (QueryBuilder $builder): void {
225
+            'query' => function(QueryBuilder $builder): void {
226 226
                 $this->getQuery($builder);
227 227
             },
228 228
         ]);
Please login to merge, or discard this patch.
src/DataTables/PartsDataTable.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         $optionsResolver->setAllowedTypes('search', ['null', 'string']);
120 120
 
121 121
         //Configure search options
122
-        $optionsResolver->setDefault('search_options', function (OptionsResolver $resolver): void {
122
+        $optionsResolver->setDefault('search_options', function(OptionsResolver $resolver): void {
123 123
             $resolver->setDefaults([
124 124
                 'name' => true,
125 125
                 'category' => true,
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $dataTable
156 156
             ->add('picture', TextColumn::class, [
157 157
                 'label' => '',
158
-                'render' => function ($value, Part $context) {
158
+                'render' => function($value, Part $context) {
159 159
                     $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($context);
160 160
                     if (null === $preview_attachment) {
161 161
                         return '';
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
                     $title = htmlspecialchars($preview_attachment->getName());
165 165
                     if ($preview_attachment->getFilename()) {
166
-                        $title .= ' (' . htmlspecialchars($preview_attachment->getFilename()) . ')';
166
+                        $title .= ' ('.htmlspecialchars($preview_attachment->getFilename()).')';
167 167
                     }
168 168
 
169 169
                     return sprintf(
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             ])
179 179
             ->add('name', TextColumn::class, [
180 180
                 'label' => $this->translator->trans('part.table.name'),
181
-                'render' => function ($value, Part $context) {
181
+                'render' => function($value, Part $context) {
182 182
                     return sprintf(
183 183
                         '<a href="%s">%s</a>',
184 184
                         $this->urlGenerator->infoURL($context),
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             ])
208 208
             ->add('storelocation', TextColumn::class, [
209 209
                 'label' => $this->translator->trans('part.table.storeLocations'),
210
-                'render' => function ($value, Part $context) {
210
+                'render' => function($value, Part $context) {
211 211
                     $tmp = [];
212 212
                     foreach ($context->getPartLots() as $lot) {
213 213
                         //Ignore lots without storelocation
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             ])
227 227
             ->add('amount', TextColumn::class, [
228 228
                 'label' => $this->translator->trans('part.table.amount'),
229
-                'render' => function ($value, Part $context) {
229
+                'render' => function($value, Part $context) {
230 230
                     $amount = $context->getAmountSum();
231 231
 
232 232
                     return $this->amountFormatter->format($amount, $context->getPartUnit());
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
             ->add('minamount', TextColumn::class, [
236 236
                 'label' => $this->translator->trans('part.table.minamount'),
237 237
                 'visible' => false,
238
-                'render' => function ($value, Part $context) {
238
+                'render' => function($value, Part $context) {
239 239
                     return $this->amountFormatter->format($value, $context->getPartUnit());
240 240
                 },
241 241
             ])
@@ -298,10 +298,10 @@  discard block
 block discarded – undo
298 298
             ->add('edit', IconLinkColumn::class, [
299 299
                 'label' => $this->translator->trans('part.table.edit'),
300 300
                 'visible' => false,
301
-                'href' => function ($value, Part $context) {
301
+                'href' => function($value, Part $context) {
302 302
                     return $this->urlGenerator->editURL($context);
303 303
                 },
304
-                'disabled' => function ($value, Part $context) {
304
+                'disabled' => function($value, Part $context) {
305 305
                     return !$this->security->isGranted('edit', $context);
306 306
                 },
307 307
                 'title' => $this->translator->trans('part.table.edit.title'),
@@ -310,12 +310,12 @@  discard block
 block discarded – undo
310 310
             ->addOrderBy('name')
311 311
             ->createAdapter(FetchJoinORMAdapter::class, [
312 312
                 'simple_total_query' => true,
313
-                'query' => function (QueryBuilder $builder): void {
313
+                'query' => function(QueryBuilder $builder): void {
314 314
                     $this->getQuery($builder);
315 315
                 },
316 316
                 'entity' => Part::class,
317 317
                 'criteria' => [
318
-                    function (QueryBuilder $builder) use ($options): void {
318
+                    function(QueryBuilder $builder) use ($options): void {
319 319
                         $this->buildCriteria($builder, $options);
320 320
                     },
321 321
                     new SearchCriteriaProvider(),
@@ -396,8 +396,8 @@  discard block
 block discarded – undo
396 396
             $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%'.$options['tag'].'%');
397 397
         }
398 398
 
399
-        if (! empty($options['search'])) {
400
-            if (! $options['search_options']['regex']) {
399
+        if (!empty($options['search'])) {
400
+            if (!$options['search_options']['regex']) {
401 401
                 //Dont show results, if no things are selected
402 402
                 $builder->andWhere('0=1');
403 403
                 $defined = false;
Please login to merge, or discard this patch.
src/Controller/PartController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
             //Reload form, so the SIUnitType entries use the new part unit
190 190
             $form = $this->createForm(PartBaseType::class, $part);
191
-        } elseif ($form->isSubmitted() && ! $form->isValid()) {
191
+        } elseif ($form->isSubmitted() && !$form->isValid()) {
192 192
             $this->addFlash('error', 'part.edited_flash.invalid');
193 193
         }
194 194
 
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
      * @return Response
233 233
      */
234 234
     public function new(Request $request, EntityManagerInterface $em, TranslatorInterface $translator,
235
-        AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null): Response
235
+        AttachmentSubmitHandler $attachmentSubmitHandler, ?Part $part = null) : Response
236 236
     {
237 237
         if (null === $part) {
238 238
             $new_part = new Part();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
             return $this->redirectToRoute('part_edit', ['id' => $new_part->getID()]);
316 316
         }
317 317
 
318
-        if ($form->isSubmitted() && ! $form->isValid()) {
318
+        if ($form->isSubmitted() && !$form->isValid()) {
319 319
             $this->addFlash('error', 'part.created_flash.invalid');
320 320
         }
321 321
 
Please login to merge, or discard this patch.
tests/Services/Attachments/AttachmentPathResolverTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
         $this->assertSame(self::$projectDir_orig, self::$service->parameterToAbsolutePath(self::$projectDir));
88 88
 
89 89
         //Relative pathes should be resolved
90
-        $expected = str_replace('\\', '/',self::$projectDir_orig.DIRECTORY_SEPARATOR.'src');
90
+        $expected = str_replace('\\', '/', self::$projectDir_orig.DIRECTORY_SEPARATOR.'src');
91 91
         $this->assertSame($expected, self::$service->parameterToAbsolutePath('src'));
92 92
         $this->assertSame($expected, self::$service->parameterToAbsolutePath('./src'));
93 93
 
Please login to merge, or discard this patch.
src/Form/AttachmentFormType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             'required' => false,
116 116
             'label' => 'attachment.edit.secure_file',
117 117
             'mapped' => false,
118
-            'disabled' => ! $this->security->isGranted('@parts_attachments.show_private'),
118
+            'disabled' => !$this->security->isGranted('@parts_attachments.show_private'),
119 119
             'attr' => [
120 120
                 'class' => 'form-control-sm',
121 121
             ],
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             'required' => false,
144 144
             'label' => 'attachment.edit.download_url',
145 145
             'mapped' => false,
146
-            'disabled' => ! $this->allow_attachments_download,
146
+            'disabled' => !$this->allow_attachments_download,
147 147
             'attr' => [
148 148
                 'class' => 'form-control-sm',
149 149
             ],
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             ],
170 170
         ]);
171 171
 
172
-        $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event): void {
172
+        $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event): void {
173 173
             $form = $event->getForm();
174 174
             $attachment = $form->getData();
175 175
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         //Check the secure file checkbox, if file is in securefile location
189 189
         $builder->get('secureFile')->addEventListener(
190 190
             FormEvents::PRE_SET_DATA,
191
-            function (FormEvent $event): void {
191
+            function(FormEvent $event): void {
192 192
                 $attachment = $event->getForm()->getParent()->getData();
193 193
                 if ($attachment instanceof Attachment) {
194 194
                     $event->setData($attachment->isSecure());
Please login to merge, or discard this patch.
src/Command/UpdateExchangeRatesCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
         $iso_code = $input->getArgument('iso_code');
98 98
         $repo = $this->em->getRepository(Currency::class);
99 99
 
100
-        if (! empty($iso_code)) {
100
+        if (!empty($iso_code)) {
101 101
             $candidates = $repo->findBy(['iso_code' => $iso_code]);
102 102
         } else {
103 103
             $candidates = $repo->findAll();
Please login to merge, or discard this patch.