Failed Conditions
CANCELLED  
Pull Request — master (#7095)
by Benjamin
10:13
created
tests/Doctrine/Tests/ORM/Mapping/AbstractMappingDriverTest.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\Tests\ORM\Mapping;
6 6
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 1 patch
Spacing   +17 added lines, -17 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
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
         string $className,
95 95
         ClassMetadataBuildingContext $metadataBuildingContext
96 96
     ) : ?ClassMetadata {
97
-        if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) {
97
+        if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) {
98 98
             return null;
99 99
         }
100 100
 
@@ -155,12 +155,12 @@  discard block
 block discarded – undo
155 155
                 $classMetadata->setCache(clone $parent->getCache());
156 156
             }
157 157
 
158
-            if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) {
158
+            if ( ! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) {
159 159
                 $classMetadata->entityListeners = $parent->entityListeners;
160 160
             }
161 161
         }
162 162
 
163
-        if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) {
163
+        if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) {
164 164
             $this->addDefaultDiscriminatorMap($classMetadata);
165 165
         }
166 166
 
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     protected function completeRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void
182 182
     {
183
-        if (! $parent || ! $parent->isMappedSuperclass) {
183
+        if ( ! $parent || ! $parent->isMappedSuperclass) {
184 184
             return;
185 185
         }
186 186
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
                 continue;
199 199
             }
200 200
 
201
-            if (! ($property instanceof ToOneAssociationMetadata)) {
201
+            if ( ! ($property instanceof ToOneAssociationMetadata)) {
202 202
                 continue;
203 203
             }
204 204
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
      */
218 218
     protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void
219 219
     {
220
-        if (! $class->getReflectionClass()) {
220
+        if ( ! $class->getReflectionClass()) {
221 221
             // only validate if there is a reflection class instance
222 222
             return;
223 223
         }
@@ -227,13 +227,13 @@  discard block
 block discarded – undo
227 227
         $class->validateLifecycleCallbacks($this->getReflectionService());
228 228
 
229 229
         // verify inheritance
230
-        if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) {
231
-            if (! $parent) {
232
-                if (! $class->discriminatorMap) {
230
+        if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) {
231
+            if ( ! $parent) {
232
+                if ( ! $class->discriminatorMap) {
233 233
                     throw MappingException::missingDiscriminatorMap($class->getClassName());
234 234
                 }
235 235
 
236
-                if (! $class->discriminatorColumn) {
236
+                if ( ! $class->discriminatorColumn) {
237 237
                     throw MappingException::missingDiscriminatorColumn($class->getClassName());
238 238
                 }
239 239
             }
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     private function completeIdentifierGeneratorMappings(ClassMetadata $class) : void
355 355
     {
356 356
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
357
-            if (! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) {
357
+            if ( ! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) {
358 358
                 continue;
359 359
             }
360 360
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 
365 365
     private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field)
366 366
     {
367
-        if (! $field->hasValueGenerator()) {
367
+        if ( ! $field->hasValueGenerator()) {
368 368
             return;
369 369
         }
370 370
 
@@ -416,10 +416,10 @@  discard block
 block discarded – undo
416 416
 
417 417
             case GeneratorType::CUSTOM:
418 418
                 $definition = $generator->getDefinition();
419
-                if (! isset($definition['class'])) {
419
+                if ( ! isset($definition['class'])) {
420 420
                     throw new ORMException(sprintf('Cannot instantiate custom generator, no class has been defined'));
421 421
                 }
422
-                if (! class_exists($definition['class'])) {
422
+                if ( ! class_exists($definition['class'])) {
423 423
                     throw new ORMException(sprintf('Cannot instantiate custom generator : %s', var_export($definition, true))); //$definition['class']));
424 424
                 }
425 425
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
                 break;
432 432
 
433 433
             default:
434
-                throw new ORMException('Unknown generator type: ' . $generator->getType());
434
+                throw new ORMException('Unknown generator type: '.$generator->getType());
435 435
         }
436 436
     }
437 437
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 
454 454
     private function getTargetPlatform() : Platforms\AbstractPlatform
455 455
     {
456
-        if (! $this->targetPlatform) {
456
+        if ( ! $this->targetPlatform) {
457 457
             $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform();
458 458
         }
459 459
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadata.php 1 patch
Spacing   +46 added lines, -46 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
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
      */
264 264
     public function __toString()
265 265
     {
266
-        return __CLASS__ . '@' . spl_object_id($this);
266
+        return __CLASS__.'@'.spl_object_id($this);
267 267
     }
268 268
 
269 269
     /**
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         // Restore ReflectionClass and properties
351 351
         $this->reflectionClass = $reflectionService->getClass($this->className);
352 352
 
353
-        if (! $this->reflectionClass) {
353
+        if ( ! $this->reflectionClass) {
354 354
             return;
355 355
         }
356 356
 
@@ -374,11 +374,11 @@  discard block
 block discarded – undo
374 374
         }
375 375
 
376 376
         // Verify & complete identifier mapping
377
-        if (! $this->identifier) {
377
+        if ( ! $this->identifier) {
378 378
             throw MappingException::identifierRequired($this->className);
379 379
         }
380 380
 
381
-        $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool {
381
+        $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool {
382 382
             return $property instanceof FieldMetadata
383 383
                 && $property->isPrimaryKey()
384 384
                 && $property->hasValueGenerator();
@@ -397,14 +397,14 @@  discard block
 block discarded – undo
397 397
     public function validateAssociations() : void
398 398
     {
399 399
         array_map(
400
-            function (Property $property) {
401
-                if (! ($property instanceof AssociationMetadata)) {
400
+            function(Property $property) {
401
+                if ( ! ($property instanceof AssociationMetadata)) {
402 402
                     return;
403 403
                 }
404 404
 
405 405
                 $targetEntity = $property->getTargetEntity();
406 406
 
407
-                if (! class_exists($targetEntity)) {
407
+                if ( ! class_exists($targetEntity)) {
408 408
                     throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName());
409 409
                 }
410 410
             },
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         foreach ($this->lifecycleCallbacks as $callbacks) {
423 423
             /** @var array $callbacks */
424 424
             foreach ($callbacks as $callbackFuncName) {
425
-                if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) {
425
+                if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) {
426 426
                     throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName);
427 427
                 }
428 428
             }
@@ -446,11 +446,11 @@  discard block
 block discarded – undo
446 446
      */
447 447
     public function isIdentifier(string $fieldName) : bool
448 448
     {
449
-        if (! $this->identifier) {
449
+        if ( ! $this->identifier) {
450 450
             return false;
451 451
         }
452 452
 
453
-        if (! $this->isIdentifierComposite()) {
453
+        if ( ! $this->isIdentifierComposite()) {
454 454
             return $fieldName === $this->identifier[0];
455 455
         }
456 456
 
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
      */
476 476
     public function getSqlResultSetMapping($name)
477 477
     {
478
-        if (! isset($this->sqlResultSetMappings[$name])) {
478
+        if ( ! isset($this->sqlResultSetMappings[$name])) {
479 479
             throw MappingException::resultMappingNotFound($this->className, $name);
480 480
         }
481 481
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
             $property->setColumnName($columnName);
509 509
         }
510 510
 
511
-        if (! $this->isMappedSuperclass) {
511
+        if ( ! $this->isMappedSuperclass) {
512 512
             $property->setTableName($this->getTableName());
513 513
         }
514 514
 
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
                 throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($this->className, $property);
529 529
             }
530 530
 
531
-            if (! in_array($fieldName, $this->identifier, true)) {
531
+            if ( ! in_array($fieldName, $this->identifier, true)) {
532 532
                 $this->identifier[] = $fieldName;
533 533
             }
534 534
         }
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
         $fieldName    = $property->getName();
579 579
         $targetEntity = $property->getTargetEntity();
580 580
 
581
-        if (! $targetEntity) {
581
+        if ( ! $targetEntity) {
582 582
             throw MappingException::missingTargetEntity($fieldName);
583 583
         }
584 584
 
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
                 throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName);
592 592
             }
593 593
 
594
-            if (! in_array($property->getName(), $this->identifier, true)) {
594
+            if ( ! in_array($property->getName(), $this->identifier, true)) {
595 595
                 if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) {
596 596
                     throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId(
597 597
                         $property->getTargetEntity(),
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
                 /** @var JoinColumnMetadata $joinColumn */
654 654
                 if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) {
655 655
                     if (count($property->getJoinColumns()) === 1) {
656
-                        if (! $property->isPrimaryKey()) {
656
+                        if ( ! $property->isPrimaryKey()) {
657 657
                             $joinColumn->setUnique(true);
658 658
                         }
659 659
                     } else {
@@ -661,13 +661,13 @@  discard block
 block discarded – undo
661 661
                     }
662 662
                 }
663 663
 
664
-                $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null);
664
+                $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null);
665 665
 
666
-                if (! $joinColumn->getColumnName()) {
666
+                if ( ! $joinColumn->getColumnName()) {
667 667
                     $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className));
668 668
                 }
669 669
 
670
-                if (! $joinColumn->getReferencedColumnName()) {
670
+                if ( ! $joinColumn->getReferencedColumnName()) {
671 671
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
672 672
                 }
673 673
 
@@ -675,7 +675,7 @@  discard block
 block discarded – undo
675 675
             }
676 676
 
677 677
             if ($uniqueConstraintColumns) {
678
-                if (! $this->table) {
678
+                if ( ! $this->table) {
679 679
                     throw new \RuntimeException(
680 680
                         'ClassMetadata::setTable() has to be called before defining a one to one relationship.'
681 681
                     );
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
         if ($property->isOrphanRemoval()) {
696 696
             $cascades = $property->getCascade();
697 697
 
698
-            if (! in_array('remove', $cascades, true)) {
698
+            if ( ! in_array('remove', $cascades, true)) {
699 699
                 $cascades[] = 'remove';
700 700
 
701 701
                 $property->setCascade($cascades);
@@ -758,14 +758,14 @@  discard block
 block discarded – undo
758 758
     protected function validateAndCompleteOneToManyMapping(OneToManyAssociationMetadata $property)
759 759
     {
760 760
         // OneToMany MUST have mappedBy
761
-        if (! $property->getMappedBy()) {
761
+        if ( ! $property->getMappedBy()) {
762 762
             throw MappingException::oneToManyRequiresMappedBy($property->getName());
763 763
         }
764 764
 
765 765
         if ($property->isOrphanRemoval()) {
766 766
             $cascades = $property->getCascade();
767 767
 
768
-            if (! in_array('remove', $cascades, true)) {
768
+            if ( ! in_array('remove', $cascades, true)) {
769 769
                 $cascades[] = 'remove';
770 770
 
771 771
                 $property->setCascade($cascades);
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
 
789 789
             $property->setJoinTable($joinTable);
790 790
 
791
-            if (! $joinTable->getName()) {
791
+            if ( ! $joinTable->getName()) {
792 792
                 $joinTableName = $this->namingStrategy->joinTableName(
793 793
                     $property->getSourceEntity(),
794 794
                     $property->getTargetEntity(),
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 
801 801
             $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns();
802 802
 
803
-            if (! $joinTable->getJoinColumns()) {
803
+            if ( ! $joinTable->getJoinColumns()) {
804 804
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
805 805
                 $sourceReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName;
806 806
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName);
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
                 $joinTable->addJoinColumn($joinColumn);
814 814
             }
815 815
 
816
-            if (! $joinTable->getInverseJoinColumns()) {
816
+            if ( ! $joinTable->getInverseJoinColumns()) {
817 817
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
818 818
                 $targetReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName;
819 819
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName);
@@ -828,13 +828,13 @@  discard block
 block discarded – undo
828 828
 
829 829
             foreach ($joinTable->getJoinColumns() as $joinColumn) {
830 830
                 /** @var JoinColumnMetadata $joinColumn */
831
-                if (! $joinColumn->getReferencedColumnName()) {
831
+                if ( ! $joinColumn->getReferencedColumnName()) {
832 832
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
833 833
                 }
834 834
 
835 835
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
836 836
 
837
-                if (! $joinColumn->getColumnName()) {
837
+                if ( ! $joinColumn->getColumnName()) {
838 838
                     $columnName = $this->namingStrategy->joinKeyColumnName(
839 839
                         $property->getSourceEntity(),
840 840
                         $referencedColumnName
@@ -846,13 +846,13 @@  discard block
 block discarded – undo
846 846
 
847 847
             foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) {
848 848
                 /** @var JoinColumnMetadata $inverseJoinColumn */
849
-                if (! $inverseJoinColumn->getReferencedColumnName()) {
849
+                if ( ! $inverseJoinColumn->getReferencedColumnName()) {
850 850
                     $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
851 851
                 }
852 852
 
853 853
                 $referencedColumnName = $inverseJoinColumn->getReferencedColumnName();
854 854
 
855
-                if (! $inverseJoinColumn->getColumnName()) {
855
+                if ( ! $inverseJoinColumn->getColumnName()) {
856 856
                     $columnName = $this->namingStrategy->joinKeyColumnName(
857 857
                         $property->getTargetEntity(),
858 858
                         $referencedColumnName
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
             throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className);
887 887
         }
888 888
 
889
-        if (! isset($this->identifier[0])) {
889
+        if ( ! isset($this->identifier[0])) {
890 890
             throw MappingException::noIdDefined($this->className);
891 891
         }
892 892
 
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
             // Association defined as Id field
946 946
             $targetClass = $em->getClassMetadata($property->getTargetEntity());
947 947
 
948
-            if (! $property->isOwningSide()) {
948
+            if ( ! $property->isOwningSide()) {
949 949
                 $property    = $targetClass->getProperty($property->getMappedBy());
950 950
                 $targetClass = $em->getClassMetadata($property->getTargetEntity());
951 951
             }
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
                 $columnName           = $joinColumn->getColumnName();
961 961
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
962 962
 
963
-                if (! $joinColumn->getType()) {
963
+                if ( ! $joinColumn->getType()) {
964 964
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em));
965 965
                 }
966 966
 
@@ -994,11 +994,11 @@  discard block
 block discarded – undo
994 994
     {
995 995
         $schema = $this->getSchemaName() === null
996 996
             ? ''
997
-            : $this->getSchemaName() . '_'
997
+            : $this->getSchemaName().'_'
998 998
         ;
999 999
 
1000 1000
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
1001
-        return $schema . $this->getTableName() . '_id_tmp';
1001
+        return $schema.$this->getTableName().'_id_tmp';
1002 1002
     }
1003 1003
 
1004 1004
     /**
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
      */
1033 1033
     public function setInheritanceType($type) : void
1034 1034
     {
1035
-        if (! $this->isInheritanceType($type)) {
1035
+        if ( ! $this->isInheritanceType($type)) {
1036 1036
             throw MappingException::invalidInheritanceType($this->className, $type);
1037 1037
         }
1038 1038
 
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
     {
1051 1051
         $fieldName = $property->getName();
1052 1052
 
1053
-        if (! isset($this->declaredProperties[$fieldName])) {
1053
+        if ( ! isset($this->declaredProperties[$fieldName])) {
1054 1054
             throw MappingException::invalidOverrideFieldName($this->className, $fieldName);
1055 1055
         }
1056 1056
 
@@ -1247,7 +1247,7 @@  discard block
 block discarded – undo
1247 1247
         $declaringClass    = $property->getDeclaringClass();
1248 1248
 
1249 1249
         if ($inheritedProperty instanceof FieldMetadata) {
1250
-            if (! $declaringClass->isMappedSuperclass) {
1250
+            if ( ! $declaringClass->isMappedSuperclass) {
1251 1251
                 $inheritedProperty->setTableName($property->getTableName());
1252 1252
             }
1253 1253
 
@@ -1287,7 +1287,7 @@  discard block
 block discarded – undo
1287 1287
      */
1288 1288
     public function addSqlResultSetMapping(array $resultMapping)
1289 1289
     {
1290
-        if (! isset($resultMapping['name'])) {
1290
+        if ( ! isset($resultMapping['name'])) {
1291 1291
             throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className);
1292 1292
         }
1293 1293
 
@@ -1297,7 +1297,7 @@  discard block
 block discarded – undo
1297 1297
 
1298 1298
         if (isset($resultMapping['entities'])) {
1299 1299
             foreach ($resultMapping['entities'] as $key => $entityResult) {
1300
-                if (! isset($entityResult['entityClass'])) {
1300
+                if ( ! isset($entityResult['entityClass'])) {
1301 1301
                     throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']);
1302 1302
                 }
1303 1303
 
@@ -1306,11 +1306,11 @@  discard block
 block discarded – undo
1306 1306
 
1307 1307
                 if (isset($entityResult['fields'])) {
1308 1308
                     foreach ($entityResult['fields'] as $k => $field) {
1309
-                        if (! isset($field['name'])) {
1309
+                        if ( ! isset($field['name'])) {
1310 1310
                             throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']);
1311 1311
                         }
1312 1312
 
1313
-                        if (! isset($field['column'])) {
1313
+                        if ( ! isset($field['column'])) {
1314 1314
                             $fieldName = $field['name'];
1315 1315
 
1316 1316
                             if (strpos($fieldName, '.')) {
@@ -1408,11 +1408,11 @@  discard block
 block discarded – undo
1408 1408
             'method' => $method,
1409 1409
         ];
1410 1410
 
1411
-        if (! class_exists($class)) {
1411
+        if ( ! class_exists($class)) {
1412 1412
             throw MappingException::entityListenerClassNotFound($class, $this->className);
1413 1413
         }
1414 1414
 
1415
-        if (! method_exists($class, $method)) {
1415
+        if ( ! method_exists($class, $method)) {
1416 1416
             throw MappingException::entityListenerMethodNotFound($class, $method, $this->className);
1417 1417
         }
1418 1418
 
@@ -1479,7 +1479,7 @@  discard block
 block discarded – undo
1479 1479
             return;
1480 1480
         }
1481 1481
 
1482
-        if (! (class_exists($className) || interface_exists($className))) {
1482
+        if ( ! (class_exists($className) || interface_exists($className))) {
1483 1483
             throw MappingException::invalidClassInDiscriminatorMap($className, $this->className);
1484 1484
         }
1485 1485
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/EntityClassMetadata.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Mapping;
7 7
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Configuration.php 1 patch
Spacing   +5 added lines, -5 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;
6 6
 
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      */
191 191
     public function newDefaultAnnotationDriver(array $paths = []) : AnnotationDriver
192 192
     {
193
-        AnnotationRegistry::registerFile(__DIR__ . '/Annotation/DoctrineAnnotations.php');
193
+        AnnotationRegistry::registerFile(__DIR__.'/Annotation/DoctrineAnnotations.php');
194 194
 
195 195
         $reader = new CachedReader(new AnnotationReader(), new ArrayCache());
196 196
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
     {
265 265
         $queryCacheImpl = $this->getQueryCacheImpl();
266 266
 
267
-        if (! $queryCacheImpl) {
267
+        if ( ! $queryCacheImpl) {
268 268
             throw ORMException::queryCacheNotConfigured();
269 269
         }
270 270
 
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
         $metadataCacheImpl = $this->getMetadataCacheImpl();
276 276
 
277
-        if (! $metadataCacheImpl) {
277
+        if ( ! $metadataCacheImpl) {
278 278
             throw ORMException::metadataCacheNotConfigured();
279 279
         }
280 280
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
     {
483 483
         $reflectionClass = new \ReflectionClass($repositoryClassName);
484 484
 
485
-        if (! $reflectionClass->implementsInterface(ObjectRepository::class)) {
485
+        if ( ! $reflectionClass->implementsInterface(ObjectRepository::class)) {
486 486
             throw ORMException::invalidEntityRepository($repositoryClassName);
487 487
         }
488 488
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php 1 patch
Spacing   +6 added lines, -6 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\Query;
6 6
 
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $classMetadata = $this->em->getClassMetadata($class);
133 133
         $platform      = $this->em->getConnection()->getDatabasePlatform();
134 134
 
135
-        if (! $this->isInheritanceSupported($classMetadata)) {
135
+        if ( ! $this->isInheritanceSupported($classMetadata)) {
136 136
             throw new \InvalidArgumentException(
137 137
                 'ResultSetMapping builder does not currently support your inheritance scheme.'
138 138
             );
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
                             );
173 173
                         }
174 174
 
175
-                        if (! $joinColumn->getType()) {
175
+                        if ( ! $joinColumn->getType()) {
176 176
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
177 177
                         }
178 178
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     {
212 212
         switch ($mode) {
213 213
             case self::COLUMN_RENAMING_INCREMENT:
214
-                return $columnName . $this->sqlCounter++;
214
+                return $columnName.$this->sqlCounter++;
215 215
 
216 216
             case self::COLUMN_RENAMING_CUSTOM:
217 217
                 return $customRenameColumns[$columnName] ?? $columnName;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                 $sql .= ', ';
243 243
             }
244 244
 
245
-            $sql .= $tableAlias . '.';
245
+            $sql .= $tableAlias.'.';
246 246
 
247 247
             if (isset($this->fieldMappings[$columnName])) {
248 248
                 $class = $this->em->getClassMetadata($this->declaringClasses[$columnName]);
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                 $sql .= $this->discriminatorColumns[$dqlAlias];
255 255
             }
256 256
 
257
-            $sql .= ' AS ' . $columnName;
257
+            $sql .= ' AS '.$columnName;
258 258
         }
259 259
 
260 260
         return $sql;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/ORMException.php 1 patch
Spacing   +13 added lines, -13 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;
6 6
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      */
21 21
     public static function missingMappingDriverImpl()
22 22
     {
23
-        return new self("It's a requirement to specify a Metadata Driver and pass it " .
23
+        return new self("It's a requirement to specify a Metadata Driver and pass it ".
24 24
             'to Doctrine\\ORM\\Configuration::setMetadataDriverImpl().');
25 25
     }
26 26
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public static function unrecognizedField($field)
33 33
     {
34
-        return new self('Unrecognized field: ' . $field);
34
+        return new self('Unrecognized field: '.$field);
35 35
     }
36 36
 
37 37
     /**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
      */
56 56
     public static function invalidOrientation($className, $field)
57 57
     {
58
-        return new self('Invalid order by orientation specified for ' . $className . '#' . $field);
58
+        return new self('Invalid order by orientation specified for '.$className.'#'.$field);
59 59
     }
60 60
 
61 61
     /**
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      */
92 92
     public static function findByRequiresParameter($methodName)
93 93
     {
94
-        return new self("You need to pass a parameter to '" . $methodName . "'");
94
+        return new self("You need to pass a parameter to '".$methodName."'");
95 95
     }
96 96
 
97 97
     /**
@@ -104,8 +104,8 @@  discard block
 block discarded – undo
104 104
     public static function invalidMagicCall($entityName, $fieldName, $method)
105 105
     {
106 106
         return new self(
107
-            "Entity '" . $entityName . "' has no field '" . $fieldName . "'. " .
108
-            "You can therefore not call '" . $method . "' on the entities' repository"
107
+            "Entity '".$entityName."' has no field '".$fieldName."'. ".
108
+            "You can therefore not call '".$method."' on the entities' repository"
109 109
         );
110 110
     }
111 111
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     public static function invalidFindByInverseAssociation($entityName, $associationFieldName)
119 119
     {
120 120
         return new self(
121
-            "You cannot search for the association field '" . $entityName . '#' . $associationFieldName . "', " .
121
+            "You cannot search for the association field '".$entityName.'#'.$associationFieldName."', ".
122 122
             'because it is the inverse side of an association. Find methods only work on owning side associations.'
123 123
         );
124 124
     }
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      */
161 161
     public static function queryCacheUsesNonPersistentCache(CacheDriver $cache)
162 162
     {
163
-        return new self('Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.');
163
+        return new self('Query Cache uses a non-persistent cache driver, '.get_class($cache).'.');
164 164
     }
165 165
 
166 166
     /**
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     public static function metadataCacheUsesNonPersistentCache(CacheDriver $cache)
170 170
     {
171
-        return new self('Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.');
171
+        return new self('Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.');
172 172
     }
173 173
 
174 174
     /**
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      */
187 187
     public static function invalidEntityRepository($className)
188 188
     {
189
-        return new self("Invalid repository class '" . $className . "'. It must be a Doctrine\Common\Persistence\ObjectRepository.");
189
+        return new self("Invalid repository class '".$className."'. It must be a Doctrine\Common\Persistence\ObjectRepository.");
190 190
     }
191 191
 
192 192
     /**
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
     public static function unrecognizedIdentifierFields($className, $fieldNames)
210 210
     {
211 211
         return new self(
212
-            "Unrecognized identifier fields: '" . implode("', '", $fieldNames) . "' " .
213
-            "are not present on class '" . $className . "'."
212
+            "Unrecognized identifier fields: '".implode("', '", $fieldNames)."' ".
213
+            "are not present on class '".$className."'."
214 214
         );
215 215
     }
216 216
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Annotation/DoctrineAnnotations.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -1,50 +1,50 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5
-require_once __DIR__ . '/Annotation.php';
6
-require_once __DIR__ . '/AssociationOverride.php';
7
-require_once __DIR__ . '/AssociationOverrides.php';
8
-require_once __DIR__ . '/AttributeOverride.php';
9
-require_once __DIR__ . '/AttributeOverrides.php';
10
-require_once __DIR__ . '/Cache.php';
11
-require_once __DIR__ . '/ChangeTrackingPolicy.php';
12
-require_once __DIR__ . '/Column.php';
13
-require_once __DIR__ . '/ColumnResult.php';
14
-require_once __DIR__ . '/CustomIdGenerator.php';
15
-require_once __DIR__ . '/DiscriminatorColumn.php';
16
-require_once __DIR__ . '/DiscriminatorMap.php';
17
-require_once __DIR__ . '/Embeddable.php';
18
-require_once __DIR__ . '/Embedded.php';
19
-require_once __DIR__ . '/Entity.php';
20
-require_once __DIR__ . '/EntityListeners.php';
21
-require_once __DIR__ . '/EntityResult.php';
22
-require_once __DIR__ . '/FieldResult.php';
23
-require_once __DIR__ . '/GeneratedValue.php';
24
-require_once __DIR__ . '/HasLifecycleCallbacks.php';
25
-require_once __DIR__ . '/Id.php';
26
-require_once __DIR__ . '/Index.php';
27
-require_once __DIR__ . '/InheritanceType.php';
28
-require_once __DIR__ . '/JoinColumn.php';
29
-require_once __DIR__ . '/JoinColumns.php';
30
-require_once __DIR__ . '/JoinTable.php';
31
-require_once __DIR__ . '/ManyToMany.php';
32
-require_once __DIR__ . '/ManyToOne.php';
33
-require_once __DIR__ . '/MappedSuperclass.php';
34
-require_once __DIR__ . '/OneToMany.php';
35
-require_once __DIR__ . '/OneToOne.php';
36
-require_once __DIR__ . '/OrderBy.php';
37
-require_once __DIR__ . '/PrePersist.php';
38
-require_once __DIR__ . '/PostLoad.php';
39
-require_once __DIR__ . '/PostPersist.php';
40
-require_once __DIR__ . '/PostRemove.php';
41
-require_once __DIR__ . '/PostUpdate.php';
42
-require_once __DIR__ . '/PreFlush.php';
43
-require_once __DIR__ . '/PreRemove.php';
44
-require_once __DIR__ . '/PreUpdate.php';
45
-require_once __DIR__ . '/SequenceGenerator.php';
46
-require_once __DIR__ . '/SqlResultSetMapping.php';
47
-require_once __DIR__ . '/SqlResultSetMappings.php';
48
-require_once __DIR__ . '/Table.php';
49
-require_once __DIR__ . '/UniqueConstraint.php';
50
-require_once __DIR__ . '/Version.php';
5
+require_once __DIR__.'/Annotation.php';
6
+require_once __DIR__.'/AssociationOverride.php';
7
+require_once __DIR__.'/AssociationOverrides.php';
8
+require_once __DIR__.'/AttributeOverride.php';
9
+require_once __DIR__.'/AttributeOverrides.php';
10
+require_once __DIR__.'/Cache.php';
11
+require_once __DIR__.'/ChangeTrackingPolicy.php';
12
+require_once __DIR__.'/Column.php';
13
+require_once __DIR__.'/ColumnResult.php';
14
+require_once __DIR__.'/CustomIdGenerator.php';
15
+require_once __DIR__.'/DiscriminatorColumn.php';
16
+require_once __DIR__.'/DiscriminatorMap.php';
17
+require_once __DIR__.'/Embeddable.php';
18
+require_once __DIR__.'/Embedded.php';
19
+require_once __DIR__.'/Entity.php';
20
+require_once __DIR__.'/EntityListeners.php';
21
+require_once __DIR__.'/EntityResult.php';
22
+require_once __DIR__.'/FieldResult.php';
23
+require_once __DIR__.'/GeneratedValue.php';
24
+require_once __DIR__.'/HasLifecycleCallbacks.php';
25
+require_once __DIR__.'/Id.php';
26
+require_once __DIR__.'/Index.php';
27
+require_once __DIR__.'/InheritanceType.php';
28
+require_once __DIR__.'/JoinColumn.php';
29
+require_once __DIR__.'/JoinColumns.php';
30
+require_once __DIR__.'/JoinTable.php';
31
+require_once __DIR__.'/ManyToMany.php';
32
+require_once __DIR__.'/ManyToOne.php';
33
+require_once __DIR__.'/MappedSuperclass.php';
34
+require_once __DIR__.'/OneToMany.php';
35
+require_once __DIR__.'/OneToOne.php';
36
+require_once __DIR__.'/OrderBy.php';
37
+require_once __DIR__.'/PrePersist.php';
38
+require_once __DIR__.'/PostLoad.php';
39
+require_once __DIR__.'/PostPersist.php';
40
+require_once __DIR__.'/PostRemove.php';
41
+require_once __DIR__.'/PostUpdate.php';
42
+require_once __DIR__.'/PreFlush.php';
43
+require_once __DIR__.'/PreRemove.php';
44
+require_once __DIR__.'/PreUpdate.php';
45
+require_once __DIR__.'/SequenceGenerator.php';
46
+require_once __DIR__.'/SqlResultSetMapping.php';
47
+require_once __DIR__.'/SqlResultSetMappings.php';
48
+require_once __DIR__.'/Table.php';
49
+require_once __DIR__.'/UniqueConstraint.php';
50
+require_once __DIR__.'/Version.php';
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Mapping/ClassMetadataTest.php 1 patch
Spacing   +6 added lines, -6 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\Tests\ORM\Mapping;
6 6
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 use Doctrine\Tests\OrmTestCase;
31 31
 use DoctrineGlobal_Article;
32 32
 
33
-require_once __DIR__ . '/../../Models/Global/GlobalNamespaceModel.php';
33
+require_once __DIR__.'/../../Models/Global/GlobalNamespaceModel.php';
34 34
 
35 35
 class ClassMetadataTest extends OrmTestCase
36 36
 {
@@ -802,7 +802,7 @@  discard block
 block discarded – undo
802 802
     public function testEmptyFieldNameThrowsException()
803 803
     {
804 804
         $this->expectException(MappingException::class);
805
-        $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '" . CMS\CmsUser::class . "'.");
805
+        $this->expectExceptionMessage("The field or association mapping misses the 'fieldName' attribute in entity '".CMS\CmsUser::class."'.");
806 806
 
807 807
         $cm = new ClassMetadata(CMS\CmsUser::class, $this->metadataBuildingContext);
808 808
         $cm->setTable(new Mapping\TableMetadata('cms_users'));
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
         $cm->addLifecycleCallback('notfound', 'postLoad');
853 853
 
854 854
         $this->expectException(MappingException::class);
855
-        $this->expectExceptionMessage("Entity '" . CMS\CmsUser::class . "' has no method 'notfound' to be registered as lifecycle callback.");
855
+        $this->expectExceptionMessage("Entity '".CMS\CmsUser::class."' has no method 'notfound' to be registered as lifecycle callback.");
856 856
 
857 857
         $cm->validateLifecycleCallbacks(new RuntimeReflectionService());
858 858
     }
@@ -872,7 +872,7 @@  discard block
 block discarded – undo
872 872
         $cm->addProperty($association);
873 873
 
874 874
         $this->expectException(MappingException::class);
875
-        $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '" . CMS\CmsUser::class . "#address'.");
875
+        $this->expectExceptionMessage("The target-entity 'UnknownClass' cannot be found in '".CMS\CmsUser::class."#address'.");
876 876
 
877 877
         $cm->validateAssociations();
878 878
     }
@@ -1118,6 +1118,6 @@  discard block
 block discarded – undo
1118 1118
      */
1119 1119
     public function propertyToColumnName($propertyName, $className = null)
1120 1120
     {
1121
-        return strtolower($this->classToTableName($className)) . '_' . $propertyName;
1121
+        return strtolower($this->classToTableName($className)).'_'.$propertyName;
1122 1122
     }
1123 1123
 }
Please login to merge, or discard this patch.