@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | protected function configureOptions(OptionsResolver $resolver) |
44 | 44 | { |
45 | 45 | $resolver->setDefaults([ |
46 | - 'limit' => 15, //Given only 15 entries |
|
46 | + 'limit' => 15, //Given only 15 entries |
|
47 | 47 | //'allowed_extensions' => [], //Filter the filenames. For example ['jpg', 'jpeg'] to only get jpegs. |
48 | 48 | //'placeholders' => Attachment::BUILTIN_PLACEHOLDER, //By default use all builtin ressources, |
49 | 49 | 'empty_returns_all' => false, //Return the whole list of ressources when empty keyword is given |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | public function getListOfRessources(): array |
61 | 61 | { |
62 | 62 | try { |
63 | - return $this->cache->get('attachment_builtin_ressources', function () { |
|
63 | + return $this->cache->get('attachment_builtin_ressources', function() { |
|
64 | 64 | $results = []; |
65 | 65 | |
66 | 66 | $finder = new Finder(); |
@@ -139,7 +139,7 @@ |
||
139 | 139 | { |
140 | 140 | $filter = trim($filter); |
141 | 141 | |
142 | - return $this->cache->get('filter_exts_'.md5($filter), function (ItemInterface $item) use ($filter) { |
|
142 | + return $this->cache->get('filter_exts_'.md5($filter), function(ItemInterface $item) use ($filter) { |
|
143 | 143 | $elements = explode(',', $filter); |
144 | 144 | $extensions = []; |
145 | 145 |
@@ -166,7 +166,7 @@ |
||
166 | 166 | $secure_class_name = str_replace('\\', '_', $class_name); |
167 | 167 | $key = 'list_'.$this->keyGenerator->generateKey().'_'.$secure_class_name.$parent_id; |
168 | 168 | |
169 | - $ret = $this->cache->get($key, function (ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
169 | + $ret = $this->cache->get($key, function(ItemInterface $item) use ($class_name, $parent, $secure_class_name) { |
|
170 | 170 | // Invalidate when groups, a element with the class or the user changes |
171 | 171 | $item->tag(['groups', 'tree_list', $this->keyGenerator->generateKey(), $secure_class_name]); |
172 | 172 | /** |
@@ -80,7 +80,7 @@ |
||
80 | 80 | { |
81 | 81 | $em = $this->em; |
82 | 82 | |
83 | - $this->execute($element, static function (StructuralDBElement $element) use ($em) { |
|
83 | + $this->execute($element, static function(StructuralDBElement $element) use ($em) { |
|
84 | 84 | $em->remove($element); |
85 | 85 | }); |
86 | 86 |
@@ -77,7 +77,7 @@ |
||
77 | 77 | { |
78 | 78 | $key = 'tree_tools_'.$this->keyGenerator->generateKey(); |
79 | 79 | |
80 | - return $this->cache->get($key, function (ItemInterface $item) { |
|
80 | + return $this->cache->get($key, function(ItemInterface $item) { |
|
81 | 81 | //Invalidate tree, whenever group or the user changes |
82 | 82 | $item->tag(['tree_tools', 'groups', $this->keyGenerator->generateKey()]); |
83 | 83 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | protected function configureOptions(OptionsResolver $resolver) |
41 | 41 | { |
42 | 42 | $resolver->setDefaults([ |
43 | - 'show_prefix' => function (Options $options) { |
|
43 | + 'show_prefix' => function(Options $options) { |
|
44 | 44 | if (null !== $options['measurement_unit']) { |
45 | 45 | /** @var MeasurementUnit $unit */ |
46 | 46 | $unit = $options['measurement_unit']; |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | return false; |
52 | 52 | }, |
53 | - 'is_integer' => function (Options $options) { |
|
53 | + 'is_integer' => 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 true; |
62 | 62 | }, |
63 | - 'unit' => function (Options $options) { |
|
63 | + 'unit' => function(Options $options) { |
|
64 | 64 | if (null !== $options['measurement_unit']) { |
65 | 65 | /** @var MeasurementUnit $unit */ |
66 | 66 | $unit = $options['measurement_unit']; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $resolver->setAllowedTypes('decimals', 'int'); |
78 | 78 | |
79 | - $resolver->setNormalizer('decimals', function (Options $options, $value) { |
|
79 | + $resolver->setNormalizer('decimals', function(Options $options, $value) { |
|
80 | 80 | // If the unit is integer based, then dont show any decimals |
81 | 81 | if ($options['is_integer']) { |
82 | 82 | return 0; |
@@ -79,7 +79,7 @@ |
||
79 | 79 | public function getTests() |
80 | 80 | { |
81 | 81 | return [ |
82 | - new TwigTest('instanceof', function ($var, $instance) { |
|
82 | + new TwigTest('instanceof', function($var, $instance) { |
|
83 | 83 | return $var instanceof $instance; |
84 | 84 | }), |
85 | 85 | ]; |
@@ -477,7 +477,7 @@ |
||
477 | 477 | if ($only_http) { //Check if scheme is HTTPS or HTTP |
478 | 478 | $scheme = parse_url($string, PHP_URL_SCHEME); |
479 | 479 | if ('http' !== $scheme && 'https' !== $scheme) { |
480 | - return false; //All other schemes are not valid. |
|
480 | + return false; //All other schemes are not valid. |
|
481 | 481 | } |
482 | 482 | } |
483 | 483 | if ($path_required) { |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $dataTable |
144 | 144 | ->add('picture', TextColumn::class, [ |
145 | 145 | 'label' => '', |
146 | - 'render' => function ($value, Part $context) { |
|
146 | + 'render' => function($value, Part $context) { |
|
147 | 147 | $preview_attachment = $this->previewGenerator->getTablePreviewAttachment($context); |
148 | 148 | if (null === $preview_attachment) { |
149 | 149 | return ''; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | ]) |
161 | 161 | ->add('name', TextColumn::class, [ |
162 | 162 | 'label' => $this->translator->trans('part.table.name'), |
163 | - 'render' => function ($value, Part $context) { |
|
163 | + 'render' => function($value, Part $context) { |
|
164 | 164 | return sprintf( |
165 | 165 | '<a href="%s">%s</a>', |
166 | 166 | $this->urlGenerator->infoURL($context), |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ]) |
190 | 190 | ->add('storelocation', TextColumn::class, [ |
191 | 191 | 'label' => $this->translator->trans('part.table.storeLocations'), |
192 | - 'render' => function ($value, Part $context) { |
|
192 | + 'render' => function($value, Part $context) { |
|
193 | 193 | $tmp = []; |
194 | 194 | foreach ($context->getPartLots() as $lot) { |
195 | 195 | //Ignore lots without storelocation |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | ]) |
209 | 209 | ->add('amount', TextColumn::class, [ |
210 | 210 | 'label' => $this->translator->trans('part.table.amount'), |
211 | - 'render' => function ($value, Part $context) { |
|
211 | + 'render' => function($value, Part $context) { |
|
212 | 212 | $amount = $context->getAmountSum(); |
213 | 213 | |
214 | 214 | return $this->amountFormatter->format($amount, $context->getPartUnit()); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | ->add('minamount', TextColumn::class, [ |
218 | 218 | 'label' => $this->translator->trans('part.table.minamount'), |
219 | 219 | 'visible' => false, |
220 | - 'render' => function ($value, Part $context) { |
|
220 | + 'render' => function($value, Part $context) { |
|
221 | 221 | return $this->amountFormatter->format($value, $context->getPartUnit()); |
222 | 222 | }, |
223 | 223 | ]) |
@@ -276,12 +276,12 @@ discard block |
||
276 | 276 | |
277 | 277 | ->addOrderBy('name') |
278 | 278 | ->createAdapter(ORMAdapter::class, [ |
279 | - 'query' => function (QueryBuilder $builder) { |
|
279 | + 'query' => function(QueryBuilder $builder) { |
|
280 | 280 | $this->getQuery($builder); |
281 | 281 | }, |
282 | 282 | 'entity' => Part::class, |
283 | 283 | 'criteria' => [ |
284 | - function (QueryBuilder $builder) use ($options) { |
|
284 | + function(QueryBuilder $builder) use ($options) { |
|
285 | 285 | $this->buildCriteria($builder, $options); |
286 | 286 | }, |
287 | 287 | new SearchCriteriaProvider(), |