Completed
Push — master ( 1340df...e03243 )
by Neomerx
03:41
created
src/Migrations/EnumType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
         );
39 39
         $values = $fieldDeclaration[static::TYPE_NAME];
40 40
 
41
-        $quotedValues = array_map(function (string $value) use ($platform, $values) : string {
41
+        $quotedValues = array_map(function(string $value) use ($platform, $values) : string {
42 42
             return $platform->quoteStringLiteral($value);
43 43
         }, $values);
44 44
 
Please login to merge, or discard this patch.
src/Migrations/MigrationTrait.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
         // check all values are strings
147 147
         assert(
148
-            call_user_func(function () use ($values): bool {
148
+            call_user_func(function() use ($values): bool {
149 149
                 $allAreStrings = true;
150 150
                 foreach ($values as $value) {
151 151
                     $allAreStrings = $allAreStrings && is_string($value);
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     protected function useEnum(string $columnName, string $enumName, bool $notNullable = true): Closure
201 201
     {
202 202
         if ($this->getConnection()->getDriver()->getName() === 'pdo_pgsql') {
203
-            return function (Table $table) use ($columnName, $enumName): void {
203
+            return function(Table $table) use ($columnName, $enumName): void {
204 204
                 $typeName = RawNameType::TYPE_NAME;
205 205
                 Type::hasType($typeName) === true ?: Type::addType($typeName, RawNameType::class);
206 206
                 $table
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         } else {
211 211
             $enumValues = $this->enumerations[$enumName];
212 212
 
213
-            return function (Table $table) use ($columnName, $enumValues, $notNullable) {
213
+            return function(Table $table) use ($columnName, $enumValues, $notNullable) {
214 214
                 Type::hasType(EnumType::TYPE_NAME) === true ?: Type::addType(EnumType::TYPE_NAME, EnumType::class);
215 215
                 $table
216 216
                     ->addColumn($columnName, EnumType::TYPE_NAME)
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      */
228 228
     protected function primaryInt(string $name): Closure
229 229
     {
230
-        return function (Table $table) use ($name) {
230
+        return function(Table $table) use ($name) {
231 231
             $table->addColumn($name, Type::INTEGER)->setAutoincrement(true)->setUnsigned(true)->setNotnull(true);
232 232
             $table->setPrimaryKey([$name]);
233 233
         };
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
      */
241 241
     protected function primaryString(string $name): Closure
242 242
     {
243
-        return function (Table $table, MigrationContextInterface $context) use ($name) {
243
+        return function(Table $table, MigrationContextInterface $context) use ($name) {
244 244
             $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name);
245 245
             $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(true);
246 246
             $table->setPrimaryKey([$name]);
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
      */
256 256
     protected function int(string $name, int $default = null): Closure
257 257
     {
258
-        return function (Table $table) use ($name, $default) {
258
+        return function(Table $table) use ($name, $default) {
259 259
             $column = $table->addColumn($name, Type::INTEGER)->setUnsigned(false)->setNotnull(true);
260 260
             $default === null ?: $column->setDefault($default);
261 261
         };
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
      */
270 270
     protected function nullableInt(string $name, int $default = null): Closure
271 271
     {
272
-        return function (Table $table) use ($name, $default) {
272
+        return function(Table $table) use ($name, $default) {
273 273
             $table->addColumn($name, Type::INTEGER)->setUnsigned(false)->setNotnull(false)->setDefault($default);
274 274
         };
275 275
     }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     {
306 306
         // precision and scale both seems to be ignored in Doctrine so not much sense to have them as inputs
307 307
 
308
-        return function (Table $table) use ($name) {
308
+        return function(Table $table) use ($name) {
309 309
             $table->addColumn($name, Type::FLOAT)->setNotnull(true);
310 310
         };
311 311
     }
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
      */
318 318
     protected function string(string $name): Closure
319 319
     {
320
-        return function (Table $table, MigrationContextInterface $context) use ($name) {
320
+        return function(Table $table, MigrationContextInterface $context) use ($name) {
321 321
             $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name);
322 322
             $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(true);
323 323
         };
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
      */
331 331
     protected function nullableString(string $name): Closure
332 332
     {
333
-        return function (Table $table, MigrationContextInterface $context) use ($name) {
333
+        return function(Table $table, MigrationContextInterface $context) use ($name) {
334 334
             $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name);
335 335
             $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(false);
336 336
         };
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
      */
344 344
     protected function text(string $name): Closure
345 345
     {
346
-        return function (Table $table) use ($name) {
346
+        return function(Table $table) use ($name) {
347 347
             $table->addColumn($name, Type::TEXT)->setNotnull(true);
348 348
         };
349 349
     }
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
      */
356 356
     protected function nullableText(string $name): Closure
357 357
     {
358
-        return function (Table $table) use ($name) {
358
+        return function(Table $table) use ($name) {
359 359
             $table->addColumn($name, Type::TEXT)->setNotnull(false);
360 360
         };
361 361
     }
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
      */
369 369
     protected function bool(string $name, $default = null): Closure
370 370
     {
371
-        return function (Table $table) use ($name, $default) {
371
+        return function(Table $table) use ($name, $default) {
372 372
             $column = $table->addColumn($name, Type::BOOLEAN)->setNotnull(true);
373 373
             if ($default !== null && is_bool($default) === true) {
374 374
                 $column->setDefault($default);
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
      */
412 412
     protected function timestamps(): Closure
413 413
     {
414
-        return function (Table $table, MigrationContextInterface $context) {
414
+        return function(Table $table, MigrationContextInterface $context) {
415 415
             $modelClass = $context->getModelClass();
416 416
 
417 417
             $createdAt = TimestampFields::FIELD_CREATED_AT;
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
      */
444 444
     protected function datetime(string $name): Closure
445 445
     {
446
-        return function (Table $table) use ($name) {
446
+        return function(Table $table) use ($name) {
447 447
             $table->addColumn($name, Type::DATETIME)->setNotnull(true);
448 448
         };
449 449
     }
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
      */
456 456
     protected function nullableDatetime(string $name): Closure
457 457
     {
458
-        return function (Table $table) use ($name) {
458
+        return function(Table $table) use ($name) {
459 459
             $table->addColumn($name, Type::DATETIME)->setNotnull(false);
460 460
         };
461 461
     }
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
      */
468 468
     protected function date(string $name): Closure
469 469
     {
470
-        return function (Table $table) use ($name) {
470
+        return function(Table $table) use ($name) {
471 471
             $table->addColumn($name, Type::DATE)->setNotnull(true);
472 472
         };
473 473
     }
@@ -479,7 +479,7 @@  discard block
 block discarded – undo
479 479
      */
480 480
     protected function nullableDate(string $name): Closure
481 481
     {
482
-        return function (Table $table) use ($name) {
482
+        return function(Table $table) use ($name) {
483 483
             $table->addColumn($name, Type::DATE)->setNotnull(false);
484 484
         };
485 485
     }
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
      */
492 492
     protected function unique(array $names): Closure
493 493
     {
494
-        return function (Table $table) use ($names) {
494
+        return function(Table $table) use ($names) {
495 495
             $table->addUniqueIndex($names);
496 496
         };
497 497
     }
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
      */
504 504
     protected function searchable(array $names): Closure
505 505
     {
506
-        return function (Table $table) use ($names) {
506
+        return function(Table $table) use ($names) {
507 507
             $table->addIndex($names, null, ['fulltext']);
508 508
         };
509 509
     }
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
         string $referredClass,
523 523
         bool $cascadeDelete = false
524 524
     ): Closure {
525
-        return function (
525
+        return function(
526 526
             Table $table,
527 527
             MigrationContextInterface $context
528 528
         ) use (
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
         string $referredClass,
557 557
         bool $cascadeDelete = false
558 558
     ): Closure {
559
-        return function (
559
+        return function(
560 560
             Table $table,
561 561
             MigrationContextInterface $context
562 562
         ) use (
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
      */
675 675
     protected function defaultValue(string $name, $value): Closure
676 676
     {
677
-        return function (Table $table) use ($name, $value) {
677
+        return function(Table $table) use ($name, $value) {
678 678
             assert($table->hasColumn($name));
679 679
             $table->getColumn($name)->setDefault($value);
680 680
         };
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
      */
688 688
     protected function nullableValue(string $name): Closure
689 689
     {
690
-        return function (Table $table) use ($name) {
690
+        return function(Table $table) use ($name) {
691 691
             assert($table->hasColumn($name));
692 692
             $table->getColumn($name)->setNotnull(false);
693 693
         };
@@ -700,7 +700,7 @@  discard block
 block discarded – undo
700 700
      */
701 701
     protected function notNullableValue(string $name): Closure
702 702
     {
703
-        return function (Table $table) use ($name) {
703
+        return function(Table $table) use ($name) {
704 704
             assert($table->hasColumn($name));
705 705
             $table->getColumn($name)->setNotnull(true);
706 706
         };
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
      */
716 716
     private function unsignedIntImpl(string $name, bool $notNullable, $default = null): Closure
717 717
     {
718
-        return function (Table $table) use ($name, $notNullable, $default) {
718
+        return function(Table $table) use ($name, $notNullable, $default) {
719 719
             $column = $table->addColumn($name, Type::INTEGER)->setUnsigned(true)->setNotnull($notNullable);
720 720
             $default === null ?: $column->setDefault($default);
721 721
         };
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
         bool $notNullable,
742 742
         bool $cascadeDelete
743 743
     ): Closure {
744
-        return function (Table $table) use (
744
+        return function(Table $table) use (
745 745
             $localKey,
746 746
             $foreignTable,
747 747
             $foreignKey,
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
      */
767 767
     private function relationshipImpl(string $name, bool $notNullable, bool $cascadeDelete): Closure
768 768
     {
769
-        return function (
769
+        return function(
770 770
             Table $table,
771 771
             MigrationContextInterface $context
772 772
         ) use (
Please login to merge, or discard this patch.
src/Seeds/SeedTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@
 block discarded – undo
244 244
      */
245 245
     private function createAttributeTypeGetter(array $attributeTypes): Closure
246 246
     {
247
-        return function (string $attributeType) use ($attributeTypes) : string {
247
+        return function(string $attributeType) use ($attributeTypes) : string {
248 248
             return array_key_exists($attributeType, $attributeTypes) === true ?
249 249
                 $attributeTypes[$attributeType] : Type::STRING;
250 250
         };
Please login to merge, or discard this patch.