Passed
Push — master ( 977fa1...0d215e )
by Jan
04:21
created
src/Form/Type/MasterPictureAttachmentType.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
         $resolver->setDefaults([
40 40
             'filter' => 'picture',
41 41
             'attr' => ['class' => 'selectpicker'],
42
-            'choice_attr' => function (Options $options) {
43
-                return  function ($choice, $key, $value) use ($options) {
42
+            'choice_attr' => function(Options $options) {
43
+                return  function($choice, $key, $value) use ($options) {
44 44
                     /** @var Attachment $choice */
45 45
                     $tmp = ['data-subtext' => $choice->getFilename() ?? 'URL'];
46 46
 
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
                 };
55 55
             },
56 56
             'choice_label' => 'name',
57
-            'class' => function (Options $options) {
57
+            'class' => function(Options $options) {
58 58
                 $short_class_name = (new \ReflectionClass($options['entity']))->getShortName();
59 59
                 //Category becomes CategoryAttachment
60 60
                 return 'App\\Entity\\Attachments\\'.$short_class_name.'Attachment';
61 61
             },
62
-            'query_builder' => function (Options $options) {
63
-                return function (EntityRepository $er) use ($options) {
62
+            'query_builder' => function(Options $options) {
63
+                return function(EntityRepository $er) use ($options) {
64 64
                     $entity = $options['entity'];
65 65
                     if (null === $entity->getID()) {
66 66
                         //This query is always false, so we get empty results
Please login to merge, or discard this patch.
src/Form/Type/SIUnitType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     {
48 48
         $resolver->setDefaults([
49 49
             'measurement_unit' => null,
50
-            'show_prefix' => function (Options $options) {
50
+            'show_prefix' => function(Options $options) {
51 51
                 if (null !== $options['measurement_unit']) {
52 52
                     /** @var MeasurementUnit $unit */
53 53
                     $unit = $options['measurement_unit'];
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
                 return false;
59 59
             },
60
-            'is_integer' => function (Options $options) {
60
+            'is_integer' => function(Options $options) {
61 61
                 if (null !== $options['measurement_unit']) {
62 62
                     /** @var MeasurementUnit $unit */
63 63
                     $unit = $options['measurement_unit'];
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
                 return false;
69 69
             },
70
-            'unit' => function (Options $options) {
70
+            'unit' => function(Options $options) {
71 71
                 if (null !== $options['measurement_unit']) {
72 72
                     /** @var MeasurementUnit $unit */
73 73
                     $unit = $options['measurement_unit'];
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $resolver->setDefaults([
88 88
                 'min' => 0,
89 89
                 'max' => '',
90
-                'step' => function (Options $options) {
90
+                'step' => function(Options $options) {
91 91
                     if (true === $options['is_integer']) {
92 92
                         return 1;
93 93
                     }
Please login to merge, or discard this patch.
src/Form/Type/StructuralEntityType.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -59,9 +59,9 @@  discard block
 block discarded – undo
59 59
     public function buildForm(FormBuilderInterface $builder, array $options)
60 60
     {
61 61
         $builder->addModelTransformer(new CallbackTransformer(
62
-            function ($value) use ($options) {
62
+            function($value) use ($options) {
63 63
                 return $this->transform($value, $options);
64
-            }, function ($value) use ($options) {
64
+            }, function($value) use ($options) {
65 65
                 return $this->reverseTransform($value, $options);
66 66
             }));
67 67
     }
@@ -71,23 +71,23 @@  discard block
 block discarded – undo
71 71
         $resolver->setRequired(['class']);
72 72
         $resolver->setDefaults([
73 73
             'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext
74
-            'subentities_of' => null,   //Only show entities with the given parent class
75
-            'disable_not_selectable' => false,  //Disable entries with not selectable property
74
+            'subentities_of' => null, //Only show entities with the given parent class
75
+            'disable_not_selectable' => false, //Disable entries with not selectable property
76 76
             'choice_value' => 'id', //Use the element id as option value and for comparing items
77
-            'choice_loader' => function (Options $options) {
78
-                return new CallbackChoiceLoader(function () use ($options) {
77
+            'choice_loader' => function(Options $options) {
78
+                return new CallbackChoiceLoader(function() use ($options) {
79 79
                     return $this->getEntries($options);
80 80
                 });
81
-            }, 'choice_label' => function ($choice, $key, $value) {
81
+            }, 'choice_label' => function($choice, $key, $value) {
82 82
                 return $this->generateChoiceLabels($choice, $key, $value);
83
-            }, 'choice_attr' => function ($choice, $key, $value) {
83
+            }, 'choice_attr' => function($choice, $key, $value) {
84 84
                 return $this->generateChoiceAttr($choice, $key, $value);
85 85
             },
86 86
         ]);
87 87
 
88 88
         $resolver->setDefault('empty_message', null);
89 89
 
90
-        $resolver->setDefault('attr', function (Options $options) {
90
+        $resolver->setDefault('attr', function(Options $options) {
91 91
             $tmp = ['class' => 'selectpicker', 'data-live-search' => true];
92 92
             if ($options['empty_message']) {
93 93
                 $tmp['data-none-Selected-Text'] = $options['empty_message'];
Please login to merge, or discard this patch.
src/Form/Permissions/PermissionsType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     {
46 46
         $resolver->setDefaults([
47 47
             'show_legend' => true,
48
-            'constraints' => function (Options $options) {
48
+            'constraints' => function(Options $options) {
49 49
                 if (!$options['disabled']) {
50 50
                     return [new NoLockout()];
51 51
                 }
Please login to merge, or discard this patch.
src/Controller/PartController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
         $cid = $request->get('cid', 1);
152 152
 
153 153
         $category = $em->find(Category::class, $cid);
154
-        if($category !== null) {
154
+        if ($category !== null) {
155 155
             $new_part->setCategory($category);
156 156
         }
157 157
 
Please login to merge, or discard this patch.
src/DataTables/PartsDataTable.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         $dataTable
162 162
             ->add('picture', TextColumn::class, [
163 163
                 'label' => '',
164
-                'render' => function ($value, Part $context) {
164
+                'render' => function($value, Part $context) {
165 165
                     $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($context);
166 166
                     if (null === $preview_attachment) {
167 167
                         return '';
@@ -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,12 +298,12 @@  discard block
 block discarded – undo
298 298
 
299 299
             ->addOrderBy('name')
300 300
             ->createAdapter(CustomORMAdapter::class, [
301
-                'query' => function (QueryBuilder $builder) {
301
+                'query' => function(QueryBuilder $builder) {
302 302
                     $this->getQuery($builder);
303 303
                 },
304 304
                 'entity' => Part::class,
305 305
                 'criteria' => [
306
-                    function (QueryBuilder $builder) use ($options) {
306
+                    function(QueryBuilder $builder) use ($options) {
307 307
                         $this->buildCriteria($builder, $options);
308 308
                     },
309 309
                     new SearchCriteriaProvider(),
Please login to merge, or discard this patch.
src/DataTables/Column/PartAttachmentsColumn.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             throw new \RuntimeException('$context must be a Part object!');
65 65
         }
66 66
         $tmp = "";
67
-        $attachments = $context->getAttachments()->filter(function (Attachment $attachment) {
67
+        $attachments = $context->getAttachments()->filter(function(Attachment $attachment) {
68 68
             return $attachment->getShowInTable() && $this->attachmentManager->isFileExisting($attachment);
69 69
         });
70 70
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $tmp .= sprintf(
79 79
                 '<a href="%s" title="%s" class="attach-table-icon" target="_blank" rel="noopener" data-no-ajax>%s</a>',
80 80
                 $this->urlGenerator->viewURL($attachment),
81
-                htmlspecialchars($attachment->getName()) . ': ' . htmlspecialchars($attachment->getFilename()),
81
+                htmlspecialchars($attachment->getName()).': '.htmlspecialchars($attachment->getFilename()),
82 82
                 $this->FAIconGenerator->generateIconHTML(
83 83
                     // Sometimes the extension can not be determined, so ensure a generic icon is shown
84 84
                     $this->FAIconGenerator->fileExtensionToFAType($attachment->getExtension() ?? 'file'),
Please login to merge, or discard this patch.