Failed Conditions
Push — master ( c35142...f185a6 )
by Guilherme
08:59
created
lib/Doctrine/ORM/Mapping/Builder/CacheMetadataBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
 
62 62
         $componentName = $this->componentMetadata->getRootClassName();
63 63
         $baseRegion    = strtolower(str_replace('\\', '_', $componentName));
64
-        $defaultRegion = $baseRegion . ($this->fieldName ? '__' . $this->fieldName : '');
64
+        $defaultRegion = $baseRegion.($this->fieldName ? '__'.$this->fieldName : '');
65 65
 
66 66
         $usage  = constant(sprintf('%s::%s', Mapping\CacheUsage::class, strtoupper($this->cacheAnnotation->usage)));
67 67
         $region = $this->cacheAnnotation->region ?: $defaultRegion;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadata.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
             $this->setCache(clone $parent->cache);
240 240
         }
241 241
 
242
-        if (! empty($parent->lifecycleCallbacks)) {
242
+        if ( ! empty($parent->lifecycleCallbacks)) {
243 243
             $this->lifecycleCallbacks = $parent->lifecycleCallbacks;
244 244
         }
245 245
 
246
-        if (! empty($parent->entityListeners)) {
246
+        if ( ! empty($parent->entityListeners)) {
247 247
             $this->entityListeners = $parent->entityListeners;
248 248
         }
249 249
     }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     public function __toString()
312 312
     {
313
-        return self::class . '@' . spl_object_id($this);
313
+        return self::class.'@'.spl_object_id($this);
314 314
     }
315 315
 
316 316
     /**
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
         // Restore ReflectionClass and properties
398 398
         $this->reflectionClass = $reflectionService->getClass($this->className);
399 399
 
400
-        if (! $this->reflectionClass) {
400
+        if ( ! $this->reflectionClass) {
401 401
             return;
402 402
         }
403 403
 
@@ -426,11 +426,11 @@  discard block
 block discarded – undo
426 426
      */
427 427
     public function isIdentifier(string $fieldName) : bool
428 428
     {
429
-        if (! $this->identifier) {
429
+        if ( ! $this->identifier) {
430 430
             return false;
431 431
         }
432 432
 
433
-        if (! $this->isIdentifierComposite()) {
433
+        if ( ! $this->isIdentifierComposite()) {
434 434
             return $fieldName === $this->identifier[0];
435 435
         }
436 436
 
@@ -454,11 +454,11 @@  discard block
 block discarded – undo
454 454
         }
455 455
 
456 456
         // Verify & complete identifier mapping
457
-        if (! $this->identifier) {
457
+        if ( ! $this->identifier) {
458 458
             throw MappingException::identifierRequired($this->className);
459 459
         }
460 460
 
461
-        $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static function (Property $property) : bool {
461
+        $explicitlyGeneratedProperties = array_filter($this->declaredProperties, static function(Property $property) : bool {
462 462
             return $property instanceof FieldMetadata
463 463
                 && $property->isPrimaryKey()
464 464
                 && $property->hasValueGenerator();
@@ -477,14 +477,14 @@  discard block
 block discarded – undo
477 477
     public function validateAssociations() : void
478 478
     {
479 479
         array_map(
480
-            function (Property $property) {
481
-                if (! ($property instanceof AssociationMetadata)) {
480
+            function(Property $property) {
481
+                if ( ! ($property instanceof AssociationMetadata)) {
482 482
                     return;
483 483
                 }
484 484
 
485 485
                 $targetEntity = $property->getTargetEntity();
486 486
 
487
-                if (! class_exists($targetEntity)) {
487
+                if ( ! class_exists($targetEntity)) {
488 488
                     throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName());
489 489
                 }
490 490
             },
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
         foreach ($this->lifecycleCallbacks as $callbacks) {
503 503
             /** @var array $callbacks */
504 504
             foreach ($callbacks as $callbackFuncName) {
505
-                if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) {
505
+                if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) {
506 506
                     throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName);
507 507
                 }
508 508
             }
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
         $fieldName    = $property->getName();
552 552
         $targetEntity = $property->getTargetEntity();
553 553
 
554
-        if (! $targetEntity) {
554
+        if ( ! $targetEntity) {
555 555
             throw MappingException::missingTargetEntity($fieldName);
556 556
         }
557 557
 
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
                 throw MappingException::illegalToManyIdentifierAssociation($this->className, $property->getName());
581 581
             }
582 582
 
583
-            if (! in_array($property->getName(), $this->identifier, true)) {
583
+            if ( ! in_array($property->getName(), $this->identifier, true)) {
584 584
                 $this->identifier[] = $property->getName();
585 585
             }
586 586
         }
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
                 /** @var JoinColumnMetadata $joinColumn */
627 627
                 if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) {
628 628
                     if (count($property->getJoinColumns()) === 1) {
629
-                        if (! $property->isPrimaryKey()) {
629
+                        if ( ! $property->isPrimaryKey()) {
630 630
                             $joinColumn->setUnique(true);
631 631
                         }
632 632
                     } else {
@@ -634,13 +634,13 @@  discard block
 block discarded – undo
634 634
                     }
635 635
                 }
636 636
 
637
-                $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null);
637
+                $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null);
638 638
 
639
-                if (! $joinColumn->getColumnName()) {
639
+                if ( ! $joinColumn->getColumnName()) {
640 640
                     $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className));
641 641
                 }
642 642
 
643
-                if (! $joinColumn->getReferencedColumnName()) {
643
+                if ( ! $joinColumn->getReferencedColumnName()) {
644 644
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
645 645
                 }
646 646
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
             }
649 649
 
650 650
             if ($uniqueConstraintColumns) {
651
-                if (! $this->table) {
651
+                if ( ! $this->table) {
652 652
                     throw new RuntimeException(
653 653
                         'ClassMetadata::setTable() has to be called before defining a one to one relationship.'
654 654
                     );
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
         if ($property->isOrphanRemoval()) {
669 669
             $cascades = $property->getCascade();
670 670
 
671
-            if (! in_array('remove', $cascades, true)) {
671
+            if ( ! in_array('remove', $cascades, true)) {
672 672
                 $cascades[] = 'remove';
673 673
 
674 674
                 $property->setCascade($cascades);
@@ -731,14 +731,14 @@  discard block
 block discarded – undo
731 731
     protected function validateAndCompleteOneToManyMapping(OneToManyAssociationMetadata $property)
732 732
     {
733 733
         // OneToMany MUST have mappedBy
734
-        if (! $property->getMappedBy()) {
734
+        if ( ! $property->getMappedBy()) {
735 735
             throw MappingException::oneToManyRequiresMappedBy($property->getName());
736 736
         }
737 737
 
738 738
         if ($property->isOrphanRemoval()) {
739 739
             $cascades = $property->getCascade();
740 740
 
741
-            if (! in_array('remove', $cascades, true)) {
741
+            if ( ! in_array('remove', $cascades, true)) {
742 742
                 $cascades[] = 'remove';
743 743
 
744 744
                 $property->setCascade($cascades);
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
 
762 762
             $property->setJoinTable($joinTable);
763 763
 
764
-            if (! $joinTable->getName()) {
764
+            if ( ! $joinTable->getName()) {
765 765
                 $joinTableName = $this->namingStrategy->joinTableName(
766 766
                     $property->getSourceEntity(),
767 767
                     $property->getTargetEntity(),
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 
774 774
             $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns();
775 775
 
776
-            if (! $joinTable->getJoinColumns()) {
776
+            if ( ! $joinTable->getJoinColumns()) {
777 777
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
778 778
                 $sourceReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName;
779 779
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName);
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
                 $joinTable->addJoinColumn($joinColumn);
787 787
             }
788 788
 
789
-            if (! $joinTable->getInverseJoinColumns()) {
789
+            if ( ! $joinTable->getInverseJoinColumns()) {
790 790
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
791 791
                 $targetReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName;
792 792
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName);
@@ -801,13 +801,13 @@  discard block
 block discarded – undo
801 801
 
802 802
             foreach ($joinTable->getJoinColumns() as $joinColumn) {
803 803
                 /** @var JoinColumnMetadata $joinColumn */
804
-                if (! $joinColumn->getReferencedColumnName()) {
804
+                if ( ! $joinColumn->getReferencedColumnName()) {
805 805
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
806 806
                 }
807 807
 
808 808
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
809 809
 
810
-                if (! $joinColumn->getColumnName()) {
810
+                if ( ! $joinColumn->getColumnName()) {
811 811
                     $columnName = $this->namingStrategy->joinKeyColumnName(
812 812
                         $property->getSourceEntity(),
813 813
                         $referencedColumnName
@@ -819,13 +819,13 @@  discard block
 block discarded – undo
819 819
 
820 820
             foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) {
821 821
                 /** @var JoinColumnMetadata $inverseJoinColumn */
822
-                if (! $inverseJoinColumn->getReferencedColumnName()) {
822
+                if ( ! $inverseJoinColumn->getReferencedColumnName()) {
823 823
                     $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
824 824
                 }
825 825
 
826 826
                 $referencedColumnName = $inverseJoinColumn->getReferencedColumnName();
827 827
 
828
-                if (! $inverseJoinColumn->getColumnName()) {
828
+                if ( ! $inverseJoinColumn->getColumnName()) {
829 829
                     $columnName = $this->namingStrategy->joinKeyColumnName(
830 830
                         $property->getTargetEntity(),
831 831
                         $referencedColumnName
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
             throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className);
860 860
         }
861 861
 
862
-        if (! isset($this->identifier[0])) {
862
+        if ( ! isset($this->identifier[0])) {
863 863
             throw MappingException::noIdDefined($this->className);
864 864
         }
865 865
 
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
             // Association defined as Id field
919 919
             $targetClass = $em->getClassMetadata($property->getTargetEntity());
920 920
 
921
-            if (! $property->isOwningSide()) {
921
+            if ( ! $property->isOwningSide()) {
922 922
                 $property    = $targetClass->getProperty($property->getMappedBy());
923 923
                 $targetClass = $em->getClassMetadata($property->getTargetEntity());
924 924
             }
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
                 $columnName           = $joinColumn->getColumnName();
933 933
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
934 934
 
935
-                if (! $joinColumn->getType()) {
935
+                if ( ! $joinColumn->getType()) {
936 936
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em));
937 937
                 }
938 938
 
@@ -966,10 +966,10 @@  discard block
 block discarded – undo
966 966
     {
967 967
         $schema = $this->getSchemaName() === null
968 968
             ? ''
969
-            : $this->getSchemaName() . '_';
969
+            : $this->getSchemaName().'_';
970 970
 
971 971
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
972
-        return $schema . $this->getTableName() . '_id_tmp';
972
+        return $schema.$this->getTableName().'_id_tmp';
973 973
     }
974 974
 
975 975
     /**
@@ -1003,7 +1003,7 @@  discard block
 block discarded – undo
1003 1003
      */
1004 1004
     public function setInheritanceType($type) : void
1005 1005
     {
1006
-        if (! $this->isInheritanceType($type)) {
1006
+        if ( ! $this->isInheritanceType($type)) {
1007 1007
             throw MappingException::invalidInheritanceType($this->className, $type);
1008 1008
         }
1009 1009
 
@@ -1021,7 +1021,7 @@  discard block
 block discarded – undo
1021 1021
     {
1022 1022
         $fieldName = $property->getName();
1023 1023
 
1024
-        if (! isset($this->declaredProperties[$fieldName])) {
1024
+        if ( ! isset($this->declaredProperties[$fieldName])) {
1025 1025
             throw MappingException::invalidOverrideFieldName($this->className, $fieldName);
1026 1026
         }
1027 1027
 
@@ -1229,7 +1229,7 @@  discard block
 block discarded – undo
1229 1229
         $inheritedProperty = $declaringClass->isMappedSuperclass ? clone $property : $property;
1230 1230
 
1231 1231
         if ($inheritedProperty instanceof FieldMetadata) {
1232
-            if (! $declaringClass->isMappedSuperclass) {
1232
+            if ( ! $declaringClass->isMappedSuperclass) {
1233 1233
                 $inheritedProperty->setTableName($property->getTableName());
1234 1234
             }
1235 1235
 
@@ -1322,11 +1322,11 @@  discard block
 block discarded – undo
1322 1322
             'method' => $methodName,
1323 1323
         ];
1324 1324
 
1325
-        if (! class_exists($class)) {
1325
+        if ( ! class_exists($class)) {
1326 1326
             throw MappingException::entityListenerClassNotFound($class, $this->className);
1327 1327
         }
1328 1328
 
1329
-        if (! method_exists($class, $methodName)) {
1329
+        if ( ! method_exists($class, $methodName)) {
1330 1330
             throw MappingException::entityListenerMethodNotFound($class, $methodName, $this->className);
1331 1331
         }
1332 1332
 
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
             return;
1395 1395
         }
1396 1396
 
1397
-        if (! (class_exists($className) || interface_exists($className))) {
1397
+        if ( ! (class_exists($className) || interface_exists($className))) {
1398 1398
             throw MappingException::invalidClassInDiscriminatorMap($className, $this->className);
1399 1399
         }
1400 1400
 
Please login to merge, or discard this patch.