@@ -119,7 +119,7 @@ discard block |
||
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 |
||
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 ''; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | ]) |
173 | 173 | ->add('name', TextColumn::class, [ |
174 | 174 | 'label' => $this->translator->trans('part.table.name'), |
175 | - 'render' => function ($value, Part $context) { |
|
175 | + 'render' => function($value, Part $context) { |
|
176 | 176 | return sprintf( |
177 | 177 | '<a href="%s">%s</a>', |
178 | 178 | $this->urlGenerator->infoURL($context), |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | ]) |
202 | 202 | ->add('storelocation', TextColumn::class, [ |
203 | 203 | 'label' => $this->translator->trans('part.table.storeLocations'), |
204 | - 'render' => function ($value, Part $context) { |
|
204 | + 'render' => function($value, Part $context) { |
|
205 | 205 | $tmp = []; |
206 | 206 | foreach ($context->getPartLots() as $lot) { |
207 | 207 | //Ignore lots without storelocation |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | ]) |
221 | 221 | ->add('amount', TextColumn::class, [ |
222 | 222 | 'label' => $this->translator->trans('part.table.amount'), |
223 | - 'render' => function ($value, Part $context) { |
|
223 | + 'render' => function($value, Part $context) { |
|
224 | 224 | $amount = $context->getAmountSum(); |
225 | 225 | |
226 | 226 | return $this->amountFormatter->format($amount, $context->getPartUnit()); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | ->add('minamount', TextColumn::class, [ |
230 | 230 | 'label' => $this->translator->trans('part.table.minamount'), |
231 | 231 | 'visible' => false, |
232 | - 'render' => function ($value, Part $context) { |
|
232 | + 'render' => function($value, Part $context) { |
|
233 | 233 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
234 | 234 | }, |
235 | 235 | ]) |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | ->add('edit', IconLinkColumn::class, [ |
293 | 293 | 'label' => $this->translator->trans('part.table.edit'), |
294 | 294 | 'visible' => false, |
295 | - 'href' => function ($value, Part $context) { |
|
295 | + 'href' => function($value, Part $context) { |
|
296 | 296 | return $this->urlGenerator->editURL($context); |
297 | 297 | }, |
298 | - 'disabled' => function ($value, Part $context) { |
|
298 | + 'disabled' => function($value, Part $context) { |
|
299 | 299 | return !$this->security->isGranted('edit', $context); |
300 | 300 | }, |
301 | 301 | 'title' => $this->translator->trans('part.table.edit.title'), |
@@ -304,12 +304,12 @@ discard block |
||
304 | 304 | ->addOrderBy('name') |
305 | 305 | ->createAdapter(FetchJoinORMAdapter::class, [ |
306 | 306 | 'simple_total_query' => true, |
307 | - 'query' => function (QueryBuilder $builder): void { |
|
307 | + 'query' => function(QueryBuilder $builder): void { |
|
308 | 308 | $this->getQuery($builder); |
309 | 309 | }, |
310 | 310 | 'entity' => Part::class, |
311 | 311 | 'criteria' => [ |
312 | - function (QueryBuilder $builder) use ($options): void { |
|
312 | + function(QueryBuilder $builder) use ($options): void { |
|
313 | 313 | $this->buildCriteria($builder, $options); |
314 | 314 | }, |
315 | 315 | new SearchCriteriaProvider(), |
@@ -390,8 +390,8 @@ discard block |
||
390 | 390 | $builder->andWhere('part.tags LIKE :tag')->setParameter('tag', '%'.$options['tag'].'%'); |
391 | 391 | } |
392 | 392 | |
393 | - if (! empty($options['search'])) { |
|
394 | - if (! $options['search_options']['regex']) { |
|
393 | + if (!empty($options['search'])) { |
|
394 | + if (!$options['search_options']['regex']) { |
|
395 | 395 | //Dont show results, if no things are selected |
396 | 396 | $builder->andWhere('0=1'); |
397 | 397 | $defined = false; |