Completed
Push — master ( 7c65fa...d64a01 )
by Neomerx
05:59
created
src/Contracts/MigrationContextInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Data\Contracts;
4 4
 
Please login to merge, or discard this patch.
src/Seeds/SeedTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Data\Seeds;
4 4
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
      */
249 249
     private function createAttributeTypeGetter(array $attributeTypes): Closure
250 250
     {
251
-        return function (string $attributeType) use ($attributeTypes) : string {
251
+        return function(string $attributeType) use ($attributeTypes) : string {
252 252
             return array_key_exists($attributeType, $attributeTypes) === true ?
253 253
                 $attributeTypes[$attributeType] : Type::STRING;
254 254
         };
Please login to merge, or discard this patch.
src/Migrations/RawNameType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Data\Migrations;
4 4
 
Please login to merge, or discard this patch.
src/Migrations/EnumType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Data\Migrations;
4 4
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         );
45 45
         $values = $fieldDeclaration[static::TYPE_NAME];
46 46
 
47
-        $quotedValues = array_map(function (string $value) use ($platform, $values) : string {
47
+        $quotedValues = array_map(function(string $value) use ($platform, $values) : string {
48 48
             return $platform->quoteStringLiteral($value);
49 49
         }, $values);
50 50
 
Please login to merge, or discard this patch.
src/Migrations/MigrationTrait.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Data\Migrations;
4 4
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
         // check all values are strings
162 162
         assert(
163
-            call_user_func(function () use ($values): bool {
163
+            call_user_func(function() use ($values): bool {
164 164
                 $allAreStrings = true;
165 165
                 foreach ($values as $value) {
166 166
                     $allAreStrings = $allAreStrings && is_string($value);
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
     protected function useEnum(string $columnName, string $enumName, bool $notNullable = true): Closure
216 216
     {
217 217
         if ($this->getConnection()->getDriver()->getName() === 'pdo_pgsql') {
218
-            return function (Table $table) use ($columnName, $enumName): void {
218
+            return function(Table $table) use ($columnName, $enumName): void {
219 219
                 $typeName = RawNameType::TYPE_NAME;
220 220
                 Type::hasType($typeName) === true ?: Type::addType($typeName, RawNameType::class);
221 221
                 $table
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         } else {
226 226
             $enumValues = $this->enumerations[$enumName];
227 227
 
228
-            return function (Table $table) use ($columnName, $enumValues, $notNullable) {
228
+            return function(Table $table) use ($columnName, $enumValues, $notNullable) {
229 229
                 Type::hasType(EnumType::TYPE_NAME) === true ?: Type::addType(EnumType::TYPE_NAME, EnumType::class);
230 230
                 $table
231 231
                     ->addColumn($columnName, EnumType::TYPE_NAME)
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
      */
243 243
     protected function primaryInt(string $name): Closure
244 244
     {
245
-        return function (Table $table) use ($name) {
245
+        return function(Table $table) use ($name) {
246 246
             $table->addColumn($name, Type::INTEGER)->setAutoincrement(true)->setUnsigned(true)->setNotnull(true);
247 247
             $table->setPrimaryKey([$name]);
248 248
         };
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
      */
256 256
     protected function primaryString(string $name): Closure
257 257
     {
258
-        return function (Table $table, MigrationContextInterface $context) use ($name) {
258
+        return function(Table $table, MigrationContextInterface $context) use ($name) {
259 259
             $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name);
260 260
             $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(true);
261 261
             $table->setPrimaryKey([$name]);
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
      */
271 271
     protected function int(string $name, int $default = null): Closure
272 272
     {
273
-        return function (Table $table) use ($name, $default) {
273
+        return function(Table $table) use ($name, $default) {
274 274
             $column = $table->addColumn($name, Type::INTEGER)->setUnsigned(false)->setNotnull(true);
275 275
             $default === null ?: $column->setDefault($default);
276 276
         };
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      */
285 285
     protected function nullableInt(string $name, int $default = null): Closure
286 286
     {
287
-        return function (Table $table) use ($name, $default) {
287
+        return function(Table $table) use ($name, $default) {
288 288
             $table->addColumn($name, Type::INTEGER)->setUnsigned(false)->setNotnull(false)->setDefault($default);
289 289
         };
290 290
     }
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
     {
321 321
         // precision and scale both seems to be ignored in Doctrine so not much sense to have them as inputs
322 322
 
323
-        return function (Table $table) use ($name) {
323
+        return function(Table $table) use ($name) {
324 324
             $table->addColumn($name, Type::FLOAT)->setNotnull(true);
325 325
         };
326 326
     }
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
      */
333 333
     protected function string(string $name): Closure
334 334
     {
335
-        return function (Table $table, MigrationContextInterface $context) use ($name) {
335
+        return function(Table $table, MigrationContextInterface $context) use ($name) {
336 336
             $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name);
337 337
             $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(true);
338 338
         };
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
      */
346 346
     protected function nullableString(string $name): Closure
347 347
     {
348
-        return function (Table $table, MigrationContextInterface $context) use ($name) {
348
+        return function(Table $table, MigrationContextInterface $context) use ($name) {
349 349
             $length = $context->getModelSchemas()->getAttributeLength($context->getModelClass(), $name);
350 350
             $table->addColumn($name, Type::STRING)->setLength($length)->setNotnull(false);
351 351
         };
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
      */
359 359
     protected function text(string $name): Closure
360 360
     {
361
-        return function (Table $table) use ($name) {
361
+        return function(Table $table) use ($name) {
362 362
             $table->addColumn($name, Type::TEXT)->setNotnull(true);
363 363
         };
364 364
     }
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
      */
371 371
     protected function nullableText(string $name): Closure
372 372
     {
373
-        return function (Table $table) use ($name) {
373
+        return function(Table $table) use ($name) {
374 374
             $table->addColumn($name, Type::TEXT)->setNotnull(false);
375 375
         };
376 376
     }
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
      */
384 384
     protected function bool(string $name, bool $default = null): Closure
385 385
     {
386
-        return function (Table $table) use ($name, $default) {
386
+        return function(Table $table) use ($name, $default) {
387 387
             $column = $table->addColumn($name, Type::BOOLEAN)->setNotnull(true);
388 388
             if ($default !== null) {
389 389
                 $column->setDefault($default);
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
      */
399 399
     protected function binary(string $name): Closure
400 400
     {
401
-        return function (Table $table) use ($name) {
401
+        return function(Table $table) use ($name) {
402 402
             $table->addColumn($name, Type::BINARY)->setNotnull(true);
403 403
         };
404 404
     }
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
      */
439 439
     protected function timestamps(): Closure
440 440
     {
441
-        return function (Table $table, MigrationContextInterface $context) {
441
+        return function(Table $table, MigrationContextInterface $context) {
442 442
             $modelClass = $context->getModelClass();
443 443
 
444 444
             $createdAt = TimestampFields::FIELD_CREATED_AT;
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
      */
471 471
     protected function datetime(string $name): Closure
472 472
     {
473
-        return function (Table $table) use ($name) {
473
+        return function(Table $table) use ($name) {
474 474
             $table->addColumn($name, Type::DATETIME)->setNotnull(true);
475 475
         };
476 476
     }
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
      */
483 483
     protected function nullableDatetime(string $name): Closure
484 484
     {
485
-        return function (Table $table) use ($name) {
485
+        return function(Table $table) use ($name) {
486 486
             $table->addColumn($name, Type::DATETIME)->setNotnull(false);
487 487
         };
488 488
     }
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
      */
495 495
     protected function date(string $name): Closure
496 496
     {
497
-        return function (Table $table) use ($name) {
497
+        return function(Table $table) use ($name) {
498 498
             $table->addColumn($name, Type::DATE)->setNotnull(true);
499 499
         };
500 500
     }
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
      */
507 507
     protected function nullableDate(string $name): Closure
508 508
     {
509
-        return function (Table $table) use ($name) {
509
+        return function(Table $table) use ($name) {
510 510
             $table->addColumn($name, Type::DATE)->setNotnull(false);
511 511
         };
512 512
     }
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
      */
519 519
     protected function unique(array $names): Closure
520 520
     {
521
-        return function (Table $table) use ($names) {
521
+        return function(Table $table) use ($names) {
522 522
             $table->addUniqueIndex($names);
523 523
         };
524 524
     }
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
      */
531 531
     protected function searchable(array $names): Closure
532 532
     {
533
-        return function (Table $table) use ($names) {
533
+        return function(Table $table) use ($names) {
534 534
             $table->addIndex($names, null, ['fulltext']);
535 535
         };
536 536
     }
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
         string $referredClass,
550 550
         string $onDeleteRestriction = RelationshipRestrictions::RESTRICT
551 551
     ): Closure {
552
-        return function (
552
+        return function(
553 553
             Table $table,
554 554
             MigrationContextInterface $context
555 555
         ) use (
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
         string $referredClass,
591 591
         string $onDeleteRestriction = RelationshipRestrictions::RESTRICT
592 592
     ): Closure {
593
-        return function (
593
+        return function(
594 594
             Table $table,
595 595
             MigrationContextInterface $context
596 596
         ) use (
@@ -728,7 +728,7 @@  discard block
 block discarded – undo
728 728
      */
729 729
     protected function defaultValue(string $name, $value): Closure
730 730
     {
731
-        return function (Table $table) use ($name, $value) {
731
+        return function(Table $table) use ($name, $value) {
732 732
             assert($table->hasColumn($name));
733 733
             $table->getColumn($name)->setDefault($value);
734 734
         };
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
      */
742 742
     protected function nullableValue(string $name): Closure
743 743
     {
744
-        return function (Table $table) use ($name) {
744
+        return function(Table $table) use ($name) {
745 745
             assert($table->hasColumn($name));
746 746
             $table->getColumn($name)->setNotnull(false);
747 747
         };
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
      */
755 755
     protected function notNullableValue(string $name): Closure
756 756
     {
757
-        return function (Table $table) use ($name) {
757
+        return function(Table $table) use ($name) {
758 758
             assert($table->hasColumn($name));
759 759
             $table->getColumn($name)->setNotnull(true);
760 760
         };
@@ -769,7 +769,7 @@  discard block
 block discarded – undo
769 769
      */
770 770
     private function unsignedIntImpl(string $name, bool $notNullable, $default = null): Closure
771 771
     {
772
-        return function (Table $table) use ($name, $notNullable, $default) {
772
+        return function(Table $table) use ($name, $notNullable, $default) {
773 773
             $column = $table->addColumn($name, Type::INTEGER)->setUnsigned(true)->setNotnull($notNullable);
774 774
             $default === null ?: $column->setDefault($default);
775 775
         };
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
         bool $notNullable,
796 796
         string $onDeleteRestriction
797 797
     ): Closure {
798
-        return function (Table $table) use (
798
+        return function(Table $table) use (
799 799
             $localKey,
800 800
             $foreignTable,
801 801
             $foreignKey,
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
      */
825 825
     private function relationshipImpl(string $name, bool $notNullable, string $onDeleteRestriction): Closure
826 826
     {
827
-        return function (
827
+        return function(
828 828
             Table $table,
829 829
             MigrationContextInterface $context
830 830
         ) use (
Please login to merge, or discard this patch.
src/Migrations/MigrationContext.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Data\Migrations;
4 4
 
Please login to merge, or discard this patch.
src/Migrations/RelationshipRestrictions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare (strict_types = 1);
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace Limoncello\Data\Migrations;
4 4
 
Please login to merge, or discard this patch.