@@ -174,7 +174,7 @@ |
||
| 174 | 174 | ->add('theme', ChoiceType::class, [ |
| 175 | 175 | 'required' => false, |
| 176 | 176 | 'choices' => User::AVAILABLE_THEMES, |
| 177 | - 'choice_label' => function ($entity, $key, $value) { |
|
| 177 | + 'choice_label' => function($entity, $key, $value) { |
|
| 178 | 178 | return $value; |
| 179 | 179 | }, |
| 180 | 180 | 'attr' => [ |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | 'label_options.barcode_type.code93' => 'code93', |
| 84 | 84 | 'label_options.barcode_type.datamatrix' => 'datamatrix', |
| 85 | 85 | ], |
| 86 | - 'group_by' => function ($choice, $key, $value) { |
|
| 86 | + 'group_by' => function($choice, $key, $value) { |
|
| 87 | 87 | if (in_array($choice, ['qr', 'datamatrix'], true)) { |
| 88 | 88 | return 'label_options.barcode_type.2D'; |
| 89 | 89 | } |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | return $fields; |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | - return array_filter($fields, function ($value, $key) use ($element) { |
|
| 307 | + return array_filter($fields, function($value, $key) use ($element) { |
|
| 308 | 308 | //Associative array (save changed data) case |
| 309 | 309 | if (is_string($key)) { |
| 310 | 310 | return $this->shouldFieldBeSaved($element, $key); |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | $old_data = $this->filterFieldRestrictions($entity, $old_data); |
| 332 | 332 | |
| 333 | 333 | //Restrict length of string fields, to save memory... |
| 334 | - $old_data = array_map(function ($value) { |
|
| 334 | + $old_data = array_map(function($value) { |
|
| 335 | 335 | if (is_string($value)) { |
| 336 | 336 | return mb_strimwidth($value, 0, self::MAX_STRING_LENGTH, '...'); |
| 337 | 337 | } |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | |
| 294 | 294 | protected function configureOptions(OptionsResolver $resolver): void |
| 295 | 295 | { |
| 296 | - $providerNormalizer = function (Options $options, $value) { |
|
| 296 | + $providerNormalizer = function(Options $options, $value) { |
|
| 297 | 297 | return array_map([$this, 'normalizeProcessor'], (array) $value); |
| 298 | 298 | }; |
| 299 | 299 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | ->setDefaults([ |
| 302 | 302 | 'hydrate' => Query::HYDRATE_OBJECT, |
| 303 | 303 | 'query' => [], |
| 304 | - 'criteria' => function (Options $options) { |
|
| 304 | + 'criteria' => function(Options $options) { |
|
| 305 | 305 | return [new SearchCriteriaProvider()]; |
| 306 | 306 | }, |
| 307 | 307 | ]) |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | throw new RuntimeException('$context must be a Part object!'); |
| 81 | 81 | } |
| 82 | 82 | $tmp = ''; |
| 83 | - $attachments = $context->getAttachments()->filter(function (Attachment $attachment) { |
|
| 83 | + $attachments = $context->getAttachments()->filter(function(Attachment $attachment) { |
|
| 84 | 84 | return $attachment->getShowInTable() && $this->attachmentManager->isFileExisting($attachment); |
| 85 | 85 | }); |
| 86 | 86 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $optionsResolver->setAllowedTypes('filter_elements', ['array', 'object']); |
| 103 | 103 | $optionsResolver->setAllowedTypes('mode', 'string'); |
| 104 | 104 | |
| 105 | - $optionsResolver->setNormalizer('filter_elements', function (Options $options, $value) { |
|
| 105 | + $optionsResolver->setNormalizer('filter_elements', function(Options $options, $value) { |
|
| 106 | 106 | if (!is_array($value)) { |
| 107 | 107 | return [$value]; |
| 108 | 108 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | $dataTable->add('symbol', TextColumn::class, [ |
| 123 | 123 | 'label' => '', |
| 124 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
| 124 | + 'render' => function($value, AbstractLogEntry $context) { |
|
| 125 | 125 | switch ($context->getLevelString()) { |
| 126 | 126 | case LogLevel::DEBUG: |
| 127 | 127 | $symbol = 'fa-bug'; |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $dataTable->add('type', TextColumn::class, [ |
| 183 | 183 | 'label' => $this->translator->trans('log.type'), |
| 184 | 184 | 'propertyPath' => 'type', |
| 185 | - 'render' => function (string $value, AbstractLogEntry $context) { |
|
| 185 | + 'render' => function(string $value, AbstractLogEntry $context) { |
|
| 186 | 186 | return $this->translator->trans('log.type.'.$value); |
| 187 | 187 | }, |
| 188 | 188 | ]); |
@@ -191,14 +191,14 @@ discard block |
||
| 191 | 191 | 'label' => $this->translator->trans('log.level'), |
| 192 | 192 | 'visible' => 'system_log' === $options['mode'], |
| 193 | 193 | 'propertyPath' => 'levelString', |
| 194 | - 'render' => function (string $value, AbstractLogEntry $context) { |
|
| 194 | + 'render' => function(string $value, AbstractLogEntry $context) { |
|
| 195 | 195 | return $value; |
| 196 | 196 | }, |
| 197 | 197 | ]); |
| 198 | 198 | |
| 199 | 199 | $dataTable->add('user', TextColumn::class, [ |
| 200 | 200 | 'label' => $this->translator->trans('log.user'), |
| 201 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
| 201 | + 'render' => function($value, AbstractLogEntry $context) { |
|
| 202 | 202 | $user = $context->getUser(); |
| 203 | 203 | |
| 204 | 204 | return sprintf( |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $dataTable->add('target_type', TextColumn::class, [ |
| 213 | 213 | 'label' => $this->translator->trans('log.target_type'), |
| 214 | 214 | 'visible' => false, |
| 215 | - 'render' => function ($value, AbstractLogEntry $context) { |
|
| 215 | + 'render' => function($value, AbstractLogEntry $context) { |
|
| 216 | 216 | $class = $context->getTargetClass(); |
| 217 | 217 | if (null !== $class) { |
| 218 | 218 | return $this->elementTypeNameGenerator->getLocalizedTypeLabel($class); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | $dataTable->add('timeTravel', IconLinkColumn::class, [ |
| 235 | 235 | 'label' => '', |
| 236 | 236 | 'icon' => 'fas fa-fw fa-eye', |
| 237 | - 'href' => function ($value, AbstractLogEntry $context) { |
|
| 237 | + 'href' => function($value, AbstractLogEntry $context) { |
|
| 238 | 238 | if ( |
| 239 | 239 | ($context instanceof TimeTravelInterface |
| 240 | 240 | && $context->hasOldDataInformations()) |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | return null; |
| 254 | 254 | }, |
| 255 | - 'disabled' => function ($value, AbstractLogEntry $context) { |
|
| 255 | + 'disabled' => function($value, AbstractLogEntry $context) { |
|
| 256 | 256 | return |
| 257 | 257 | !$this->security->isGranted('@tools.timetravel') |
| 258 | 258 | || !$this->security->isGranted('show_history', $context->getTargetClass()); |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | |
| 268 | 268 | $dataTable->createAdapter(ORMAdapter::class, [ |
| 269 | 269 | 'entity' => AbstractLogEntry::class, |
| 270 | - 'query' => function (QueryBuilder $builder) use ($options): void { |
|
| 270 | + 'query' => function(QueryBuilder $builder) use ($options): void { |
|
| 271 | 271 | $this->getQuery($builder, $options); |
| 272 | 272 | }, |
| 273 | 273 | ]); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $optionsResolver->setAllowedTypes('search', ['null', 'string']); |
| 119 | 119 | |
| 120 | 120 | //Configure search options |
| 121 | - $optionsResolver->setDefault('search_options', function (OptionsResolver $resolver): void { |
|
| 121 | + $optionsResolver->setDefault('search_options', function(OptionsResolver $resolver): void { |
|
| 122 | 122 | $resolver->setDefaults([ |
| 123 | 123 | 'name' => true, |
| 124 | 124 | 'category' => true, |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $dataTable |
| 155 | 155 | ->add('picture', TextColumn::class, [ |
| 156 | 156 | 'label' => '', |
| 157 | - 'render' => function ($value, Part $context) { |
|
| 157 | + 'render' => function($value, Part $context) { |
|
| 158 | 158 | $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($context); |
| 159 | 159 | if (null === $preview_attachment) { |
| 160 | 160 | return ''; |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | ]) |
| 178 | 178 | ->add('name', TextColumn::class, [ |
| 179 | 179 | 'label' => $this->translator->trans('part.table.name'), |
| 180 | - 'render' => function ($value, Part $context) { |
|
| 180 | + 'render' => function($value, Part $context) { |
|
| 181 | 181 | return sprintf( |
| 182 | 182 | '<a href="%s">%s</a>', |
| 183 | 183 | $this->urlGenerator->infoURL($context), |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | ]) |
| 207 | 207 | ->add('storelocation', TextColumn::class, [ |
| 208 | 208 | 'label' => $this->translator->trans('part.table.storeLocations'), |
| 209 | - 'render' => function ($value, Part $context) { |
|
| 209 | + 'render' => function($value, Part $context) { |
|
| 210 | 210 | $tmp = []; |
| 211 | 211 | foreach ($context->getPartLots() as $lot) { |
| 212 | 212 | //Ignore lots without storelocation |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | ]) |
| 226 | 226 | ->add('amount', TextColumn::class, [ |
| 227 | 227 | 'label' => $this->translator->trans('part.table.amount'), |
| 228 | - 'render' => function ($value, Part $context) { |
|
| 228 | + 'render' => function($value, Part $context) { |
|
| 229 | 229 | $amount = $context->getAmountSum(); |
| 230 | 230 | |
| 231 | 231 | return $this->amountFormatter->format($amount, $context->getPartUnit()); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | ->add('minamount', TextColumn::class, [ |
| 235 | 235 | 'label' => $this->translator->trans('part.table.minamount'), |
| 236 | 236 | 'visible' => false, |
| 237 | - 'render' => function ($value, Part $context) { |
|
| 237 | + 'render' => function($value, Part $context) { |
|
| 238 | 238 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
| 239 | 239 | }, |
| 240 | 240 | ]) |
@@ -297,10 +297,10 @@ discard block |
||
| 297 | 297 | ->add('edit', IconLinkColumn::class, [ |
| 298 | 298 | 'label' => $this->translator->trans('part.table.edit'), |
| 299 | 299 | 'visible' => false, |
| 300 | - 'href' => function ($value, Part $context) { |
|
| 300 | + 'href' => function($value, Part $context) { |
|
| 301 | 301 | return $this->urlGenerator->editURL($context); |
| 302 | 302 | }, |
| 303 | - 'disabled' => function ($value, Part $context) { |
|
| 303 | + 'disabled' => function($value, Part $context) { |
|
| 304 | 304 | return !$this->security->isGranted('edit', $context); |
| 305 | 305 | }, |
| 306 | 306 | 'title' => $this->translator->trans('part.table.edit.title'), |
@@ -309,12 +309,12 @@ discard block |
||
| 309 | 309 | ->addOrderBy('name') |
| 310 | 310 | ->createAdapter(FetchJoinORMAdapter::class, [ |
| 311 | 311 | 'simple_total_query' => true, |
| 312 | - 'query' => function (QueryBuilder $builder): void { |
|
| 312 | + 'query' => function(QueryBuilder $builder): void { |
|
| 313 | 313 | $this->getQuery($builder); |
| 314 | 314 | }, |
| 315 | 315 | 'entity' => Part::class, |
| 316 | 316 | 'criteria' => [ |
| 317 | - function (QueryBuilder $builder) use ($options): void { |
|
| 317 | + function(QueryBuilder $builder) use ($options): void { |
|
| 318 | 318 | $this->buildCriteria($builder, $options); |
| 319 | 319 | }, |
| 320 | 320 | new SearchCriteriaProvider(), |
@@ -79,7 +79,7 @@ discard block |
||
| 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 | 84 | && !$context->isExternal() |
| 85 | 85 | && $this->attachmentHelper->isFileExisting($context)) { |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | $dataTable->add('name', TextColumn::class, [ |
| 106 | 106 | 'label' => 'attachment.edit.name', |
| 107 | - 'render' => function ($value, Attachment $context) { |
|
| 107 | + 'render' => function($value, Attachment $context) { |
|
| 108 | 108 | //Link to external source |
| 109 | 109 | if ($context->isExternal()) { |
| 110 | 110 | return sprintf( |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $dataTable->add('attachment_type', TextColumn::class, [ |
| 130 | 130 | 'label' => 'attachment.table.type', |
| 131 | 131 | 'field' => 'attachment_type.name', |
| 132 | - 'render' => function ($value, Attachment $context) { |
|
| 132 | + 'render' => function($value, Attachment $context) { |
|
| 133 | 133 | return sprintf( |
| 134 | 134 | '<a href="%s">%s</a>', |
| 135 | 135 | $this->entityURLGenerator->editURL($context->getAttachmentType()), |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | $dataTable->add('element', TextColumn::class, [ |
| 142 | 142 | 'label' => 'attachment.table.element', |
| 143 | 143 | //'propertyPath' => 'element.name', |
| 144 | - 'render' => function ($value, Attachment $context) { |
|
| 144 | + 'render' => function($value, Attachment $context) { |
|
| 145 | 145 | return sprintf( |
| 146 | 146 | '<a href="%s">%s</a>', |
| 147 | 147 | $this->entityURLGenerator->infoURL($context->getElement()), |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | $dataTable->add('filesize', TextColumn::class, [ |
| 159 | 159 | 'label' => $this->translator->trans('attachment.table.filesize'), |
| 160 | - 'render' => function ($value, Attachment $context) { |
|
| 160 | + 'render' => function($value, Attachment $context) { |
|
| 161 | 161 | if ($this->attachmentHelper->isFileExisting($context)) { |
| 162 | 162 | return $this->attachmentHelper->getHumanFileSize($context); |
| 163 | 163 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | $dataTable->createAdapter(ORMAdapter::class, [ |
| 223 | 223 | 'entity' => Attachment::class, |
| 224 | - 'query' => function (QueryBuilder $builder): void { |
|
| 224 | + 'query' => function(QueryBuilder $builder): void { |
|
| 225 | 225 | $this->getQuery($builder); |
| 226 | 226 | }, |
| 227 | 227 | ]); |
@@ -101,7 +101,7 @@ |
||
| 101 | 101 | { |
| 102 | 102 | $em = $this->em; |
| 103 | 103 | |
| 104 | - $this->execute($element, static function (AbstractStructuralDBElement $element) use ($em): void { |
|
| 104 | + $this->execute($element, static function(AbstractStructuralDBElement $element) use ($em): void { |
|
| 105 | 105 | $em->remove($element); |
| 106 | 106 | }); |
| 107 | 107 | |