Failed Conditions
Pull Request — master (#6959)
by Matthew
12:20
created
lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php 1 patch
Spacing   +39 added lines, -39 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\Mapping\Driver;
6 6
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             return $this->classNames;
179 179
         }
180 180
 
181
-        if (! $this->paths) {
181
+        if ( ! $this->paths) {
182 182
             throw Mapping\MappingException::pathRequired();
183 183
         }
184 184
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         $includedFiles = [];
187 187
 
188 188
         foreach ($this->paths as $path) {
189
-            if (! is_dir($path)) {
189
+            if ( ! is_dir($path)) {
190 190
                 throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
191 191
             }
192 192
 
@@ -195,14 +195,14 @@  discard block
 block discarded – undo
195 195
                     new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS),
196 196
                     \RecursiveIteratorIterator::LEAVES_ONLY
197 197
                 ),
198
-                '/^.+' . preg_quote($this->fileExtension) . '$/i',
198
+                '/^.+'.preg_quote($this->fileExtension).'$/i',
199 199
                 \RecursiveRegexIterator::GET_MATCH
200 200
             );
201 201
 
202 202
             foreach ($iterator as $file) {
203 203
                 $sourceFile = $file[0];
204 204
 
205
-                if (! preg_match('(^phar:)i', $sourceFile)) {
205
+                if ( ! preg_match('(^phar:)i', $sourceFile)) {
206 206
                     $sourceFile = realpath($sourceFile);
207 207
                 }
208 208
 
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     ) : Mapping\ClassMetadata {
247 247
         $reflectionClass = $metadata->getReflectionClass();
248 248
 
249
-        if (! $reflectionClass) {
249
+        if ( ! $reflectionClass) {
250 250
             // this happens when running annotation driver in combination with
251 251
             // static reflection services. This is not the nicest fix
252 252
             $reflectionClass = new \ReflectionClass($metadata->getClassName());
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
                 $classMetadata
283 283
             );
284 284
 
285
-            if (! $property) {
285
+            if ( ! $property) {
286 286
                 continue;
287 287
             }
288 288
 
@@ -579,11 +579,11 @@  discard block
 block discarded – undo
579 579
         $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval);
580 580
         $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch));
581 581
 
582
-        if (! empty($oneToOneAnnot->mappedBy)) {
582
+        if ( ! empty($oneToOneAnnot->mappedBy)) {
583 583
             $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy);
584 584
         }
585 585
 
586
-        if (! empty($oneToOneAnnot->inversedBy)) {
586
+        if ( ! empty($oneToOneAnnot->inversedBy)) {
587 587
             $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy);
588 588
         }
589 589
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
         $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade));
641 641
         $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch));
642 642
 
643
-        if (! empty($manyToOneAnnot->inversedBy)) {
643
+        if ( ! empty($manyToOneAnnot->inversedBy)) {
644 644
             $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy);
645 645
         }
646 646
 
@@ -698,11 +698,11 @@  discard block
 block discarded – undo
698 698
         $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval);
699 699
         $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch));
700 700
 
701
-        if (! empty($oneToManyAnnot->mappedBy)) {
701
+        if ( ! empty($oneToManyAnnot->mappedBy)) {
702 702
             $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy);
703 703
         }
704 704
 
705
-        if (! empty($oneToManyAnnot->indexBy)) {
705
+        if ( ! empty($oneToManyAnnot->indexBy)) {
706 706
             $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy);
707 707
         }
708 708
 
@@ -744,15 +744,15 @@  discard block
 block discarded – undo
744 744
         $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval);
745 745
         $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch));
746 746
 
747
-        if (! empty($manyToManyAnnot->mappedBy)) {
747
+        if ( ! empty($manyToManyAnnot->mappedBy)) {
748 748
             $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy);
749 749
         }
750 750
 
751
-        if (! empty($manyToManyAnnot->inversedBy)) {
751
+        if ( ! empty($manyToManyAnnot->inversedBy)) {
752 752
             $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy);
753 753
         }
754 754
 
755
-        if (! empty($manyToManyAnnot->indexBy)) {
755
+        if ( ! empty($manyToManyAnnot->indexBy)) {
756 756
             $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy);
757 757
         }
758 758
 
@@ -796,15 +796,15 @@  discard block
 block discarded – undo
796 796
 
797 797
         $fieldMetadata->setType(Type::getType($columnAnnot->type));
798 798
 
