@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | return $fields; |
305 | 305 | } |
306 | 306 | |
307 | - return array_filter($fields, function ($value, $key) use ($element) { |
|
307 | + return array_filter($fields, function($value, $key) use ($element) { |
|
308 | 308 | //Associative array (save changed data) case |
309 | 309 | if (is_string($key)) { |
310 | 310 | return $this->shouldFieldBeSaved($element, $key); |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | |
333 | 333 | //Restrict length of string fields, to save memory... |
334 | 334 | $old_data = array_map( |
335 | - static function ($value) { |
|
335 | + static function($value) { |
|
336 | 336 | if (is_string($value)) { |
337 | 337 | return mb_strimwidth($value, 0, self::MAX_STRING_LENGTH, '...'); |
338 | 338 | } |
@@ -69,7 +69,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | |
64 | 64 | public function buildForm(FormBuilderInterface $builder, array $options): void |
65 | 65 | { |
66 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, static function (FormEvent $event): void { |
|
66 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, static function(FormEvent $event): void { |
|
67 | 67 | $form = $event->getForm(); |
68 | 68 | /** @var User $user */ |
69 | 69 | $user = $event->getData(); |
@@ -76,10 +76,10 @@ |
||
76 | 76 | |
77 | 77 | //Normalize data before writing it to database |
78 | 78 | $builder->get('filetype_filter')->addViewTransformer(new CallbackTransformer( |
79 | - static function ($value) { |
|
79 | + static function($value) { |
|
80 | 80 | return $value; |
81 | 81 | }, |
82 | - function ($value) { |
|
82 | + function($value) { |
|
83 | 83 | return $this->filterTools->normalizeFilterString($value); |
84 | 84 | } |
85 | 85 | )); |
@@ -88,13 +88,13 @@ |
||
88 | 88 | { |
89 | 89 | parent::configureOptions($resolver); |
90 | 90 | |
91 | - $resolver->setDefault('group_name', static function (Options $options) { |
|
91 | + $resolver->setDefault('group_name', static function(Options $options) { |
|
92 | 92 | return trim($options['name']); |
93 | 93 | }); |
94 | 94 | |
95 | 95 | $resolver->setDefault('inherit', false); |
96 | 96 | |
97 | - $resolver->setDefault('label', function (Options $options) { |
|
97 | + $resolver->setDefault('label', function(Options $options) { |
|
98 | 98 | if (!empty($this->perm_structure['groups'][$options['group_name']]['label'])) { |
99 | 99 | return $this->perm_structure['groups'][$options['group_name']]['label']; |
100 | 100 | } |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | { |
67 | 67 | parent::configureOptions($resolver); |
68 | 68 | |
69 | - $resolver->setDefault('perm_name', static function (Options $options) { |
|
69 | + $resolver->setDefault('perm_name', static function(Options $options) { |
|
70 | 70 | return $options['name']; |
71 | 71 | }); |
72 | 72 | |
73 | - $resolver->setDefault('label', function (Options $options) { |
|
73 | + $resolver->setDefault('label', function(Options $options) { |
|
74 | 74 | if (!empty($this->perm_structure['perms'][$options['perm_name']]['label'])) { |
75 | 75 | return $this->perm_structure['perms'][$options['perm_name']]['label']; |
76 | 76 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | return $options['name']; |
79 | 79 | }); |
80 | 80 | |
81 | - $resolver->setDefault('multi_checkbox', static function (Options $options) { |
|
81 | + $resolver->setDefault('multi_checkbox', static function(Options $options) { |
|
82 | 82 | return !$options['disabled']; |
83 | 83 | }); |
84 | 84 |
@@ -83,7 +83,7 @@ |
||
83 | 83 | 'label_options.barcode_type.code93' => 'code93', |
84 | 84 | 'label_options.barcode_type.datamatrix' => 'datamatrix', |
85 | 85 | ], |
86 | - 'group_by' => static function ($choice, $key, $value) { |
|
86 | + 'group_by' => static function($choice, $key, $value) { |
|
87 | 87 | if (in_array($choice, ['qr', 'datamatrix'], true)) { |
88 | 88 | return 'label_options.barcode_type.2D'; |
89 | 89 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | ], |
170 | 170 | ]); |
171 | 171 | |
172 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event): void { |
|
172 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event): void { |
|
173 | 173 | $form = $event->getForm(); |
174 | 174 | $attachment = $form->getData(); |
175 | 175 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | //Check the secure file checkbox, if file is in securefile location |
188 | 188 | $builder->get('secureFile')->addEventListener( |
189 | 189 | FormEvents::PRE_SET_DATA, |
190 | - static function (FormEvent $event): void { |
|
190 | + static function(FormEvent $event): void { |
|
191 | 191 | $attachment = $event->getForm()->getParent()->getData(); |
192 | 192 | if ($attachment instanceof Attachment) { |
193 | 193 | $event->setData($attachment->isSecure()); |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | ) ? $connection->getConfiguration()->getSchemaAssetsFilter() : null; |
149 | 149 | |
150 | 150 | //Disable foreign key checks |
151 | - if($platform instanceof AbstractMySQLPlatform) { |
|
151 | + if ($platform instanceof AbstractMySQLPlatform) { |
|
152 | 152 | $connection->executeQuery('SET foreign_key_checks = 0;'); |
153 | 153 | } |
154 | 154 | |
155 | 155 | foreach ($orderedTables as $tbl) { |
156 | 156 | // If we have a filter expression, check it and skip if necessary |
157 | - if (! $emptyFilterExpression && ! preg_match($filterExpr, $tbl)) { |
|
157 | + if (!$emptyFilterExpression && !preg_match($filterExpr, $tbl)) { |
|
158 | 158 | continue; |
159 | 159 | } |
160 | 160 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } |
165 | 165 | |
166 | 166 | // Support schema asset filters as presented in |
167 | - if (is_callable($schemaAssetsFilter) && ! $schemaAssetsFilter($tbl)) { |
|
167 | + if (is_callable($schemaAssetsFilter) && !$schemaAssetsFilter($tbl)) { |
|
168 | 168 | continue; |
169 | 169 | } |
170 | 170 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | } |
183 | 183 | |
184 | 184 | //Reenable foreign key checks |
185 | - if($platform instanceof AbstractMySQLPlatform) { |
|
185 | + if ($platform instanceof AbstractMySQLPlatform) { |
|
186 | 186 | $connection->executeQuery('SET foreign_key_checks = 1;'); |
187 | 187 | } |
188 | 188 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | { |
192 | 192 | $tableIdentifier = new Identifier($tableName); |
193 | 193 | |
194 | - return 'ALTER TABLE '. $tableIdentifier->getQuotedName($platform) .' AUTO_INCREMENT = 1;'; |
|
194 | + return 'ALTER TABLE '.$tableIdentifier->getQuotedName($platform).' AUTO_INCREMENT = 1;'; |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | $sorter = new TopologicalSorter(); |
205 | 205 | |
206 | 206 | foreach ($classes as $class) { |
207 | - if (! $sorter->hasNode($class->name)) { |
|
207 | + if (!$sorter->hasNode($class->name)) { |
|
208 | 208 | $sorter->addNode($class->name, $class); |
209 | 209 | } |
210 | 210 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $parentClass = $em->getClassMetadata($parentClass); |
214 | 214 | $parentClassName = $parentClass->getName(); |
215 | 215 | |
216 | - if (! $sorter->hasNode($parentClassName)) { |
|
216 | + if (!$sorter->hasNode($parentClassName)) { |
|
217 | 217 | $sorter->addNode($parentClassName, $parentClass); |
218 | 218 | } |
219 | 219 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | foreach ($class->associationMappings as $assoc) { |
224 | - if (! $assoc['isOwningSide']) { |
|
224 | + if (!$assoc['isOwningSide']) { |
|
225 | 225 | continue; |
226 | 226 | } |
227 | 227 | |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | assert($targetClass instanceof ClassMetadata); |
230 | 230 | $targetClassName = $targetClass->getName(); |
231 | 231 | |
232 | - if (! $sorter->hasNode($targetClassName)) { |
|
232 | + if (!$sorter->hasNode($targetClassName)) { |
|
233 | 233 | $sorter->addNode($targetClassName, $targetClass); |
234 | 234 | } |
235 | 235 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | $parentClass = $em->getClassMetadata($parentClass); |
242 | 242 | $parentClassName = $parentClass->getName(); |
243 | 243 | |
244 | - if (! $sorter->hasNode($parentClassName)) { |
|
244 | + if (!$sorter->hasNode($parentClassName)) { |
|
245 | 245 | $sorter->addNode($parentClassName, $parentClass); |
246 | 246 | } |
247 | 247 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | |
265 | 265 | foreach ($classes as $class) { |
266 | 266 | foreach ($class->associationMappings as $assoc) { |
267 | - if (! $assoc['isOwningSide'] || $assoc['type'] !== ClassMetadata::MANY_TO_MANY) { |
|
267 | + if (!$assoc['isOwningSide'] || $assoc['type'] !== ClassMetadata::MANY_TO_MANY) { |
|
268 | 268 | continue; |
269 | 269 | } |
270 | 270 | |
@@ -277,8 +277,8 @@ discard block |
||
277 | 277 | |
278 | 278 | private function getTableName(ClassMetadata $class, AbstractPlatform $platform): string |
279 | 279 | { |
280 | - if (isset($class->table['schema']) && ! method_exists($class, 'getSchemaName')) { |
|
281 | - return $class->table['schema'] . '.' . |
|
280 | + if (isset($class->table['schema']) && !method_exists($class, 'getSchemaName')) { |
|
281 | + return $class->table['schema'].'.'. |
|
282 | 282 | $this->em->getConfiguration() |
283 | 283 | ->getQuoteStrategy() |
284 | 284 | ->getTableName($class, $platform); |
@@ -295,8 +295,8 @@ discard block |
||
295 | 295 | ClassMetadata $class, |
296 | 296 | AbstractPlatform $platform |
297 | 297 | ): string { |
298 | - if (isset($assoc['joinTable']['schema']) && ! method_exists($class, 'getSchemaName')) { |
|
299 | - return $assoc['joinTable']['schema'] . '.' . |
|
298 | + if (isset($assoc['joinTable']['schema']) && !method_exists($class, 'getSchemaName')) { |
|
299 | + return $assoc['joinTable']['schema'].'.'. |
|
300 | 300 | $this->em->getConfiguration() |
301 | 301 | ->getQuoteStrategy() |
302 | 302 | ->getJoinTableName($assoc, $class, $platform); |
@@ -309,6 +309,6 @@ discard block |
||
309 | 309 | { |
310 | 310 | $tableIdentifier = new Identifier($tableName); |
311 | 311 | |
312 | - return 'DELETE FROM ' . $tableIdentifier->getQuotedName($platform); |
|
312 | + return 'DELETE FROM '.$tableIdentifier->getQuotedName($platform); |
|
313 | 313 | } |
314 | 314 | } |