@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | protected function configureOptions(OptionsResolver $resolver): void |
107 | 107 | { |
108 | 108 | $resolver->setDefaults([ |
109 | - 'show_prefix' => static function (Options $options) { |
|
109 | + 'show_prefix' => static function(Options $options) { |
|
110 | 110 | if (null !== $options['measurement_unit']) { |
111 | 111 | /** @var MeasurementUnit $unit */ |
112 | 112 | $unit = $options['measurement_unit']; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | return false; |
118 | 118 | }, |
119 | - 'is_integer' => static function (Options $options) { |
|
119 | + 'is_integer' => static function(Options $options) { |
|
120 | 120 | if (null !== $options['measurement_unit']) { |
121 | 121 | /** @var MeasurementUnit $unit */ |
122 | 122 | $unit = $options['measurement_unit']; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | return true; |
128 | 128 | }, |
129 | - 'unit' => static function (Options $options) { |
|
129 | + 'unit' => static function(Options $options) { |
|
130 | 130 | if (null !== $options['measurement_unit']) { |
131 | 131 | /** @var MeasurementUnit $unit */ |
132 | 132 | $unit = $options['measurement_unit']; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | $resolver->setAllowedTypes('decimals', 'int'); |
146 | 146 | |
147 | - $resolver->setNormalizer('decimals', static function (Options $options, $value) { |
|
147 | + $resolver->setNormalizer('decimals', static function(Options $options, $value) { |
|
148 | 148 | // If the unit is integer based, then dont show any decimals |
149 | 149 | if ($options['is_integer']) { |
150 | 150 | return 0; |
@@ -85,7 +85,7 @@ |
||
85 | 85 | } else { |
86 | 86 | // We have to sort the pricedetails manually |
87 | 87 | $array = $pricedetails->map( |
88 | - static function (Pricedetail $pricedetail) { |
|
88 | + static function(Pricedetail $pricedetail) { |
|
89 | 89 | return $pricedetail->getMinDiscountQuantity(); |
90 | 90 | } |
91 | 91 | )->toArray(); |
@@ -111,7 +111,7 @@ |
||
111 | 111 | public function getTests() |
112 | 112 | { |
113 | 113 | return [ |
114 | - new TwigTest('instanceof', static function ($var, $instance) { |
|
114 | + new TwigTest('instanceof', static function($var, $instance) { |
|
115 | 115 | return $var instanceof $instance; |
116 | 116 | }), |
117 | 117 | ]; |
@@ -29,7 +29,7 @@ |
||
29 | 29 | public function getFilters() |
30 | 30 | { |
31 | 31 | return [ |
32 | - new TwigFilter('barcodeSVG', static function (string $content, string $type = 'QRCODE') { |
|
32 | + new TwigFilter('barcodeSVG', static function(string $content, string $type = 'QRCODE') { |
|
33 | 33 | $barcodeFactory = new Barcode(); |
34 | 34 | $barcode = $barcodeFactory->getBarcodeObj($type, $content); |
35 | 35 |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $this->allowedMethods = []; |
62 | 62 | foreach ($methods as $class => $m) { |
63 | 63 | $this->allowedMethods[$class] = array_map( |
64 | - static function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]); |
|
64 | + static function($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 |
@@ -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', static function (OptionsResolver $resolver): void { |
|
121 | + $optionsResolver->setDefault('search_options', static 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,12 +79,12 @@ |
||
79 | 79 | |
80 | 80 | $resolver->setRequired('property'); |
81 | 81 | |
82 | - $resolver->setDefault('field', static function (Options $option) { |
|
82 | + $resolver->setDefault('field', static function(Options $option) { |
|
83 | 83 | return $option['property'].'.name'; |
84 | 84 | }); |
85 | 85 | |
86 | - $resolver->setDefault('render', function (Options $options) { |
|
87 | - return function ($value, Part $context) use ($options) { |
|
86 | + $resolver->setDefault('render', function(Options $options) { |
|
87 | + return function($value, Part $context) use ($options) { |
|
88 | 88 | /** @var AbstractDBElement|null $entity */ |
89 | 89 | $entity = $this->accessor->getValue($context, $options['property']); |
90 | 90 |
@@ -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', static function (Options $options, $value) { |
|
105 | + $optionsResolver->setNormalizer('filter_elements', static 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' => static function ($value, AbstractLogEntry $context) { |
|
124 | + 'render' => static 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' => static function (string $value, AbstractLogEntry $context) { |
|
194 | + 'render' => static 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 | ]); |
@@ -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' => static function (Options $options) { |
|
304 | + 'criteria' => static function(Options $options) { |
|
305 | 305 | return [new SearchCriteriaProvider()]; |
306 | 306 | }, |
307 | 307 | ]) |