799
-        if (! empty($columnAnnot->name)) {
799
+        if ( ! empty($columnAnnot->name)) {
800 800
             $fieldMetadata->setColumnName($columnAnnot->name);
801 801
         }
802 802
 
803
-        if (! empty($columnAnnot->columnDefinition)) {
803
+        if ( ! empty($columnAnnot->columnDefinition)) {
804 804
             $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition);
805 805
         }
806 806
 
807
-        if (! empty($columnAnnot->length)) {
807
+        if ( ! empty($columnAnnot->length)) {
808 808
             $fieldMetadata->setLength($columnAnnot->length);
809 809
         }
810 810
 
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
         Annotation\Table $tableAnnot,
828 828
         Mapping\TableMetadata $tableMetadata
829 829
     ) : void {
830
-        if (! empty($tableAnnot->name)) {
830
+        if ( ! empty($tableAnnot->name)) {
831 831
             $tableMetadata->setName($tableAnnot->name);
832 832
         }
833 833
 
834
-        if (! empty($tableAnnot->schema)) {
834
+        if ( ! empty($tableAnnot->schema)) {
835 835
             $tableMetadata->setSchema($tableAnnot->schema);
836 836
         }
837 837
 
@@ -867,11 +867,11 @@  discard block
 block discarded – undo
867 867
     ) : Mapping\JoinTableMetadata {
868 868
         $joinTable = new Mapping\JoinTableMetadata();
869 869
 
870
-        if (! empty($joinTableAnnot->name)) {
870
+        if ( ! empty($joinTableAnnot->name)) {
871 871
             $joinTable->setName($joinTableAnnot->name);
872 872
         }
873 873
 
874
-        if (! empty($joinTableAnnot->schema)) {
874
+        if ( ! empty($joinTableAnnot->schema)) {
875 875
             $joinTable->setSchema($joinTableAnnot->schema);
876 876
         }
877 877
 
@@ -899,22 +899,22 @@  discard block
 block discarded – undo
899 899
         $joinColumn = new Mapping\JoinColumnMetadata();
900 900
 
901 901
         // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers
902
-        if (! empty($joinColumnAnnot->name)) {
902
+        if ( ! empty($joinColumnAnnot->name)) {
903 903
             $joinColumn->setColumnName($joinColumnAnnot->name);
904 904
         }
905 905
 
906
-        if (! empty($joinColumnAnnot->referencedColumnName)) {
906
+        if ( ! empty($joinColumnAnnot->referencedColumnName)) {
907 907
             $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName);
908 908
         }
909 909
 
910 910
         $joinColumn->setNullable($joinColumnAnnot->nullable);
911 911
         $joinColumn->setUnique($joinColumnAnnot->unique);
912 912
 
913
-        if (! empty($joinColumnAnnot->fieldName)) {
913
+        if ( ! empty($joinColumnAnnot->fieldName)) {
914 914
             $joinColumn->setAliasedName($joinColumnAnnot->fieldName);
915 915
         }
916 916
 
917
-        if (! empty($joinColumnAnnot->columnDefinition)) {
917
+        if ( ! empty($joinColumnAnnot->columnDefinition)) {
918 918
             $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition);
919 919
         }
920 920
 
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
         $fieldName = null
937 937
     ) : Mapping\CacheMetadata {
938 938
         $baseRegion    = strtolower(str_replace('\\', '_', $metadata->getRootClassName()));
939
-        $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : '');
939
+        $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : '');
940 940
 
941 941
         $usage  = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage));
942 942
         $region = $cacheAnnot->region ?: $defaultRegion;
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
         ) {
1000 1000
             // Handle the case where a middle mapped super class inherits from a single table inheritance tree.
1001 1001
             do {
1002
-                if (! $parent->isMappedSuperclass) {
1002
+                if ( ! $parent->isMappedSuperclass) {
1003 1003
                     $metadata->setTable($parent->table);
1004 1004
 
1005 1005
                     break;
@@ -1054,11 +1054,11 @@  discard block
 block discarded – undo
1054 1054
             $discriminatorColumn->setType(Type::getType($typeName));
1055 1055
             $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name);
1056 1056
 
1057
-            if (! empty($discriminatorColumnAnnotation->columnDefinition)) {
1057
+            if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) {
1058 1058
                 $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition);
1059 1059
             }
1060 1060
 
1061
-            if (! empty($discriminatorColumnAnnotation->length)) {
1061
+            if ( ! empty($discriminatorColumnAnnotation->length)) {
1062 1062
                 $discriminatorColumn->setLength($discriminatorColumnAnnotation->length);
1063 1063
             }
1064 1064
         }
@@ -1089,12 +1089,12 @@  discard block
 block discarded – undo
1089 1089
         if (isset($classAnnotations[Annotation\NamedQueries::class])) {
1090 1090
             $namedQueriesAnnot = $classAnnotations[Annotation\NamedQueries::class];
1091 1091
 
1092
-            if (! is_array($namedQueriesAnnot->value)) {
1092
+            if ( ! is_array($namedQueriesAnnot->value)) {
1093 1093
                 throw new \UnexpectedValueException('@NamedQueries should contain an array of @NamedQuery annotations.');
1094 1094
             }
1095 1095
 
1096 1096
             foreach ($namedQueriesAnnot->value as $namedQuery) {
1097
-                if (! ($namedQuery instanceof Annotation\NamedQuery)) {
1097
+                if ( ! ($namedQuery instanceof Annotation\NamedQuery)) {
1098 1098
                     throw new \UnexpectedValueException('@NamedQueries should contain an array of @NamedQuery annotations.');
1099 1099
                 }
1100 1100
 
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
             $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class];
1176 1176
 
1177 1177
             foreach ($entityListenersAnnot->value as $listenerClassName) {
1178
-                if (! class_exists($listenerClassName)) {
1178
+                if ( ! class_exists($listenerClassName)) {
1179 1179
                     throw Mapping\MappingException::entityListenerClassNotFound(
1180 1180
                         $listenerClassName,
1181 1181
                         $metadata->getClassName()
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
                 $fieldName = $associationOverride->name;
1213 1213
                 $property  = $metadata->getProperty($fieldName);
1214 1214
 
1215
-                if (! $property) {
1215
+                if ( ! $property) {
1216 1216
                     throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName);
1217 1217
                 }
1218 1218
 
@@ -1246,7 +1246,7 @@  discard block
 block discarded – undo
1246 1246
                 // Check for fetch
1247 1247
                 if ($associationOverride->fetch) {
1248 1248
                     $override->setFetchMode(
1249
-                        constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch)
1249
+                        constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch)
1250 1250
                     );
1251 1251
                 }
1252 1252
 
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
     {
1336 1336
         $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode);
1337 1337
 
1338
-        if (! defined($fetchModeConstant)) {
1338
+        if ( ! defined($fetchModeConstant)) {
1339 1339
             throw Mapping\MappingException::invalidFetchMode($className, $fetchMode);
1340 1340
         }
1341 1341
 
@@ -1381,7 +1381,7 @@  discard block
 block discarded – undo
1381 1381
         $classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
1382 1382
 
1383 1383
         foreach ($classAnnotations as $key => $annot) {
1384
-            if (! is_numeric($key)) {
1384
+            if ( ! is_numeric($key)) {
1385 1385
                 continue;
1386 1386
             }
1387 1387
 
@@ -1399,7 +1399,7 @@  discard block
 block discarded – undo
1399 1399
         $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
1400 1400
 
1401 1401
         foreach ($propertyAnnotations as $key => $annot) {
1402
-            if (! is_numeric($key)) {
1402
+            if ( ! is_numeric($key)) {
1403 1403
                 continue;
1404 1404
             }
1405 1405
 
@@ -1417,7 +1417,7 @@  discard block
 block discarded – undo
1417 1417
         $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod);
1418 1418
 
1419 1419
         foreach ($methodAnnotations as $key => $annot) {
1420
-            if (! is_numeric($key)) {
1420
+            if ( ! is_numeric($key)) {
1421 1421
                 continue;
1422 1422
             }
1423 1423
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadata.php 1 patch
Spacing   +49 added lines, -49 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\Mapping;
6 6
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
      */
288 288
     public function __toString()
289 289
     {
290
-        return __CLASS__ . '@' . spl_object_id($this);
290
+        return __CLASS__.'@'.spl_object_id($this);
291 291
     }
292 292
 
293 293
     /**
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         // Restore ReflectionClass and properties
387 387
         $this->reflectionClass = $reflectionService->getClass($this->className);
388 388
 
389
-        if (! $this->reflectionClass) {
389
+        if ( ! $this->reflectionClass) {
390 390
             return;
391 391
         }
392 392
 
@@ -410,11 +410,11 @@  discard block
 block discarded – undo
410 410
         }
411 411
 
412 412
         // Verify & complete identifier mapping
413
-        if (! $this->identifier) {
413
+        if ( ! $this->identifier) {
414 414
             throw MappingException::identifierRequired($this->className);
415 415
         }
416 416
 
417
-        $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool {
417
+        $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool {
418 418
             return $property instanceof FieldMetadata
419 419
                 && $property->isPrimaryKey()
420 420
                 && $property->hasValueGenerator();
@@ -433,14 +433,14 @@  discard block
 block discarded – undo
433 433
     public function validateAssociations() : void
434 434
     {
435 435
         array_map(
436
-            function (Property $property) {
437
-                if (! ($property instanceof AssociationMetadata)) {
436
+            function(Property $property) {
437
+                if ( ! ($property instanceof AssociationMetadata)) {
438 438
                     return;
439 439
                 }
440 440
 
441 441
                 $targetEntity = $property->getTargetEntity();
442 442
 
443
-                if (! class_exists($targetEntity)) {
443
+                if ( ! class_exists($targetEntity)) {
444 444
                     throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName());
445 445
                 }
446 446
             },
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
         foreach ($this->lifecycleCallbacks as $callbacks) {
459 459
             /** @var array $callbacks */
460 460
             foreach ($callbacks as $callbackFuncName) {
461
-                if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) {
461
+                if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) {
462 462
                     throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName);
463 463
                 }
464 464
             }
@@ -482,11 +482,11 @@  discard block
 block discarded – undo
482 482
      */
483 483
     public function isIdentifier(string $fieldName) : bool
484 484
     {
485
-        if (! $this->identifier) {
485
+        if ( ! $this->identifier) {
486 486
             return false;
487 487
         }
488 488
 
489
-        if (! $this->isIdentifierComposite()) {
489
+        if ( ! $this->isIdentifierComposite()) {
490 490
             return $fieldName === $this->identifier[0];
491 491
         }
492 492
 
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
      */
510 510
     public function getNamedQuery($queryName) : string
511 511
     {
512
-        if (! isset($this->namedQueries[$queryName])) {
512
+        if ( ! isset($this->namedQueries[$queryName])) {
513 513
             throw MappingException::queryNotFound($this->className, $queryName);
514 514
         }
515 515
 
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
      */
540 540
     public function getNamedNativeQuery($queryName) : array
541 541
     {
542
-        if (! isset($this->namedNativeQueries[$queryName])) {
542
+        if ( ! isset($this->namedNativeQueries[$queryName])) {
543 543
             throw MappingException::queryNotFound($this->className, $queryName);
544 544
         }
545 545
 
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
      */
570 570
     public function getSqlResultSetMapping($name)
571 571
     {
572
-        if (! isset($this->sqlResultSetMappings[$name])) {
572
+        if ( ! isset($this->sqlResultSetMappings[$name])) {
573 573
             throw MappingException::resultMappingNotFound($this->className, $name);
574 574
         }
575 575
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
             $property->setColumnName($columnName);
603 603
         }
604 604
 
605
-        if (! $this->isMappedSuperclass) {
605
+        if ( ! $this->isMappedSuperclass) {
606 606
             $property->setTableName($this->getTableName());
607 607
         }
608 608
 
@@ -622,7 +622,7 @@  discard block
 block discarded – undo
622 622
                 throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($this->className, $property);
623 623
             }
624 624
 
625
-            if (! in_array($fieldName, $this->identifier)) {
625
+            if ( ! in_array($fieldName, $this->identifier)) {
626 626
                 $this->identifier[] = $fieldName;
627 627
             }
628 628
         }
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
         $fieldName    = $property->getName();
673 673
         $targetEntity = $property->getTargetEntity();
674 674
 
675
-        if (! $targetEntity) {
675
+        if ( ! $targetEntity) {
676 676
             throw MappingException::missingTargetEntity($fieldName);
677 677
         }
678 678
 
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
                 throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName);
687 687
             }
688 688
 
689
-            if (! in_array($property->getName(), $this->identifier)) {
689
+            if ( ! in_array($property->getName(), $this->identifier)) {
690 690
                 if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) {
691 691
                     throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId(
692 692
                         $property->getTargetEntity(),
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
                 /** @var JoinColumnMetadata $joinColumn */
753 753
                 if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) {
754 754
                     if (count($property->getJoinColumns()) === 1) {
755
-                        if (! $property->isPrimaryKey()) {
755
+                        if ( ! $property->isPrimaryKey()) {
756 756
                             $joinColumn->setUnique(true);
757 757
                         }
758 758
                     } else {
@@ -760,13 +760,13 @@  discard block
 block discarded – undo
760 760
                     }
761 761
                 }
762 762
 
763
-                $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null);
763
+                $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null);
764 764
 
765
-                if (! $joinColumn->getColumnName()) {
765
+                if ( ! $joinColumn->getColumnName()) {
766 766
                     $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className));
767 767
                 }
768 768
 
769
-                if (! $joinColumn->getReferencedColumnName()) {
769
+                if ( ! $joinColumn->getReferencedColumnName()) {
770 770
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
771 771
                 }
772 772
 
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
             }
775 775
 
776 776
             if ($uniqueConstraintColumns) {
777
-                if (! $this->table) {
777
+                if ( ! $this->table) {
778 778
                     throw new \RuntimeException(
779 779
                         'ClassMetadata::setTable() has to be called before defining a one to one relationship.'
780 780
                     );
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
         if ($property->isOrphanRemoval()) {
795 795
             $cascades = $property->getCascade();
796 796
 
797
-            if (! in_array('remove', $cascades)) {
797
+            if ( ! in_array('remove', $cascades)) {
798 798
                 $cascades[] = 'remove';
799 799
 
800 800
                 $property->setCascade($cascades);
@@ -860,14 +860,14 @@  discard block
 block discarded – undo
860 860
         $property->setOwningSide(false);
861 861
 
862 862
         // OneToMany MUST have mappedBy
863
-        if (! $property->getMappedBy()) {
863
+        if ( ! $property->getMappedBy()) {
864 864
             throw MappingException::oneToManyRequiresMappedBy($property->getName());
865 865
         }
866 866
 
867 867
         if ($property->isOrphanRemoval()) {
868 868
             $cascades = $property->getCascade();
869 869
 
870
-            if (! in_array('remove', $cascades)) {
870
+            if ( ! in_array('remove', $cascades)) {
871 871
                 $cascades[] = 'remove';
872 872
 
873 873
                 $property->setCascade($cascades);
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 
891 891
             $property->setJoinTable($joinTable);
892 892
 
893
-            if (! $joinTable->getName()) {
893
+            if ( ! $joinTable->getName()) {
894 894
                 $joinTableName = $this->namingStrategy->joinTableName(
895 895
                     $property->getSourceEntity(),
896 896
                     $property->getTargetEntity(),
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
 
903 903
             $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns();
904 904
 
905
-            if (! $joinTable->getJoinColumns()) {
905
+            if ( ! $joinTable->getJoinColumns()) {
906 906
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
907 907
                 $sourceReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName;
908 908
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName);
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
                 $joinTable->addJoinColumn($joinColumn);
916 916
             }
917 917
 
918
-            if (! $joinTable->getInverseJoinColumns()) {
918
+            if ( ! $joinTable->getInverseJoinColumns()) {
919 919
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
920 920
                 $targetReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName;
921 921
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName);
@@ -930,13 +930,13 @@  discard block
 block discarded – undo
930 930
 
931 931
             foreach ($joinTable->getJoinColumns() as $joinColumn) {
932 932
                 /** @var JoinColumnMetadata $joinColumn */
933
-                if (! $joinColumn->getReferencedColumnName()) {
933
+                if ( ! $joinColumn->getReferencedColumnName()) {
934 934
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
935 935
                 }
936 936
 
937 937
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
938 938
 
939
-                if (! $joinColumn->getColumnName()) {
939
+                if ( ! $joinColumn->getColumnName()) {
940 940
                     $columnName = $this->namingStrategy->joinKeyColumnName(
941 941
                         $property->getSourceEntity(),
942 942
                         $referencedColumnName
@@ -948,13 +948,13 @@  discard block
 block discarded – undo
948 948
 
949 949
             foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) {
950 950
                 /** @var JoinColumnMetadata $inverseJoinColumn */
951
-                if (! $inverseJoinColumn->getReferencedColumnName()) {
951
+                if ( ! $inverseJoinColumn->getReferencedColumnName()) {
952 952
                     $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
953 953
                 }
954 954
 
955 955
                 $referencedColumnName = $inverseJoinColumn->getReferencedColumnName();
956 956
 
957
-                if (! $inverseJoinColumn->getColumnName()) {
957
+                if ( ! $inverseJoinColumn->getColumnName()) {
958 958
                     $columnName = $this->namingStrategy->joinKeyColumnName(
959 959
                         $property->getTargetEntity(),
960 960
                         $referencedColumnName
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
             throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className);
989 989
         }
990 990
 
991
-        if (! isset($this->identifier[0])) {
991
+        if ( ! isset($this->identifier[0])) {
992 992
             throw MappingException::noIdDefined($this->className);
993 993
         }
994 994
 
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
             // Association defined as Id field
1048 1048
             $targetClass = $em->getClassMetadata($property->getTargetEntity());
1049 1049
 
1050
-            if (! $property->isOwningSide()) {
1050
+            if ( ! $property->isOwningSide()) {
1051 1051
                 $property    = $targetClass->getProperty($property->getMappedBy());
1052 1052
                 $targetClass = $em->getClassMetadata($property->getTargetEntity());
1053 1053
             }
@@ -1062,7 +1062,7 @@  discard block
 block discarded – undo
1062 1062
                 $columnName           = $joinColumn->getColumnName();
1063 1063
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
1064 1064
 
1065
-                if (! $joinColumn->getType()) {
1065
+                if ( ! $joinColumn->getType()) {
1066 1066
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em));
1067 1067
                 }
1068 1068
 
@@ -1096,11 +1096,11 @@  discard block
 block discarded – undo
1096 1096
     {
1097 1097
         $schema = $this->getSchemaName() === null
1098 1098
             ? ''
1099
-            : $this->getSchemaName() . '_'
1099
+            : $this->getSchemaName().'_'
1100 1100
         ;
1101 1101
 
1102 1102
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
1103
-        return $schema . $this->getTableName() . '_id_tmp';
1103
+        return $schema.$this->getTableName().'_id_tmp';
1104 1104
     }
1105 1105
 
1106 1106
     /**
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
      */
1135 1135
     public function setInheritanceType($type) : void
1136 1136
     {
1137
-        if (! $this->isInheritanceType($type)) {
1137
+        if ( ! $this->isInheritanceType($type)) {
1138 1138
             throw MappingException::invalidInheritanceType($this->className, $type);
1139 1139
         }
1140 1140
 
@@ -1152,7 +1152,7 @@  discard block
 block discarded – undo
1152 1152
     {
1153 1153
         $fieldName = $property->getName();
1154 1154
 
1155
-        if (! isset($this->declaredProperties[$fieldName])) {
1155
+        if ( ! isset($this->declaredProperties[$fieldName])) {
1156 1156
             throw MappingException::invalidOverrideFieldName($this->className, $fieldName);
1157 1157
         }
1158 1158
 
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
         $declaringClass    = $property->getDeclaringClass();
1351 1351
 
1352 1352
         if ($inheritedProperty instanceof FieldMetadata) {
1353
-            if (! $declaringClass->isMappedSuperclass) {
1353
+            if ( ! $declaringClass->isMappedSuperclass) {
1354 1354
                 $inheritedProperty->setTableName($property->getTableName());
1355 1355
             }
1356 1356
 
@@ -1409,7 +1409,7 @@  discard block
 block discarded – undo
1409 1409
             throw MappingException::duplicateQueryMapping($this->className, $name);
1410 1410
         }
1411 1411
 
1412
-        if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
1412
+        if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
1413 1413
             throw MappingException::missingQueryMapping($this->className, $name);
1414 1414
         }
1415 1415
 
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
      */
1427 1427
     public function addSqlResultSetMapping(array $resultMapping)
1428 1428
     {
1429
-        if (! isset($resultMapping['name'])) {
1429
+        if ( ! isset($resultMapping['name'])) {
1430 1430
             throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className);
1431 1431
         }
1432 1432
 
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
 
1437 1437
         if (isset($resultMapping['entities'])) {
1438 1438
             foreach ($resultMapping['entities'] as $key => $entityResult) {
1439
-                if (! isset($entityResult['entityClass'])) {
1439
+                if ( ! isset($entityResult['entityClass'])) {
1440 1440
                     throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']);
1441 1441
                 }
1442 1442
 
@@ -1445,11 +1445,11 @@  discard block
 block discarded – undo
1445 1445
 
1446 1446
                 if (isset($entityResult['fields'])) {
1447 1447
                     foreach ($entityResult['fields'] as $k => $field) {
1448
-                        if (! isset($field['name'])) {
1448
+                        if ( ! isset($field['name'])) {
1449 1449
                             throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']);
1450 1450
                         }
1451 1451
 
1452
-                        if (! isset($field['column'])) {
1452
+                        if ( ! isset($field['column'])) {
1453 1453
                             $fieldName = $field['name'];
1454 1454
 
1455 1455
                             if (strpos($fieldName, '.')) {
@@ -1547,11 +1547,11 @@  discard block
 block discarded – undo
1547 1547
             'method' => $method,
1548 1548
         ];
1549 1549
 
1550
-        if (! class_exists($class)) {
1550
+        if ( ! class_exists($class)) {
1551 1551
             throw MappingException::entityListenerClassNotFound($class, $this->className);
1552 1552
         }
1553 1553
 
1554
-        if (! method_exists($class, $method)) {
1554
+        if ( ! method_exists($class, $method)) {
1555 1555
             throw MappingException::entityListenerMethodNotFound($class, $method, $this->className);
1556 1556
         }
1557 1557
 
@@ -1618,7 +1618,7 @@  discard block
 block discarded – undo
1618 1618
             return;
1619 1619
         }
1620 1620
 
1621
-        if (! (class_exists($className) || interface_exists($className))) {
1621
+        if ( ! (class_exists($className) || interface_exists($className))) {
1622 1622
             throw MappingException::invalidClassInDiscriminatorMap($className, $this->className);
1623 1623
         }
1624 1624
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/AbstractClassMetadataFactory.php 1 patch
Spacing   +8 added lines, -8 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\Mapping;
6 6
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public function getAllMetadata() : array
133 133
     {
134
-        if (! $this->initialized) {
134
+        if ( ! $this->initialized) {
135 135
             $this->initialize();
136 136
         }
137 137
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 
173 173
         try {
174 174
             if ($this->cacheDriver) {
175
-                $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt);
175
+                $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt);
176 176
 
177 177
                 if ($cached instanceof ClassMetadata) {
178 178
                     $this->loadedMetadata[$realClassName] = $cached;
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
                     foreach ($this->loadMetadata($realClassName, $metadataBuildingContext) as $loadedClass) {
183 183
                         $loadedClassName = $loadedClass->getClassName();
184 184
 
185
-                        $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, 0);
185
+                        $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, 0);
186 186
                     }
187 187
                 }
188 188
             } else {
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         } catch (CommonMappingException $loadingException) {
192 192
             $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName, $metadataBuildingContext);
193 193
 
194
-            if (! $fallbackMetadataResponse) {
194
+            if ( ! $fallbackMetadataResponse) {
195 195
                 throw $loadingException;
196 196
             }
197 197
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
      */
228 228
     protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array
229 229
     {
230
-        if (! $this->initialized) {
230
+        if ( ! $this->initialized) {
231 231
             $this->initialize();
232 232
         }
233 233
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      */
264 264
     public function isTransient($className) : bool
265 265
     {
266
-        if (! $this->initialized) {
266
+        if ( ! $this->initialized) {
267 267
             $this->initialize();
268 268
         }
269 269
 
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
         $parentClasses = [];
286 286
 
287 287
         foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) {
288
-            if (! $this->getDriver()->isTransient($parentClass)) {
288
+            if ( ! $this->getDriver()->isTransient($parentClass)) {
289 289
                 $parentClasses[] = $parentClass;
290 290
             }
291 291
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php 1 patch
Spacing   +18 added lines, -18 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\Internal\Hydration;
6 6
 
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
                 // It's a joined result
93 93
 
94 94
                 $parent = $this->rsm->parentAliasMap[$dqlAlias];
95
-                $path   = $parent . '.' . $dqlAlias;
95
+                $path   = $parent.'.'.$dqlAlias;
96 96
 
97 97
                 // missing parent data, skipping as RIGHT JOIN hydration is not supported.
98
-                if (! isset($nonemptyComponents[$parent])) {
98
+                if ( ! isset($nonemptyComponents[$parent])) {
99 99
                     continue;
100 100
                 }
101 101
 
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
                 if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) {
105 105
                     $first = reset($this->resultPointers);
106 106
                     // TODO: Exception if $key === null ?
107
-                    $baseElement =& $this->resultPointers[$parent][key($first)];
107
+                    $baseElement = & $this->resultPointers[$parent][key($first)];
108 108
                 } elseif (isset($this->resultPointers[$parent])) {
109
-                    $baseElement =& $this->resultPointers[$parent];
109
+                    $baseElement = & $this->resultPointers[$parent];
110 110
                 } else {
111 111
                     unset($this->resultPointers[$dqlAlias]); // Ticket #1228
112 112
 
@@ -118,10 +118,10 @@  discard block
 block discarded – undo
118 118
                 $relation      = $parentClass->getProperty($relationAlias);
119 119
 
120 120
                 // Check the type of the relation (many or single-valued)
121
-                if (! $relation instanceof ToOneAssociationMetadata) {
121
+                if ( ! $relation instanceof ToOneAssociationMetadata) {
122 122
                     $oneToOne = false;
123 123
 
124
-                    if (! isset($baseElement[$relationAlias])) {
124
+                    if ( ! isset($baseElement[$relationAlias])) {
125 125
                         $baseElement[$relationAlias] = [];
126 126
                     }
127 127
 
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                         $index        = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false;
131 131
                         $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false;
132 132
 
133
-                        if (! $indexExists || ! $indexIsValid) {
133
+                        if ( ! $indexExists || ! $indexIsValid) {
134 134
                             $element = $data;
135 135
 
136 136
                             if (isset($this->rsm->indexByMap[$dqlAlias])) {
@@ -151,12 +151,12 @@  discard block
 block discarded – undo
151 151
                         ( ! isset($baseElement[$relationAlias]))
152 152
                     ) {
153 153
                         $baseElement[$relationAlias] = null;
154
-                    } elseif (! isset($baseElement[$relationAlias])) {
154
+                    } elseif ( ! isset($baseElement[$relationAlias])) {
155 155
                         $baseElement[$relationAlias] = $data;
156 156
                     }
157 157
                 }
158 158
 
159
-                $coll =& $baseElement[$relationAlias];
159
+                $coll = & $baseElement[$relationAlias];
160 160
 
161 161
                 if (is_array($coll)) {
162 162
                     $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 $entityKey                    = $this->rsm->entityMappings[$dqlAlias] ?: 0;
169 169
 
170 170
                 // if this row has a NULL value for the root result id then make it a null result.
171
-                if (! isset($nonemptyComponents[$dqlAlias])) {
171
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
172 172
                     $result[] = $this->rsm->isMixed
173 173
                         ? [$entityKey => null]
174 174
                         : null;
@@ -205,13 +205,13 @@  discard block
 block discarded – undo
205 205
             }
206 206
         }
207 207
 
208
-        if (! isset($resultKey)) {
208
+        if ( ! isset($resultKey)) {
209 209
             $this->resultCounter++;
210 210
         }
211 211
 
212 212
         // Append scalar values to mixed result sets
213 213
         if (isset($rowData['scalars'])) {
214
-            if (! isset($resultKey)) {
214
+            if ( ! isset($resultKey)) {
215 215
                 // this only ever happens when no object is fetched (scalar result only)
216 216
                 $resultKey = isset($this->rsm->indexByMap['scalars'])
217 217
                     ? $row[$this->rsm->indexByMap['scalars']]
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
         // Append new object to mixed result sets
227 227
         if (isset($rowData['newObjects'])) {
228
-            if (! isset($resultKey)) {
228
+            if ( ! isset($resultKey)) {
229 229
                 $resultKey = $this->resultCounter - 1;
230 230
             }
231 231
 
@@ -261,23 +261,23 @@  discard block
 block discarded – undo
261 261
     private function updateResultPointer(array &$coll, $index, $dqlAlias, $oneToOne)
262 262
     {
263 263
         if ($oneToOne) {
264
-            $this->resultPointers[$dqlAlias] =& $coll;
264
+            $this->resultPointers[$dqlAlias] = & $coll;
265 265
 
266 266
             return;
267 267
         }
268 268
 
269 269
         if ($index !== false) {
270
-            $this->resultPointers[$dqlAlias] =& $coll[$index];
270
+            $this->resultPointers[$dqlAlias] = & $coll[$index];
271 271
 
272 272
             return;
273 273
         }
274 274
 
275
-        if (! $coll) {
275
+        if ( ! $coll) {
276 276
             return;
277 277
         }
278 278
 
279 279
         end($coll);
280
-        $this->resultPointers[$dqlAlias] =& $coll[key($coll)];
280
+        $this->resultPointers[$dqlAlias] = & $coll[key($coll)];
281 281
 
282 282
         return;
283 283
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php 1 patch
Spacing   +26 added lines, -26 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\Persisters\Entity;
6 6
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             }
106 106
 
107 107
             foreach ($data as $columnName => $value) {
108
-                if (! is_array($id) || ! isset($id[$columnName])) {
108
+                if ( ! is_array($id) || ! isset($id[$columnName])) {
109 109
                     $type = $this->columns[$columnName]->getType();
110 110
 
111 111
                     $stmt->bindValue($paramIndex++, $value, $type);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $updateData = $this->prepareUpdateData($entity);
131 131
 
132
-        if (! $updateData) {
132
+        if ( ! $updateData) {
133 133
             return;
134 134
         }
135 135
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             $versionedClass = $this->class->versionProperty->getDeclaringClass();
149 149
             $versionedTable = $versionedClass->getTableName();
150 150
 
151
-            if (! isset($updateData[$versionedTable])) {
151
+            if ( ! isset($updateData[$versionedTable])) {
152 152
                 $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform);
153 153
 
154 154
                 $this->updateTable($entity, $tableName, [], true);
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 
231 231
         if ($filterSql) {
232 232
             $conditionSql .= $conditionSql
233
-                ? ' AND ' . $filterSql
233
+                ? ' AND '.$filterSql
234 234
                 : $filterSql;
235 235
         }
236 236
 
@@ -238,26 +238,26 @@  discard block
 block discarded – undo
238 238
 
239 239
         switch ($lockMode) {
240 240
             case LockMode::PESSIMISTIC_READ:
241
-                $lockSql = ' ' . $this->platform->getReadLockSQL();
241
+                $lockSql = ' '.$this->platform->getReadLockSQL();
242 242
                 break;
243 243
 
244 244
             case LockMode::PESSIMISTIC_WRITE:
245
-                $lockSql = ' ' . $this->platform->getWriteLockSQL();
245
+                $lockSql = ' '.$this->platform->getWriteLockSQL();
246 246
                 break;
247 247
         }
248 248
 
249 249
         $tableName  = $this->class->table->getQuotedQualifiedName($this->platform);
250
-        $from       = ' FROM ' . $tableName . ' ' . $baseTableAlias;
251
-        $where      = $conditionSql !== '' ? ' WHERE ' . $conditionSql : '';
250
+        $from       = ' FROM '.$tableName.' '.$baseTableAlias;
251
+        $where      = $conditionSql !== '' ? ' WHERE '.$conditionSql : '';
252 252
         $lock       = $this->platform->appendLockHint($from, $lockMode);
253 253
         $columnList = $this->getSelectColumnsSQL();
254
-        $query      = 'SELECT ' . $columnList
254
+        $query      = 'SELECT '.$columnList
255 255
                     . $lock
256 256
                     . $joinSql
257 257
                     . $where
258 258
                     . $orderBySql;
259 259
 
260
-        return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql;
260
+        return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql;
261 261
     }
262 262
 
263 263
     /**
@@ -279,14 +279,14 @@  discard block
 block discarded – undo
279 279
 
280 280
         if ($filterSql !== '') {
281 281
             $conditionSql = $conditionSql
282
-                ? $conditionSql . ' AND ' . $filterSql
282
+                ? $conditionSql.' AND '.$filterSql
283 283
                 : $filterSql;
284 284
         }
285 285
 
286 286
         $sql = 'SELECT COUNT(*) '
287
-            . 'FROM ' . $tableName . ' ' . $baseTableAlias
287
+            . 'FROM '.$tableName.' '.$baseTableAlias
288 288
             . $joinSql
289
-            . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql);
289
+            . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql);
290 290
 
291 291
         return $sql;
292 292
     }
@@ -308,18 +308,18 @@  discard block
 block discarded – undo
308 308
             /** @var ClassMetadata $parentClass */
309 309
             $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
310 310
             $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
311
-            $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
311
+            $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
312 312
 
313 313
             foreach ($identifierColumns as $idColumn) {
314 314
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
315 315
 
316
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
316
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
317 317
             }
318 318
 
319 319
             $joinSql .= implode(' AND ', $conditions);
320 320
         }
321 321
 
322
-        return parent::getLockTablesSql($lockMode) . $joinSql;
322
+        return parent::getLockTablesSql($lockMode).$joinSql;
323 323
     }
324 324
 
325 325
     /**
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                 continue;
347 347
             }
348 348
 
349
-            if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
349
+            if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) {
350 350
                 continue;
351 351
             }
352 352
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                 /** @var JoinColumnMetadata $joinColumn */
357 357
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
358 358
 
359
-                if (! $joinColumn->getType()) {
359
+                if ( ! $joinColumn->getType()) {
360 360
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
361 361
                 }
362 362
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
         $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName);
376 376
         $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType);
377 377
 
378
-        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform);
378
+        $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform);
379 379
 
380 380
         // sub tables
381 381
         foreach ($this->class->getSubClasses() as $subClassName) {
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                             /** @var JoinColumnMetadata $joinColumn */
400 400
                             $referencedColumnName = $joinColumn->getReferencedColumnName();
401 401
 
402
-                            if (! $joinColumn->getType()) {
402
+                            if ( ! $joinColumn->getType()) {
403 403
                                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
404 404
                             }
405 405
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
                         $columnName           = $joinColumn->getColumnName();
450 450
                         $referencedColumnName = $joinColumn->getReferencedColumnName();
451 451
 
452
-                        if (! $joinColumn->getType()) {
452
+                        if ( ! $joinColumn->getType()) {
453 453
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
454 454
                         }
455 455
 
@@ -506,12 +506,12 @@  discard block
 block discarded – undo
506 506
             /** @var ClassMetadata $parentClass */
507 507
             $tableName  = $parentClass->table->getQuotedQualifiedName($this->platform);
508 508
             $tableAlias = $this->getSQLTableAlias($parentClass->getTableName());
509
-            $joinSql   .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
509
+            $joinSql   .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON ';
510 510
 
511 511
             foreach ($identifierColumns as $idColumn) {
512 512
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
513 513
 
514
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
514
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
515 515
             }
516 516
 
517 517
             $joinSql .= implode(' AND ', $conditions);
@@ -523,12 +523,12 @@  discard block
 block discarded – undo
523 523
             $subClass   = $this->em->getClassMetadata($subClassName);
524 524
             $tableName  = $subClass->table->getQuotedQualifiedName($this->platform);
525 525
             $tableAlias = $this->getSQLTableAlias($subClass->getTableName());
526
-            $joinSql   .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
526
+            $joinSql   .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON ';
527 527
 
528 528
             foreach ($identifierColumns as $idColumn) {
529 529
                 $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName());
530 530
 
531
-                $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
531
+                $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
532 532
             }
533 533
 
534 534
             $joinSql .= implode(' AND ', $conditions);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 1 patch
Spacing   +21 added lines, -21 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\Mapping;
6 6
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         string $className,
81 81
         ClassMetadataBuildingContext $metadataBuildingContext
82 82
     ) : ?ClassMetadata {
83
-        if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) {
83
+        if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) {
84 84
             return null;
85 85
         }
86 86
 
@@ -143,20 +143,20 @@  discard block
 block discarded – undo
143 143
                 $classMetadata->setCache(clone $parentCache);
144 144
             }
145 145
 
146
-            if (! empty($parent->namedNativeQueries)) {
146
+            if ( ! empty($parent->namedNativeQueries)) {
147 147
                 $this->addInheritedNamedNativeQueries($classMetadata, $parent);
148 148
             }
149 149
 
150
-            if (! empty($parent->sqlResultSetMappings)) {
150
+            if ( ! empty($parent->sqlResultSetMappings)) {
151 151
                 $this->addInheritedSqlResultSetMappings($classMetadata, $parent);
152 152
             }
153 153
 
154
-            if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) {
154
+            if ( ! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) {
155 155
                 $classMetadata->entityListeners = $parent->entityListeners;
156 156
             }
157 157
         }
158 158
 
159
-        if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) {
159
+        if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) {
160 160
             $this->addDefaultDiscriminatorMap($classMetadata);
161 161
         }
162 162
 
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
     protected function completeRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void
178 178
     {
179
-        if (! $parent || ! $parent->isMappedSuperclass) {
179
+        if ( ! $parent || ! $parent->isMappedSuperclass) {
180 180
             return;
181 181
         }
182 182
 
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                 continue;
195 195
             }
196 196
 
197
-            if (! ($property instanceof ToOneAssociationMetadata)) {
197
+            if ( ! ($property instanceof ToOneAssociationMetadata)) {
198 198
                 continue;
199 199
             }
200 200
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
      */
214 214
     protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void
215 215
     {
216
-        if (! $class->getReflectionClass()) {
216
+        if ( ! $class->getReflectionClass()) {
217 217
             // only validate if there is a reflection class instance
218 218
             return;
219 219
         }
@@ -223,13 +223,13 @@  discard block
 block discarded – undo
223 223
         $class->validateLifecycleCallbacks($this->getReflectionService());
224 224
 
225 225
         // verify inheritance
226
-        if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) {
227
-            if (! $parent) {
228
-                if (! $class->discriminatorMap) {
226
+        if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) {
227
+            if ( ! $parent) {
228
+                if ( ! $class->discriminatorMap) {
229 229
                     throw MappingException::missingDiscriminatorMap($class->getClassName());
230 230
                 }
231 231
 
232
-                if (! $class->discriminatorColumn) {
232
+                if ( ! $class->discriminatorColumn) {
233 233
                     throw MappingException::missingDiscriminatorColumn($class->getClassName());
234 234
                 }
235 235
             }
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
     private function completeIdentifierGeneratorMappings(ClassMetadata $class) : void
440 440
     {
441 441
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
442
-            if (! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) {
442
+            if ( ! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) {
443 443
                 continue;
444 444
             }
445 445
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 
450 450
     private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field)
451 451
     {
452
-        if (! $field->hasValueGenerator()) {
452
+        if ( ! $field->hasValueGenerator()) {
453 453
             return;
454 454
         }
455 455
 
@@ -501,10 +501,10 @@  discard block
 block discarded – undo
501 501
 
502 502
             case GeneratorType::CUSTOM:
503 503
                 $definition = $generator->getDefinition();
504
-                if (! isset($definition['class'])) {
504
+                if ( ! isset($definition['class'])) {
505 505
                     throw new ORMException(sprintf('Cannot instantiate custom generator, no class has been defined'));
506 506
                 }
507
-                if (! class_exists($definition['class'])) {
507
+                if ( ! class_exists($definition['class'])) {
508 508
                     throw new ORMException(sprintf('Cannot instantiate custom generator : %s', var_export($definition, true))); //$definition['class']));
509 509
                 }
510 510
 
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
                 break;
517 517
 
518 518
             default:
519
-                throw new ORMException('Unknown generator type: ' . $generator->getType());
519
+                throw new ORMException('Unknown generator type: '.$generator->getType());
520 520
         }
521 521
     }
522 522
 
@@ -525,7 +525,7 @@  discard block
 block discarded – undo
525 525
      */
526 526
     protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) : string
527 527
     {
528
-        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
528
+        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
529 529
     }
530 530
 
531 531
     /**
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 
547 547
     private function getTargetPlatform() : Platforms\AbstractPlatform
548 548
     {
549
-        if (! $this->targetPlatform) {
549
+        if ( ! $this->targetPlatform) {
550 550
             $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform();
551 551
         }
552 552
 
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
         $generatedProperties = [];
560 560
 
561 561
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
562
-            if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) {
562
+            if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) {
563 563
                 continue;
564 564
             }
565 565
 
Please login to merge, or discard this patch.