@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $resolver->setDefaults([ |
52 | 52 | 'measurement_unit' => null, |
53 | - 'show_prefix' => function (Options $options) { |
|
53 | + 'show_prefix' => function(Options $options) { |
|
54 | 54 | if (null !== $options['measurement_unit']) { |
55 | 55 | /** @var MeasurementUnit $unit */ |
56 | 56 | $unit = $options['measurement_unit']; |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | return false; |
62 | 62 | }, |
63 | - 'is_integer' => function (Options $options) { |
|
63 | + 'is_integer' => function(Options $options) { |
|
64 | 64 | if (null !== $options['measurement_unit']) { |
65 | 65 | /** @var MeasurementUnit $unit */ |
66 | 66 | $unit = $options['measurement_unit']; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | return false; |
72 | 72 | }, |
73 | - 'unit' => function (Options $options) { |
|
73 | + 'unit' => function(Options $options) { |
|
74 | 74 | if (null !== $options['measurement_unit']) { |
75 | 75 | /** @var MeasurementUnit $unit */ |
76 | 76 | $unit = $options['measurement_unit']; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $resolver->setDefaults([ |
91 | 91 | 'min' => 0, |
92 | 92 | 'max' => '', |
93 | - 'step' => function (Options $options) { |
|
93 | + 'step' => function(Options $options) { |
|
94 | 94 | if (true === $options['is_integer']) { |
95 | 95 | return 1; |
96 | 96 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | $secure_class_name = str_replace('\\', '_', $class_name); |
64 | 64 | $key = 'list_'.$this->keyGenerator->generateKey().'_'.$secure_class_name.$parent_id; |
65 | 65 | |
66 | - return $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
66 | + return $this->cache->get($key, function(ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
67 | 67 | // Invalidate when groups, a element with the class or the user changes |
68 | 68 | $item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]); |
69 | 69 | /** @var StructuralDBElementRepository */ |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function getListOfRessources(): array |
54 | 54 | { |
55 | 55 | try { |
56 | - return $this->cache->get('attachment_builtin_ressources', function () { |
|
56 | + return $this->cache->get('attachment_builtin_ressources', function() { |
|
57 | 57 | $results = []; |
58 | 58 | |
59 | 59 | $finder = new Finder(); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | protected function configureOptions(OptionsResolver $resolver): void |
136 | 136 | { |
137 | 137 | $resolver->setDefaults([ |
138 | - 'limit' => 15, //Given only 15 entries |
|
138 | + 'limit' => 15, //Given only 15 entries |
|
139 | 139 | //'allowed_extensions' => [], //Filter the filenames. For example ['jpg', 'jpeg'] to only get jpegs. |
140 | 140 | //'placeholders' => Attachment::BUILTIN_PLACEHOLDER, //By default use all builtin ressources, |
141 | 141 | 'empty_returns_all' => false, //Return the whole list of ressources when empty keyword is given |
@@ -59,7 +59,7 @@ |
||
59 | 59 | public function targetTypeDataProvider(): array |
60 | 60 | { |
61 | 61 | return [ |
62 | - [1, User::class], |
|
62 | + [1, User::class], |
|
63 | 63 | [2, Attachment::class], |
64 | 64 | [3, AttachmentType::class], |
65 | 65 | [4, Category::class], |
@@ -176,7 +176,6 @@ |
||
176 | 176 | |
177 | 177 | /** |
178 | 178 | * Get the comment of the element. |
179 | - |
|
180 | 179 | * |
181 | 180 | * @return string the comment |
182 | 181 | */ |
@@ -63,12 +63,12 @@ |
||
63 | 63 | |
64 | 64 | $resolver->setRequired('property'); |
65 | 65 | |
66 | - $resolver->setDefault('field', function (Options $option) { |
|
66 | + $resolver->setDefault('field', function(Options $option) { |
|
67 | 67 | return $option['property'].'.name'; |
68 | 68 | }); |
69 | 69 | |
70 | - $resolver->setDefault('render', function (Options $options) { |
|
71 | - return function ($value, Part $context) use ($options) { |
|
70 | + $resolver->setDefault('render', function(Options $options) { |
|
71 | + return function($value, Part $context) use ($options) { |
|
72 | 72 | /** @var AbstractDBElement|null $entity */ |
73 | 73 | $entity = $this->accessor->getValue($context, $options['property']); |
74 | 74 |
@@ -75,7 +75,7 @@ |
||
75 | 75 | |
76 | 76 | public function buildForm(FormBuilderInterface $builder, array $options): void |
77 | 77 | { |
78 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($options): void { |
|
78 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($options): void { |
|
79 | 79 | $data = $event->getData(); |
80 | 80 | $config = $event->getForm()->getConfig(); |
81 | 81 | //If enabled do a reindexing of the collection |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | public function buildForm(FormBuilderInterface $builder, array $options): void |
83 | 83 | { |
84 | 84 | $builder->addModelTransformer(new CallbackTransformer( |
85 | - function ($value) use ($options) { |
|
85 | + function($value) use ($options) { |
|
86 | 86 | return $this->transform($value, $options); |
87 | - }, function ($value) use ($options) { |
|
87 | + }, function($value) use ($options) { |
|
88 | 88 | return $this->reverseTransform($value, $options); |
89 | 89 | })); |
90 | 90 | } |
@@ -94,21 +94,21 @@ discard block |
||
94 | 94 | $resolver->setRequired(['class']); |
95 | 95 | $resolver->setDefaults([ |
96 | 96 | 'show_fullpath_in_subtext' => true, //When this is enabled, the full path will be shown in subtext |
97 | - 'subentities_of' => null, //Only show entities with the given parent class |
|
98 | - 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
97 | + 'subentities_of' => null, //Only show entities with the given parent class |
|
98 | + 'disable_not_selectable' => false, //Disable entries with not selectable property |
|
99 | 99 | 'choice_value' => 'id', //Use the element id as option value and for comparing items |
100 | - 'choice_loader' => function (Options $options) { |
|
101 | - return new CallbackChoiceLoader(function () use ($options) { |
|
100 | + 'choice_loader' => function(Options $options) { |
|
101 | + return new CallbackChoiceLoader(function() use ($options) { |
|
102 | 102 | return $this->getEntries($options); |
103 | 103 | }); |
104 | 104 | }, |
105 | - 'choice_label' => function (Options $options) { |
|
106 | - return function ($choice, $key, $value) use ($options) { |
|
105 | + 'choice_label' => function(Options $options) { |
|
106 | + return function($choice, $key, $value) use ($options) { |
|
107 | 107 | return $this->generateChoiceLabels($choice, $key, $value, $options); |
108 | 108 | }; |
109 | 109 | }, |
110 | - 'choice_attr' => function (Options $options) { |
|
111 | - return function ($choice, $key, $value) use ($options) { |
|
110 | + 'choice_attr' => function(Options $options) { |
|
111 | + return function($choice, $key, $value) use ($options) { |
|
112 | 112 | return $this->generateChoiceAttr($choice, $key, $value, $options); |
113 | 113 | }; |
114 | 114 | }, |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | |
118 | 118 | $resolver->setDefault('empty_message', null); |
119 | 119 | |
120 | - $resolver->setDefault('attr', function (Options $options) { |
|
120 | + $resolver->setDefault('attr', function(Options $options) { |
|
121 | 121 | $tmp = [ |
122 | 122 | 'class' => 'selectpicker', |
123 | 123 | 'data-live-search' => true, |
@@ -58,7 +58,7 @@ |
||
58 | 58 | { |
59 | 59 | $this->allowedMethods = []; |
60 | 60 | foreach ($methods as $class => $m) { |
61 | - $this->allowedMethods[$class] = array_map(function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]); |
|
61 | + $this->allowedMethods[$class] = array_map(function($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 |