Completed
Push — master ( 6799ac...2872e3 )
by Jan
04:56
created
src/Form/Type/MasterPictureAttachmentType.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
         $resolver->setDefaults([
52 52
             'filter' => 'picture',
53 53
             'attr' => ['class' => 'selectpicker'],
54
-            'choice_attr' => function (Options $options) {
55
-                return  function ($choice, $key, $value) use ($options) {
54
+            'choice_attr' => function(Options $options) {
55
+                return  function($choice, $key, $value) use ($options) {
56 56
                     /** @var Attachment $choice */
57 57
                     $tmp = ['data-subtext' => $choice->getFilename() ?? 'URL'];
58 58
 
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
                 };
65 65
             },
66 66
             'choice_label' => 'name',
67
-            'class' => function (Options $options) {
67
+            'class' => function(Options $options) {
68 68
                 $short_class_name = (new \ReflectionClass($options['entity']))->getShortName();
69 69
                 //Category becomes CategoryAttachment
70
-                return 'App\\Entity\\Attachments\\' . $short_class_name . 'Attachment';
70
+                return 'App\\Entity\\Attachments\\'.$short_class_name.'Attachment';
71 71
             },
72
-            'query_builder' => function (Options $options) {
73
-                return function (EntityRepository $er) use ($options) {
72
+            'query_builder' => function(Options $options) {
73
+                return function(EntityRepository $er) use ($options) {
74 74
                     $entity = $options['entity'];
75 75
                     if ($entity->getID() === null) {
76 76
                         //This query is always false, so we get empty results
Please login to merge, or discard this patch.
src/DataTables/PartsDataTable.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
         }
138 138
 
139 139
         if (isset($options['tag'])) {
140
-            $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%' . $options['tag'] . '%');
140
+            $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%'.$options['tag'].'%');
141 141
         }
142 142
 
143 143
         if (isset($options['search'])) {
144 144
             $builder->AndWhere('part.name LIKE :search')->orWhere('part.description LIKE :search')->orWhere('part.comment LIKE :search')
145
-                ->setParameter('search', '%' . $options['search'] . '%');
145
+                ->setParameter('search', '%'.$options['search'].'%');
146 146
         }
147 147
     }
148 148
 
@@ -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->previewAttachment($context);
160 160
                     if ($preview_attachment === null) {
161 161
                         return '';
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
             ])
172 172
             ->add('name', TextColumn::class, [
173 173
                 'label' => $this->translator->trans('part.table.name'),
174
-                'render' => function ($value, Part $context) {
174
+                'render' => function($value, Part $context) {
175 175
                     return sprintf(
176 176
                         '<a href="%s">%s</a>',
177 177
                         $this->urlGenerator->infoURL($context),
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             ])
201 201
             ->add('storelocation', TextColumn::class, [
202 202
                 'label' => $this->translator->trans('part.table.storeLocations'),
203
-                'render' => function ($value, Part $context) {
203
+                'render' => function($value, Part $context) {
204 204
                     $tmp = array();
205 205
                     foreach ($context->getPartLots() as $lot) {
206 206
                         //Ignore lots without storelocation
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             ])
220 220
             ->add('amount', TextColumn::class, [
221 221
                 'label' => $this->translator->trans('part.table.amount'),
222
-                'render' => function ($value, Part $context) {
222
+                'render' => function($value, Part $context) {
223 223
                     $amount = $context->getAmountSum();
224 224
                     return $this->amountFormatter->format($amount, $context->getPartUnit());
225 225
                 }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
             ->add('minamount', TextColumn::class, [
228 228
                 'label' => $this->translator->trans('part.table.minamount'),
229 229
                 'visible' => false,
230
-                'render' => function ($value, Part $context) {
230
+                'render' => function($value, Part $context) {
231 231
                     return $this->amountFormatter->format($value, $context->getPartUnit());
232 232
                 }
233 233
             ])
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                 },
292 292
                 'entity' => Part::class,
293 293
                 'criteria' => [
294
-                    function (QueryBuilder $builder) use ($options) {
294
+                    function(QueryBuilder $builder) use ($options) {
295 295
                         $this->buildCriteria($builder, $options);
296 296
                     },
297 297
                     new SearchCriteriaProvider()
Please login to merge, or discard this patch.