Failed Conditions
Pull Request — master (#6743)
by Grégoire
11:42
created
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Tools;
6 6
 
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
                     $pkColumns = [];
182 182
 
183 183
                     foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
184
-                        if (! ($property instanceof FieldMetadata)) {
184
+                        if ( ! ($property instanceof FieldMetadata)) {
185 185
                             continue;
186 186
                         }
187 187
 
188
-                        if (! $class->isInheritedProperty($fieldName)) {
188
+                        if ( ! $class->isInheritedProperty($fieldName)) {
189 189
                             $columnName = $this->platform->quoteIdentifier($property->getColumnName());
190 190
 
191 191
                             $this->gatherColumn($class, $property, $table);
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
                             }
221 221
                         }
222 222
 
223
-                        if (! empty($inheritedKeyColumns)) {
223
+                        if ( ! empty($inheritedKeyColumns)) {
224 224
                             // Add a FK constraint on the ID column
225 225
                             $rootClass = $this->em->getClassMetadata($class->getRootClassName());
226 226
 
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
                 }
266 266
             }
267 267
 
268
-            if (! $table->hasIndex('primary')) {
268
+            if ( ! $table->hasIndex('primary')) {
269 269
                 $table->setPrimaryKey($pkColumns);
270 270
             }
271 271
 
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
             $processedClasses[$class->getClassName()] = true;
326 326
 
327 327
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
328
-                if (! $property instanceof FieldMetadata
328
+                if ( ! $property instanceof FieldMetadata
329 329
                     || ! $property->hasValueGenerator()
330 330
                     || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE
331 331
                     || $class->getClassName() !== $class->getRootClassName()) {
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
                 $quotedName = $this->platform->quoteIdentifier($property->getValueGenerator()->getDefinition()['sequenceName']);
336 336
 
337
-                if (! $schema->hasSequence($quotedName)) {
337
+                if ( ! $schema->hasSequence($quotedName)) {
338 338
                     $schema->createSequence($quotedName, $property->getValueGenerator()->getDefinition()['allocationSize']);
339 339
                 }
340 340
             }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             }
348 348
         }
349 349
 
350
-        if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
350
+        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
351 351
             $schema->visit(new RemoveNamespacedAssets());
352 352
         }
353 353
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
                 break;
387 387
         }
388 388
 
389
-        if (! empty($discrColumn->getColumnDefinition())) {
389
+        if ( ! empty($discrColumn->getColumnDefinition())) {
390 390
             $options['columnDefinition'] = $discrColumn->getColumnDefinition();
391 391
         }
392 392
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         $pkColumns = [];
405 405
 
406 406
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
407
-            if (! ($property instanceof FieldMetadata)) {
407
+            if ( ! ($property instanceof FieldMetadata)) {
408 408
                 continue;
409 409
             }
410 410
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
     private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)
520 520
     {
521 521
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
522
-            if (! ($property instanceof AssociationMetadata)) {
522
+            if ( ! ($property instanceof AssociationMetadata)) {
523 523
                 continue;
524 524
             }
525 525
 
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                 continue;
528 528
             }
529 529
 
530
-            if (! $property->isOwningSide()) {
530
+            if ( ! $property->isOwningSide()) {
531 531
                 continue;
532 532
             }
533 533
 
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
         $idColumns        = $class->getIdentifierColumns($this->em);
618 618
         $idColumnNameList = array_keys($idColumns);
619 619
 
620
-        if (! in_array($referencedColumnName, $idColumnNameList, true)) {
620
+        if ( ! in_array($referencedColumnName, $idColumnNameList, true)) {
621 621
             return null;
622 622
         }
623 623
 
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
         foreach ($class->getIdentifierFieldNames() as $fieldName) {
626 626
             $property = $class->getProperty($fieldName);
627 627
 
628
-            if (! ($property instanceof AssociationMetadata)) {
628
+            if ( ! ($property instanceof AssociationMetadata)) {
629 629
                 continue;
630 630
             }
631 631
 
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
                 $joinColumn->getReferencedColumnName()
682 682
             );
683 683
 
684
-            if (! $definingClass) {
684
+            if ( ! $definingClass) {
685 685
                 throw new MissingColumnException(
686 686
                     $joinColumn->getReferencedColumnName(),
687 687
                     $mapping->getSourceEntity(),
@@ -696,14 +696,14 @@  discard block
 block discarded – undo
696 696
             $localColumns[]      = $quotedColumnName;
697 697
             $foreignColumns[]    = $quotedReferencedColumnName;
698 698
 
699
-            if (! $theJoinTable->hasColumn($quotedColumnName)) {
699
+            if ( ! $theJoinTable->hasColumn($quotedColumnName)) {
700 700
                 // Only add the column to the table if it does not exist already.
701 701
                 // It might exist already if the foreign key is mapped into a regular
702 702
                 // property as well.
703 703
                 $property  = $definingClass->getProperty($referencedFieldName);
704 704
                 $columnDef = null;
705 705
 
706
-                if (! empty($joinColumn->getColumnDefinition())) {
706
+                if ( ! empty($joinColumn->getColumnDefinition())) {
707 707
                     $columnDef = $joinColumn->getColumnDefinition();
708 708
                 } elseif ($property->getColumnDefinition()) {
709 709
                     $columnDef = $property->getColumnDefinition();
@@ -737,7 +737,7 @@  discard block
 block discarded – undo
737 737
                 $uniqueConstraints[] = ['columns' => [$quotedColumnName]];
738 738
             }
739 739
 
740
-            if (! empty($joinColumn->getOnDelete())) {
740
+            if ( ! empty($joinColumn->getOnDelete())) {
741 741
                 $fkOptions['onDelete'] = $joinColumn->getOnDelete();
742 742
             }
743 743
         }
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
             $theJoinTable->addUniqueIndex($unique['columns'], is_numeric($indexName) ? null : $indexName);
749 749
         }
750 750
 
751
-        $compositeName = $theJoinTable->getName() . '.' . implode('', $localColumns);
751
+        $compositeName = $theJoinTable->getName().'.'.implode('', $localColumns);
752 752
 
753 753
         if (isset($addedFks[$compositeName])
754 754
             && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName']
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
             }
766 766
 
767 767
             $blacklistedFks[$compositeName] = true;
768
-        } elseif (! isset($blacklistedFks[$compositeName])) {
768
+        } elseif ( ! isset($blacklistedFks[$compositeName])) {
769 769
             $addedFks[$compositeName] = [
770 770
                 'foreignTableName' => $foreignTableName,
771 771
                 'foreignColumns'   => $foreignColumns,
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
         $fullSchema = $sm->createSchema();
848 848
 
849 849
         foreach ($fullSchema->getTables() as $table) {
850
-            if (! $schema->hasTable($table->getName())) {
850
+            if ( ! $schema->hasTable($table->getName())) {
851 851
                 foreach ($table->getForeignKeys() as $foreignKey) {
852 852
                     /* @var $foreignKey \Doctrine\DBAL\Schema\ForeignKeyConstraint */
853 853
                     if ($schema->hasTable($foreignKey->getForeignTableName())) {
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
                 if ($table->hasPrimaryKey()) {
873 873
                     $columns = $table->getPrimaryKey()->getColumns();
874 874
                     if (count($columns) === 1) {
875
-                        $checkSequence = $table->getName() . '_' . $columns[0] . '_seq';
875
+                        $checkSequence = $table->getName().'_'.$columns[0].'_seq';
876 876
                         if ($fullSchema->hasSequence($checkSequence)) {
877 877
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
878 878
                         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/MissingColumnException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Tools;
6 6
 
Please login to merge, or discard this patch.