@@ -39,8 +39,8 @@ discard block |
||
| 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 |
||
| 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 |
@@ -47,7 +47,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -59,9 +59,9 @@ discard block |
||
| 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 |
||
| 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']; |
@@ -45,7 +45,7 @@ |
||
| 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 | } |
@@ -151,7 +151,7 @@ |
||
| 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 | |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | throw new \RuntimeException('$context must be a Part object!'); |
| 62 | 62 | } |
| 63 | 63 | $tmp = ""; |
| 64 | - $attachments = $context->getAttachments()->filter(function (Attachment $attachment) { |
|
| 64 | + $attachments = $context->getAttachments()->filter(function(Attachment $attachment) { |
|
| 65 | 65 | return $attachment->getShowInTable(); |
| 66 | 66 | }); |
| 67 | 67 | |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $tmp .= sprintf( |
| 76 | 76 | '<a href="%s" title="%s" class="attach-table-icon" target="_blank" rel="noopener" data-no-ajax>%s</a>', |
| 77 | 77 | $this->urlGenerator->getViewURL($attachment), |
| 78 | - htmlspecialchars($attachment->getName()) . ': ' . htmlspecialchars($attachment->getFilename()), |
|
| 78 | + htmlspecialchars($attachment->getName()).': '.htmlspecialchars($attachment->getFilename()), |
|
| 79 | 79 | $this->FAIconGenerator->generateIconHTML( |
| 80 | 80 | $this->FAIconGenerator->fileExtensionToFAType($attachment->getExtension()), |
| 81 | 81 | 'fas', |