Passed
Push — master ( 550b4f...70c8b4 )
by Jan
05:05
created
src/Services/AmountFormatter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Services/PricedetailHelper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Twig/AppExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
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
         ];
Please login to merge, or discard this patch.
src/Twig/BarcodeExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Twig/Sandbox/InheritanceSecurityPolicy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/DataTables/PartsDataTable.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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(),
Please login to merge, or discard this patch.
src/DataTables/Column/EntityColumn.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,12 +79,12 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/DataTables/LogDataTable.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         ]);
Please login to merge, or discard this patch.
src/Form/Type/SIUnitType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $resolver->setDefaults([
71 71
             'measurement_unit' => null,
72
-            'show_prefix' => static function (Options $options) {
72
+            'show_prefix' => static function(Options $options) {
73 73
                 if (null !== $options['measurement_unit']) {
74 74
                     /** @var MeasurementUnit $unit */
75 75
                     $unit = $options['measurement_unit'];
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
                 return false;
81 81
             },
82
-            'is_integer' => static function (Options $options) {
82
+            'is_integer' => static function(Options $options) {
83 83
                 if (null !== $options['measurement_unit']) {
84 84
                     /** @var MeasurementUnit $unit */
85 85
                     $unit = $options['measurement_unit'];
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 
90 90
                 return false;
91 91
             },
92
-            'unit' => static function (Options $options) {
92
+            'unit' => static function(Options $options) {
93 93
                 if (null !== $options['measurement_unit']) {
94 94
                     /** @var MeasurementUnit $unit */
95 95
                     $unit = $options['measurement_unit'];
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $resolver->setDefaults([
112 112
             'min' => 0,
113 113
             'max' => '',
114
-            'step' => static function (Options $options) {
114
+            'step' => static function(Options $options) {
115 115
                 if (true === $options['is_integer']) {
116 116
                     return 1;
117 117
                 }
Please login to merge, or discard this patch.