Failed Conditions
Pull Request — develop (#6600)
by Mike
62:56
created
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,6 @@
 block discarded – undo
25 25
 use Doctrine\ORM\Mapping\ToManyAssociationMetadata;
26 26
 use Doctrine\ORM\Mapping\ToOneAssociationMetadata;
27 27
 use PDO;
28
-use Doctrine\Common\Collections\ArrayCollection;
29
-use Doctrine\ORM\Event\PostLoadEventDispatcher;
30 28
 use Doctrine\ORM\Mapping\ClassMetadata;
31 29
 use Doctrine\ORM\PersistentCollection;
32 30
 use Doctrine\ORM\Proxy\Proxy;
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Internal\Hydration;
6 6
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function prepare()
70 70
     {
71
-        if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) {
71
+        if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) {
72 72
             $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true;
73 73
         }
74 74
 
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 
79 79
             // Remember which associations are "fetch joined", so that we know where to inject
80 80
             // collection stubs or proxies and where not.
81
-            if (! isset($this->rsm->relationMap[$dqlAlias])) {
81
+            if ( ! isset($this->rsm->relationMap[$dqlAlias])) {
82 82
                 continue;
83 83
             }
84 84
 
85 85
             $parent = $this->rsm->parentAliasMap[$dqlAlias];
86 86
 
87
-            if (! isset($this->rsm->aliasMap[$parent])) {
87
+            if ( ! isset($this->rsm->aliasMap[$parent])) {
88 88
                 throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent);
89 89
             }
90 90
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 $class        = $this->getClassMetadata($className);
111 111
                 $inverseAssoc = $class->getProperty($association->getInversedBy());
112 112
 
113
-                if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) {
113
+                if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) {
114 114
                     continue;
115 115
                 }
116 116
 
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
         $value       = $association->getValue($entity);
177 177
         $oid         = spl_object_hash($entity);
178 178
 
179
-        if (! $value instanceof PersistentCollection) {
179
+        if ( ! $value instanceof PersistentCollection) {
180 180
             $value = $association->wrap($entity, $value, $this->em);
181 181
 
182 182
             $association->setValue($entity, $value);
183 183
 
184 184
             $this->uow->setOriginalEntityProperty($oid, $fieldName, $value);
185 185
 
186
-            $this->initializedCollections[$oid . $fieldName] = $value;
186
+            $this->initializedCollections[$oid.$fieldName] = $value;
187 187
         } else if (
188 188
             isset($this->hints[Query::HINT_REFRESH]) ||
189 189
             (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized())
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
             $value->setInitialized(true);
194 194
             $value->unwrap()->clear();
195 195
 
196
-            $this->initializedCollections[$oid . $fieldName] = $value;
196
+            $this->initializedCollections[$oid.$fieldName] = $value;
197 197
         } else {
198 198
             // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN!
199
-            $this->existingCollections[$oid . $fieldName] = $value;
199
+            $this->existingCollections[$oid.$fieldName] = $value;
200 200
         }
201 201
 
202 202
         return $value;
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
                 $parentAlias = $this->rsm->parentAliasMap[$dqlAlias];
315 315
                 // we need the $path to save into the identifier map which entities were already
316 316
                 // seen for this parent-child relationship
317
-                $path = $parentAlias . '.' . $dqlAlias;
317
+                $path = $parentAlias.'.'.$dqlAlias;
318 318
 
319 319
                 // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs
320
-                if (! isset($nonemptyComponents[$parentAlias])) {
320
+                if ( ! isset($nonemptyComponents[$parentAlias])) {
321 321
                     // TODO: Add special case code where we hydrate the right join objects into identity map at least
322 322
                     continue;
323 323
                 }
@@ -348,15 +348,15 @@  discard block
 block discarded – undo
348 348
                 $oid = spl_object_hash($parentObject);
349 349
 
350 350
                 // Check the type of the relation (many or single-valued)
351
-                if (! ($association instanceof ToOneAssociationMetadata)) {
351
+                if ( ! ($association instanceof ToOneAssociationMetadata)) {
352 352
                     // PATH A: Collection-valued association
353 353
                     $reflFieldValue = $association->getValue($parentObject);
354 354
 
355 355
                     if (isset($nonemptyComponents[$dqlAlias])) {
356
-                        $collKey = $oid . $relationField;
356
+                        $collKey = $oid.$relationField;
357 357
                         if (isset($this->initializedCollections[$collKey])) {
358 358
                             $reflFieldValue = $this->initializedCollections[$collKey];
359
-                        } else if (! isset($this->existingCollections[$collKey])) {
359
+                        } else if ( ! isset($this->existingCollections[$collKey])) {
360 360
                             $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias);
361 361
                         }
362 362
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                         $index          = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false;
365 365
                         $indexIsValid   = $index !== false ? isset($reflFieldValue[$index]) : false;
366 366
 
367
-                        if (! $indexExists || ! $indexIsValid) {
367
+                        if ( ! $indexExists || ! $indexIsValid) {
368 368
                             if (isset($this->existingCollections[$collKey])) {
369 369
                                 // Collection exists, only look for the element in the identity map.
370 370
                                 if ($element = $this->getEntityFromIdentityMap($entityName, $data)) {
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
                     // PATH B: Single-valued association
401 401
                     $reflFieldValue = $association->getValue($parentObject);
402 402
 
403
-                    if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) ||
403
+                    if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) ||
404 404
                         ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized())) {
405 405
                         // we only need to take action if this value is null,
406 406
                         // we refresh the entity or its an uninitialized proxy.
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                 $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0;
462 462
 
463 463
                 // if this row has a NULL value for the root result id then make it a null result.
464
-                if ( ! isset($nonemptyComponents[$dqlAlias]) ) {
464
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
465 465
                     if ($this->rsm->isMixed) {
466 466
                         $result[] = [$entityKey => null];
467 467
                     } else {
@@ -517,13 +517,13 @@  discard block
 block discarded – undo
517 517
             }
518 518
         }
519 519
 
520
-        if ( ! isset($resultKey) ) {
520
+        if ( ! isset($resultKey)) {
521 521
             $this->resultCounter++;
522 522
         }
523 523
 
524 524
         // Append scalar values to mixed result sets
525 525
         if (isset($rowData['scalars'])) {
526
-            if ( ! isset($resultKey) ) {
526
+            if ( ! isset($resultKey)) {
527 527
                 $resultKey = (isset($this->rsm->indexByMap['scalars']))
528 528
                     ? $row[$this->rsm->indexByMap['scalars']]
529 529
                     : $this->resultCounter - 1;
@@ -536,19 +536,19 @@  discard block
 block discarded – undo
536 536
 
537 537
         // Append new object to mixed result sets
538 538
         if (isset($rowData['newObjects'])) {
539
-            if ( ! isset($resultKey) ) {
539
+            if ( ! isset($resultKey)) {
540 540
                 $resultKey = $this->resultCounter - 1;
541 541
             }
542 542
 
543 543
 
544
-            $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0);
544
+            $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0);
545 545
 
546 546
             foreach ($rowData['newObjects'] as $objIndex => $newObject) {
547 547
                 $class  = $newObject['class'];
548 548
                 $args   = $newObject['args'];
549 549
                 $obj    = $class->newInstanceArgs($args);
550 550
 
551
-                if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) {
551
+                if ($scalarCount == 0 && count($rowData['newObjects']) == 1) {
552 552
                     $result[$resultKey] = $obj;
553 553
 
554 554
                     continue;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/AssociationMetadata.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
     }
157 157
 
158 158
     /**
159
-     * @return array
159
+     * @return string[]
160 160
      */
161 161
     public function getCascade()
162 162
     {
Please login to merge, or discard this 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/Mapping/ClassMetadata.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1278,7 +1278,7 @@
 block discarded – undo
1278 1278
      *
1279 1279
      * @todo guilhermeblanco Only used for ClassMetadataTest. Remove if possible!
1280 1280
      *
1281
-     * @param array $subclasses The names of all mapped subclasses.
1281
+     * @param string[] $subclasses The names of all mapped subclasses.
1282 1282
      *
1283 1283
      * @return void
1284 1284
      */
Please login to merge, or discard this patch.
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 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
 
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
      *
314 314
      * @return void
315 315
      */
316
-    public function setCache(?CacheMetadata $cache = null)
316
+    public function setCache(? CacheMetadata $cache = null)
317 317
     {
318 318
         $this->cache = $cache;
319 319
     }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
     /**
322 322
      * @return CacheMetadata|null
323 323
      */
324
-    public function getCache(): ?CacheMetadata
324
+    public function getCache(): ? CacheMetadata
325 325
     {
326 326
         return $this->cache;
327 327
     }
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
     /**
330 330
      * @return \ReflectionClass|null
331 331
      */
332
-    public function getReflectionClass() : ?\ReflectionClass
332
+    public function getReflectionClass() : ? \ReflectionClass
333 333
     {
334 334
         return $this->reflectionClass;
335 335
     }
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     public function __toString()
359 359
     {
360
-        return __CLASS__ . '@' . spl_object_hash($this);
360
+        return __CLASS__.'@'.spl_object_hash($this);
361 361
     }
362 362
 
363 363
     /**
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         // Restore ReflectionClass and properties
462 462
         $this->reflectionClass = $reflService->getClass($this->name);
463 463
 
464
-        if (! $this->reflectionClass) {
464
+        if ( ! $this->reflectionClass) {
465 465
             return;
466 466
         }
467 467
 
@@ -536,11 +536,11 @@  discard block
 block discarded – undo
536 536
         }
537 537
 
538 538
         // Verify & complete identifier mapping
539
-        if (! $this->identifier) {
539
+        if ( ! $this->identifier) {
540 540
             throw MappingException::identifierRequired($this->name);
541 541
         }
542 542
 
543
-        $explicitlyGeneratedProperties = array_filter($this->properties, function (Property $property) : bool {
543
+        $explicitlyGeneratedProperties = array_filter($this->properties, function(Property $property) : bool {
544 544
             return $property instanceof FieldMetadata
545 545
                 && $property->isPrimaryKey()
546 546
                 && $property->hasValueGenerator();
@@ -561,8 +561,8 @@  discard block
 block discarded – undo
561 561
     public function validateAssociations()
562 562
     {
563 563
         array_map(
564
-            function (Property $property) {
565
-                if (! ($property instanceof AssociationMetadata)) {
564
+            function(Property $property) {
565
+                if ( ! ($property instanceof AssociationMetadata)) {
566 566
                     return;
567 567
                 }
568 568
 
@@ -618,11 +618,11 @@  discard block
 block discarded – undo
618 618
      */
619 619
     public function isIdentifier($fieldName)
620 620
     {
621
-        if (! $this->identifier) {
621
+        if ( ! $this->identifier) {
622 622
             return false;
623 623
         }
624 624
 
625
-        if (! $this->isIdentifierComposite()) {
625
+        if ( ! $this->isIdentifierComposite()) {
626 626
             return $fieldName === $this->identifier[0];
627 627
         }
628 628
 
@@ -650,7 +650,7 @@  discard block
 block discarded – undo
650 650
      */
651 651
     public function getNamedQuery($queryName)
652 652
     {
653
-        if (! isset($this->namedQueries[$queryName])) {
653
+        if ( ! isset($this->namedQueries[$queryName])) {
654 654
             throw MappingException::queryNotFound($this->name, $queryName);
655 655
         }
656 656
 
@@ -710,7 +710,7 @@  discard block
 block discarded – undo
710 710
      */
711 711
     public function getSqlResultSetMapping($name)
712 712
     {
713
-        if (! isset($this->sqlResultSetMappings[$name])) {
713
+        if ( ! isset($this->sqlResultSetMappings[$name])) {
714 714
             throw MappingException::resultMappingNotFound($this->name, $name);
715 715
         }
716 716
 
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
             $property->setColumnName($columnName);
746 746
         }
747 747
 
748
-        if (! $this->isMappedSuperclass) {
748
+        if ( ! $this->isMappedSuperclass) {
749 749
             $property->setTableName($this->getTableName());
750 750
         }
751 751
 
@@ -765,7 +765,7 @@  discard block
 block discarded – undo
765 765
                 throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property);
766 766
             };
767 767
 
768
-            if (! in_array($fieldName, $this->identifier)) {
768
+            if ( ! in_array($fieldName, $this->identifier)) {
769 769
                 $this->identifier[] = $fieldName;
770 770
             }
771 771
         }
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
         $fieldName    = $property->getName();
820 820
         $targetEntity = $property->getTargetEntity();
821 821
 
822
-        if (! $targetEntity) {
822
+        if ( ! $targetEntity) {
823 823
             throw MappingException::missingTargetEntity($fieldName);
824 824
         }
825 825
 
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
                 $this->identifier[] = $property->getName();
851 851
             }
852 852
 
853
-            if ($this->cache && !$property->getCache()) {
853
+            if ($this->cache && ! $property->getCache()) {
854 854
                 throw CacheException::nonCacheableEntityAssociation($this->name, $fieldName);
855 855
             }
856 856
 
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
             foreach ($property->getJoinColumns() as $joinColumn) {
904 904
                 if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) {
905 905
                     if (1 === count($property->getJoinColumns())) {
906
-                        if (! $property->isPrimaryKey()) {
906
+                        if ( ! $property->isPrimaryKey()) {
907 907
                             $joinColumn->setUnique(true);
908 908
                         }
909 909
                     } else {
@@ -911,13 +911,13 @@  discard block
 block discarded – undo
911 911
                     }
912 912
                 }
913 913
 
914
-                $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null);
914
+                $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null);
915 915
 
916
-                if (! $joinColumn->getColumnName()) {
916
+                if ( ! $joinColumn->getColumnName()) {
917 917
                     $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->name));
918 918
                 }
919 919
 
920
-                if (! $joinColumn->getReferencedColumnName()) {
920
+                if ( ! $joinColumn->getReferencedColumnName()) {
921 921
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
922 922
                 }
923 923
 
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
         if ($property->isOrphanRemoval()) {
946 946
             $cascades = $property->getCascade();
947 947
 
948
-            if (! in_array('remove', $cascades)) {
948
+            if ( ! in_array('remove', $cascades)) {
949 949
                 $cascades[] = 'remove';
950 950
 
951 951
                 $property->setCascade($cascades);
@@ -1013,14 +1013,14 @@  discard block
 block discarded – undo
1013 1013
         $property->setOwningSide(false);
1014 1014
 
1015 1015
         // OneToMany MUST have mappedBy
1016
-        if (! $property->getMappedBy()) {
1016
+        if ( ! $property->getMappedBy()) {
1017 1017
             throw MappingException::oneToManyRequiresMappedBy($property->getName());
1018 1018
         }
1019 1019
 
1020 1020
         if ($property->isOrphanRemoval()) {
1021 1021
             $cascades = $property->getCascade();
1022 1022
 
1023
-            if (! in_array('remove', $cascades)) {
1023
+            if ( ! in_array('remove', $cascades)) {
1024 1024
                 $cascades[] = 'remove';
1025 1025
 
1026 1026
                 $property->setCascade($cascades);
@@ -1043,7 +1043,7 @@  discard block
 block discarded – undo
1043 1043
 
1044 1044
             $property->setJoinTable($joinTable);
1045 1045
 
1046
-            if (! $joinTable->getName()) {
1046
+            if ( ! $joinTable->getName()) {
1047 1047
                 $joinTableName = $this->namingStrategy->joinTableName(
1048 1048
                     $property->getSourceEntity(),
1049 1049
                     $property->getTargetEntity(),
@@ -1055,7 +1055,7 @@  discard block
 block discarded – undo
1055 1055
 
1056 1056
             $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns();
1057 1057
 
1058
-            if (! $joinTable->getJoinColumns()) {
1058
+            if ( ! $joinTable->getJoinColumns()) {
1059 1059
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
1060 1060
                 $sourceReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName;
1061 1061
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName);
@@ -1068,7 +1068,7 @@  discard block
 block discarded – undo
1068 1068
                 $joinTable->addJoinColumn($joinColumn);
1069 1069
             }
1070 1070
 
1071
-            if (! $joinTable->getInverseJoinColumns()) {
1071
+            if ( ! $joinTable->getInverseJoinColumns()) {
1072 1072
                 $referencedColumnName = $this->namingStrategy->referenceColumnName();
1073 1073
                 $targetReferenceName  = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName;
1074 1074
                 $columnName           = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName);
@@ -1082,13 +1082,13 @@  discard block
 block discarded – undo
1082 1082
             }
1083 1083
 
1084 1084
             foreach ($joinTable->getJoinColumns() as $joinColumn) {
1085
-                if (! $joinColumn->getReferencedColumnName()) {
1085
+                if ( ! $joinColumn->getReferencedColumnName()) {
1086 1086
                     $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
1087 1087
                 }
1088 1088
 
1089 1089
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
1090 1090
 
1091
-                if (! $joinColumn->getColumnName()) {
1091
+                if ( ! $joinColumn->getColumnName()) {
1092 1092
                     $columnName = $this->namingStrategy->joinKeyColumnName(
1093 1093
                         $property->getSourceEntity(),
1094 1094
                         $referencedColumnName
@@ -1099,13 +1099,13 @@  discard block
 block discarded – undo
1099 1099
             }
1100 1100
 
1101 1101
             foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) {
1102
-                if (! $inverseJoinColumn->getReferencedColumnName()) {
1102
+                if ( ! $inverseJoinColumn->getReferencedColumnName()) {
1103 1103
                     $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName());
1104 1104
                 }
1105 1105
 
1106 1106
                 $referencedColumnName = $inverseJoinColumn->getReferencedColumnName();
1107 1107
 
1108
-                if (! $inverseJoinColumn->getColumnName()) {
1108
+                if ( ! $inverseJoinColumn->getColumnName()) {
1109 1109
                     $columnName = $this->namingStrategy->joinKeyColumnName(
1110 1110
                         $property->getTargetEntity(),
1111 1111
                         $referencedColumnName
@@ -1198,7 +1198,7 @@  discard block
 block discarded – undo
1198 1198
             // Association defined as Id field
1199 1199
             $targetClass = $em->getClassMetadata($property->getTargetEntity());
1200 1200
 
1201
-            if (! $property->isOwningSide()) {
1201
+            if ( ! $property->isOwningSide()) {
1202 1202
                 $property    = $targetClass->getProperty($property->getMappedBy());
1203 1203
                 $targetClass = $em->getClassMetadata($property->getTargetEntity());
1204 1204
             }
@@ -1249,11 +1249,11 @@  discard block
 block discarded – undo
1249 1249
     {
1250 1250
         $schema = empty($this->getSchemaName())
1251 1251
             ? ''
1252
-            : $this->getSchemaName() . '_'
1252
+            : $this->getSchemaName().'_'
1253 1253
         ;
1254 1254
 
1255 1255
         // replace dots with underscores because PostgreSQL creates temporary tables in a special schema
1256
-        return $schema . $this->getTableName() . '_id_tmp';
1256
+        return $schema.$this->getTableName().'_id_tmp';
1257 1257
     }
1258 1258
 
1259 1259
     /**
@@ -1339,7 +1339,7 @@  discard block
 block discarded – undo
1339 1339
     {
1340 1340
         $fieldName = $property->getName();
1341 1341
 
1342
-        if (! isset($this->properties[$fieldName])) {
1342
+        if ( ! isset($this->properties[$fieldName])) {
1343 1343
             throw MappingException::invalidOverrideFieldName($this->name, $fieldName);
1344 1344
         }
1345 1345
 
@@ -1459,7 +1459,7 @@  discard block
 block discarded – undo
1459 1459
      *
1460 1460
      * @return LocalColumnMetadata|null
1461 1461
      */
1462
-    public function getColumn(string $columnName): ?LocalColumnMetadata
1462
+    public function getColumn(string $columnName): ? LocalColumnMetadata
1463 1463
     {
1464 1464
         foreach ($this->properties as $property) {
1465 1465
             if ($property instanceof LocalColumnMetadata && $property->getColumnName() === $columnName) {
@@ -1566,7 +1566,7 @@  discard block
 block discarded – undo
1566 1566
         $declaringClass    = $property->getDeclaringClass();
1567 1567
 
1568 1568
         if ($inheritedProperty instanceof FieldMetadata) {
1569
-            if (! $declaringClass->isMappedSuperclass) {
1569
+            if ( ! $declaringClass->isMappedSuperclass) {
1570 1570
                 $inheritedProperty->setTableName($property->getTableName());
1571 1571
             }
1572 1572
 
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
             throw MappingException::duplicateQueryMapping($this->name, $name);
1625 1625
         }
1626 1626
 
1627
-        if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
1627
+        if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) {
1628 1628
             throw MappingException::missingQueryMapping($this->name, $name);
1629 1629
         }
1630 1630
 
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
      */
1648 1648
     public function addSqlResultSetMapping(array $resultMapping)
1649 1649
     {
1650
-        if (!isset($resultMapping['name'])) {
1650
+        if ( ! isset($resultMapping['name'])) {
1651 1651
             throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name);
1652 1652
         }
1653 1653
 
@@ -1657,7 +1657,7 @@  discard block
 block discarded – undo
1657 1657
 
1658 1658
         if (isset($resultMapping['entities'])) {
1659 1659
             foreach ($resultMapping['entities'] as $key => $entityResult) {
1660
-                if (! isset($entityResult['entityClass'])) {
1660
+                if ( ! isset($entityResult['entityClass'])) {
1661 1661
                     throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']);
1662 1662
                 }
1663 1663
 
@@ -1670,11 +1670,11 @@  discard block
 block discarded – undo
1670 1670
 
1671 1671
                 if (isset($entityResult['fields'])) {
1672 1672
                     foreach ($entityResult['fields'] as $k => $field) {
1673
-                        if (! isset($field['name'])) {
1673
+                        if ( ! isset($field['name'])) {
1674 1674
                             throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']);
1675 1675
                         }
1676 1676
 
1677
-                        if (! isset($field['column'])) {
1677
+                        if ( ! isset($field['column'])) {
1678 1678
                             $fieldName = $field['name'];
1679 1679
 
1680 1680
                             if (strpos($fieldName, '.')) {
@@ -1698,7 +1698,7 @@  discard block
 block discarded – undo
1698 1698
      *
1699 1699
      * @return void
1700 1700
      */
1701
-    public function setCustomRepositoryClassName(?string $repositoryClassName)
1701
+    public function setCustomRepositoryClassName(? string $repositoryClassName)
1702 1702
     {
1703 1703
         $this->customRepositoryClassName = $repositoryClassName;
1704 1704
     }
@@ -1706,7 +1706,7 @@  discard block
 block discarded – undo
1706 1706
     /**
1707 1707
      * @return string|null
1708 1708
      */
1709
-    public function getCustomRepositoryClassName() : ?string
1709
+    public function getCustomRepositoryClassName() : ? string
1710 1710
     {
1711 1711
         return $this->customRepositoryClassName;
1712 1712
     }
@@ -1781,11 +1781,11 @@  discard block
 block discarded – undo
1781 1781
             'method' => $method,
1782 1782
         ];
1783 1783
 
1784
-        if (! class_exists($class)) {
1784
+        if ( ! class_exists($class)) {
1785 1785
             throw MappingException::entityListenerClassNotFound($class, $this->name);
1786 1786
         }
1787 1787
 
1788
-        if (! method_exists($class, $method)) {
1788
+        if ( ! method_exists($class, $method)) {
1789 1789
             throw MappingException::entityListenerMethodNotFound($class, $method, $this->name);
1790 1790
         }
1791 1791
 
@@ -1859,7 +1859,7 @@  discard block
 block discarded – undo
1859 1859
             return;
1860 1860
         }
1861 1861
 
1862
-        if (! (class_exists($className) || interface_exists($className))) {
1862
+        if ( ! (class_exists($className) || interface_exists($className))) {
1863 1863
             throw MappingException::invalidClassInDiscriminatorMap($className, $this->name);
1864 1864
         }
1865 1865
 
@@ -1956,7 +1956,7 @@  discard block
 block discarded – undo
1956 1956
         $namespace = $this->reflectionClass->getNamespaceName();
1957 1957
 
1958 1958
         if ($className !== null && strpos($className, '\\') === false && $namespace) {
1959
-            return ltrim($namespace . '\\' . $className, '\\');
1959
+            return ltrim($namespace.'\\'.$className, '\\');
1960 1960
         }
1961 1961
 
1962 1962
         return ltrim($className, '\\');
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
     /**
56 56
      * Constructor.
57 57
      *
58
-     * @param array|string $paths
58
+     * @param string $paths
59 59
      */
60 60
     public function __construct($paths)
61 61
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 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
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             return $this->classNames;
76 76
         }
77 77
 
78
-        if (!$this->paths) {
78
+        if ( ! $this->paths) {
79 79
             throw MappingException::pathRequired();
80 80
         }
81 81
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         $includedFiles = [];
84 84
 
85 85
         foreach ($this->paths as $path) {
86
-            if (!is_dir($path)) {
86
+            if ( ! is_dir($path)) {
87 87
                 throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path);
88 88
             }
89 89
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         foreach ($declared as $className) {
109 109
             $rc = new \ReflectionClass($className);
110 110
             $sourceFile = $rc->getFileName();
111
-            if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) {
111
+            if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) {
112 112
                 $classes[] = $className;
113 113
             }
114 114
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/FieldMetadata.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 
25 25
 use Doctrine\DBAL\Types\Type;
26 26
 use Doctrine\ORM\Reflection\ReflectionService;
27
-use Doctrine\ORM\Sequencing\Generator;
28 27
 
29 28
 class FieldMetadata extends LocalColumnMetadata implements Property
30 29
 {
Please login to merge, or discard this 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/ORMInvalidArgumentException.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -207,7 +207,6 @@
 block discarded – undo
207 207
 
208 208
     /**
209 209
      * @param ClassMetadata $targetClass
210
-     * @param array         $assoc
211 210
      * @param mixed         $actualValue
212 211
      *
213 212
      * @return self
Please login to merge, or discard this 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
 use Doctrine\ORM\Mapping\AssociationMetadata;
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
      */
22 22
     static public function scheduleInsertForManagedEntity($entity)
23 23
     {
24
-        return new self("A managed+dirty entity " . self::objToStr($entity) . " can not be scheduled for insertion.");
24
+        return new self("A managed+dirty entity ".self::objToStr($entity)." can not be scheduled for insertion.");
25 25
     }
26 26
 
27 27
     /**
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
      */
32 32
     static public function scheduleInsertForRemovedEntity($entity)
33 33
     {
34
-        return new self("Removed entity " . self::objToStr($entity) . " can not be scheduled for insertion.");
34
+        return new self("Removed entity ".self::objToStr($entity)." can not be scheduled for insertion.");
35 35
     }
36 36
 
37 37
     /**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     static public function scheduleInsertTwice($entity)
43 43
     {
44
-        return new self("Entity " . self::objToStr($entity) . " can not be scheduled for insertion twice.");
44
+        return new self("Entity ".self::objToStr($entity)." can not be scheduled for insertion twice.");
45 45
     }
46 46
 
47 47
     /**
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     static public function entityWithoutIdentity($className, $entity)
54 54
     {
55 55
         return new self(
56
-            "The given entity of type '" . $className . "' (".self::objToStr($entity).") has no identity/no " .
56
+            "The given entity of type '".$className."' (".self::objToStr($entity).") has no identity/no ".
57 57
             "id values set. It cannot be added to the identity map."
58 58
         );
59 59
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     static public function readOnlyRequiresManagedEntity($entity)
67 67
     {
68
-        return new self("Only managed entities can be marked or checked as read only. But " . self::objToStr($entity) . " is not");
68
+        return new self("Only managed entities can be marked or checked as read only. But ".self::objToStr($entity)." is not");
69 69
     }
70 70
 
71 71
     /**
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     static public function entityNotManaged($entity)
123 123
     {
124
-        return new self("Entity " . self::objToStr($entity) . " is not managed. An entity is managed if its fetched " .
124
+        return new self("Entity ".self::objToStr($entity)." is not managed. An entity is managed if its fetched ".
125 125
             "from the database or registered as new through EntityManager#persist");
126 126
     }
127 127
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     static public function entityHasNoIdentity($entity, $operation)
135 135
     {
136
-        return new self("Entity has no identity, therefore " . $operation ." cannot be performed. " . self::objToStr($entity));
136
+        return new self("Entity has no identity, therefore ".$operation." cannot be performed. ".self::objToStr($entity));
137 137
     }
138 138
 
139 139
     /**
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
      */
145 145
     static public function entityIsRemoved($entity, $operation)
146 146
     {
147
-        return new self("Entity is removed, therefore " . $operation ." cannot be performed. " . self::objToStr($entity));
147
+        return new self("Entity is removed, therefore ".$operation." cannot be performed. ".self::objToStr($entity));
148 148
     }
149 149
 
150 150
     /**
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      */
156 156
     static public function detachedEntityCannot($entity, $operation)
157 157
     {
158
-        return new self("Detached entity " . self::objToStr($entity) . " cannot be " . $operation);
158
+        return new self("Detached entity ".self::objToStr($entity)." cannot be ".$operation);
159 159
     }
160 160
 
161 161
     /**
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
      */
168 168
     public static function invalidObject($context, $given, $parameterIndex = 1)
169 169
     {
170
-        return new self($context . ' expects parameter ' . $parameterIndex .
171
-            ' to be an entity object, '. gettype($given) . ' given.');
170
+        return new self($context.' expects parameter '.$parameterIndex.
171
+            ' to be an entity object, '.gettype($given).' given.');
172 172
     }
173 173
 
174 174
     /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     public static function invalidCompositeIdentifier()
178 178
     {
179
-        return new self("Binding an entity with a composite primary key to a query is not supported. " .
179
+        return new self("Binding an entity with a composite primary key to a query is not supported. ".
180 180
             "You should split the parameter into the explicit fields and bind them separately.");
181 181
     }
182 182
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/PersistentObject.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
      * @param string $field
121 121
      * @param array  $args
122 122
      *
123
-     * @return object
123
+     * @return PersistentObject
124 124
      *
125 125
      * @throws \BadMethodCallException   When no persistent field exists by that name.
126 126
      * @throws \InvalidArgumentException When the wrong target object type is passed to an association.
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      * @param string $field
208 208
      * @param array  $args
209 209
      *
210
-     * @return object
210
+     * @return PersistentObject
211 211
      *
212 212
      * @throws \BadMethodCallException
213 213
      * @throws \InvalidArgumentException
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 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
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
     {
90 90
         if ($entityManager !== self::$entityManager) {
91 91
             throw new \RuntimeException(
92
-                "Trying to use PersistentObject with different EntityManager instances. " .
92
+                "Trying to use PersistentObject with different EntityManager instances. ".
93 93
                 "Was PersistentObject::setEntityManager() called?"
94 94
             );
95 95
         }
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 
115 115
         $property = $this->cm->getProperty($field);
116 116
 
117
-        if (! $property) {
117
+        if ( ! $property) {
118 118
             throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
119 119
         }
120 120
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
         $property = $this->cm->getProperty($field);
155 155
 
156
-        if (! $property) {
156
+        if ( ! $property) {
157 157
             throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
158 158
         }
159 159
 
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
         $mappedByField    = $property->getMappedBy();
180 180
         $targetMetadata   = self::$entityManager->getClassMetadata($property->getTargetEntity());
181 181
         $targetProperty   = $targetMetadata->getProperty($mappedByField);
182
-        $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField;
182
+        $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField;
183 183
 
184 184
         $targetObject->$setterMethodName($this);
185 185
     }
@@ -201,21 +201,21 @@  discard block
 block discarded – undo
201 201
 
202 202
         $property = $this->cm->getProperty($field);
203 203
 
204
-        if (! $property) {
204
+        if ( ! $property) {
205 205
             throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'");
206 206
         }
207 207
 
208
-        if (! ($property instanceof ToManyAssociationMetadata)) {
208
+        if ( ! ($property instanceof ToManyAssociationMetadata)) {
209 209
             throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getClassName());
210 210
         }
211 211
 
212 212
         $targetClassName = $property->getTargetEntity();
213 213
 
214
-        if (! ($args[0] instanceof $targetClassName)) {
214
+        if ( ! ($args[0] instanceof $targetClassName)) {
215 215
             throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'");
216 216
         }
217 217
 
218
-        if (! ($this->$field instanceof Collection)) {
218
+        if ( ! ($this->$field instanceof Collection)) {
219 219
             $this->$field = new ArrayCollection($this->$field ?: []);
220 220
         }
221 221
 
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             return;
240 240
         }
241 241
 
242
-        if (!self::$entityManager) {
242
+        if ( ! self::$entityManager) {
243 243
             throw new \RuntimeException("No runtime entity manager set. Call PersistentObject#setEntityManager().");
244 244
         }
245 245
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,6 @@
 block discarded – undo
22 22
 namespace Doctrine\ORM\Persisters\Collection;
23 23
 
24 24
 use Doctrine\Common\Collections\Criteria;
25
-use Doctrine\ORM\Mapping\AssociationMetadata;
26 25
 use Doctrine\ORM\Mapping\ClassMetadata;
27 26
 use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata;
28 27
 use Doctrine\ORM\Mapping\ToManyAssociationMetadata;
Please login to merge, or discard this patch.
Spacing   +44 added lines, -44 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\Collection;
6 6
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $association = $collection->getMapping();
33 33
 
34
-        if (! $association->isOwningSide()) {
34
+        if ( ! $association->isOwningSide()) {
35 35
             return; // ignore inverse side
36 36
         }
37 37
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $association = $collection->getMapping();
58 58
 
59
-        if (! $association->isOwningSide()) {
59
+        if ( ! $association->isOwningSide()) {
60 60
             return; // ignore inverse side
61 61
         }
62 62
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     {
88 88
         $association = $collection->getMapping();
89 89
 
90
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
90
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
91 91
             throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections.");
92 92
         }
93 93
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             : $association->getMappedBy()
98 98
         ;
99 99
 
100
-        $criteria  = [
100
+        $criteria = [
101 101
             $mappedKey                   => $collection->getOwner(),
102 102
             $association->getIndexedBy() => $index,
103 103
         ];
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
             $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
134 134
             $referencedName   = $joinColumn->getReferencedColumnName();
135 135
 
136
-            if (! $joinColumn->getType()) {
136
+            if ( ! $joinColumn->getType()) {
137 137
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em));
138 138
             }
139 139
 
140
-            $conditions[]   = 't.' . $quotedColumnName . ' = ?';
140
+            $conditions[]   = 't.'.$quotedColumnName.' = ?';
141 141
             $params[]       = $id[$sourceClass->fieldNames[$referencedName]];
142 142
             $types[]        = $joinColumn->getType();
143 143
         }
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
         }*/
167 167
 
168 168
         $sql = 'SELECT COUNT(*)'
169
-            . ' FROM ' . $joinTableName . ' t'
169
+            . ' FROM '.$joinTableName.' t'
170 170
             . $joinTargetEntitySQL
171
-            . ' WHERE ' . implode(' AND ', $conditions);
171
+            . ' WHERE '.implode(' AND ', $conditions);
172 172
 
173 173
         return $this->conn->fetchColumn($sql, $params, 0, $types);
174 174
     }
@@ -190,13 +190,13 @@  discard block
 block discarded – undo
190 190
     {
191 191
         $association = $collection->getMapping();
192 192
 
193
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
193
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
194 194
             throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections.");
195 195
         }
196 196
 
197 197
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true);
198 198
 
199
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
199
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
200 200
 
201 201
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
202 202
     }
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true);
214 214
 
215
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
215
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
216 216
 
217 217
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
218 218
     }
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false);
230 230
 
231
-        $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
231
+        $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
232 232
 
233 233
         return (bool) $this->conn->executeUpdate($sql, $params, $types);
234 234
     }
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         $onConditions  = $this->getOnConditionSQL($association);
247 247
         $whereClauses  = $params = $types = [];
248 248
 
249
-        if (! $association->isOwningSide()) {
249
+        if ( ! $association->isOwningSide()) {
250 250
             $association = $targetClass->getProperty($association->getMappedBy());
251 251
             $joinColumns = $association->getJoinTable()->getInverseJoinColumns();
252 252
         } else {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
             $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName());
258 258
             $referencedName   = $joinColumn->getReferencedColumnName();
259 259
 
260
-            if (! $joinColumn->getType()) {
260
+            if ( ! $joinColumn->getType()) {
261 261
                 $joinColumn->setType(
262 262
                     PersisterHelper::getTypeOfColumn($referencedName, $ownerMetadata, $this->em)
263 263
                 );
@@ -287,11 +287,11 @@  discard block
 block discarded – undo
287 287
 
288 288
         $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te');
289 289
 
290
-        $sql = 'SELECT ' . $resultSetMapping->generateSelectClause()
291
-            . ' FROM ' . $tableName . ' te'
292
-            . ' JOIN ' . $joinTableName . ' t ON'
290
+        $sql = 'SELECT '.$resultSetMapping->generateSelectClause()
291
+            . ' FROM '.$tableName.' te'
292
+            . ' JOIN '.$joinTableName.' t ON'
293 293
             . implode(' AND ', $onConditions)
294
-            . ' WHERE ' . implode(' AND ', $whereClauses);
294
+            . ' WHERE '.implode(' AND ', $whereClauses);
295 295
 
296 296
         $sql .= $this->getOrderingSql($criteria, $targetClass);
297 297
         $sql .= $this->getLimitSql($criteria);
@@ -328,8 +328,8 @@  discard block
 block discarded – undo
328 328
 
329 329
         // A join is needed if there is filtering on the target entity
330 330
         $tableName = $rootClass->table->getQuotedQualifiedName($this->platform);
331
-        $joinSql   = ' JOIN ' . $tableName . ' te'
332
-            . ' ON' . implode(' AND ', $this->getOnConditionSQL($association));
331
+        $joinSql   = ' JOIN '.$tableName.' te'
332
+            . ' ON'.implode(' AND ', $this->getOnConditionSQL($association));
333 333
 
334 334
         return [$joinSql, $filterSql];
335 335
     }
@@ -348,18 +348,18 @@  discard block
 block discarded – undo
348 348
 
349 349
         foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
350 350
             if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) {
351
-                $filterClauses[] = '(' . $filterExpr . ')';
351
+                $filterClauses[] = '('.$filterExpr.')';
352 352
             }
353 353
         }
354 354
 
355
-        if (! $filterClauses) {
355
+        if ( ! $filterClauses) {
356 356
             return '';
357 357
         }
358 358
 
359 359
         $filterSql = implode(' AND ', $filterClauses);
360 360
 
361 361
         return count($filterClauses) > 1
362
-            ? '(' . $filterSql . ')'
362
+            ? '('.$filterSql.')'
363 363
             : $filterSql
364 364
         ;
365 365
     }
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
             $quotedColumnName           = $this->platform->quoteIdentifier($joinColumn->getColumnName());
391 391
             $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName());
392 392
 
393
-            $conditions[] = ' t.' . $quotedColumnName . ' = ' . 'te.' . $quotedReferencedColumnName;
393
+            $conditions[] = ' t.'.$quotedColumnName.' = '.'te.'.$quotedReferencedColumnName;
394 394
         }
395 395
 
396 396
         return $conditions;
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
             $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName());
413 413
         }
414 414
 
415
-        return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
415
+        return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?';
416 416
     }
417 417
 
418 418
     /**
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
         $sourceClass       = $this->em->getClassMetadata($owningAssociation->getSourceEntity());
604 604
         $targetClass       = $this->em->getClassMetadata($owningAssociation->getTargetEntity());
605 605
 
606
-        if (! $owningAssociation->isOwningSide()) {
606
+        if ( ! $owningAssociation->isOwningSide()) {
607 607
             $owningAssociation  = $targetClass->getProperty($owningAssociation->getMappedBy());
608 608
             $joinTable          = $owningAssociation->getJoinTable();
609 609
             $joinColumns        = $joinTable->getJoinColumns();
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
         }
616 616
 
617 617
         $joinTableName   = $joinTable->getQuotedQualifiedName($this->platform);
618
-        $quotedJoinTable = $joinTableName . ' t';
618
+        $quotedJoinTable = $joinTableName.' t';
619 619
         $whereClauses    = [];
620 620
         $params          = [];
621 621
         $types           = [];
@@ -628,39 +628,39 @@  discard block
 block discarded – undo
628 628
                 $quotedColumnName           = $this->platform->quoteIdentifier($joinColumn->getColumnName());
629 629
                 $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName());
630 630
 
631
-                $joinConditions[] = ' t.' . $quotedColumnName . ' = ' . 'tr.' . $quotedReferencedColumnName;
631
+                $joinConditions[] = ' t.'.$quotedColumnName.' = '.'tr.'.$quotedReferencedColumnName;
632 632
             }
633 633
 
634 634
             $tableName        = $targetClass->table->getQuotedQualifiedName($this->platform);
635
-            $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions);
635
+            $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions);
636 636
             $columnName       = $targetClass->getProperty($indexBy)->getColumnName();
637 637
 
638
-            $whereClauses[] = 'tr.' . $this->platform->quoteIdentifier($columnName) . ' = ?';
638
+            $whereClauses[] = 'tr.'.$this->platform->quoteIdentifier($columnName).' = ?';
639 639
             $params[]       = $key;
640 640
             $types[]        = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em);
641 641
         }
642 642
 
643 643
         foreach ($inverseJoinColumns as $joinColumn) {
644
-            if (! $joinColumn->getType()) {
644
+            if ( ! $joinColumn->getType()) {
645 645
                 $joinColumn->setType(
646 646
                     PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $sourceClass, $this->em)
647 647
                 );
648 648
             }
649 649
 
650
-            $whereClauses[] = 't.' . $this->platform->quoteIdentifier($joinColumn->getColumnName()) . ' = ?';
650
+            $whereClauses[] = 't.'.$this->platform->quoteIdentifier($joinColumn->getColumnName()).' = ?';
651 651
             $params[]       = $id[$sourceClass->fieldNames[$joinColumn->getReferencedColumnName()]];
652 652
             $types[]        = $joinColumn->getType();
653 653
         }
654 654
 
655 655
         if ( ! $joinNeeded) {
656 656
             foreach ($joinColumns as $joinColumn) {
657
-                if (! $joinColumn->getType()) {
657
+                if ( ! $joinColumn->getType()) {
658 658
                     $joinColumn->setType(
659 659
                         PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em)
660 660
                     );
661 661
                 }
662 662
 
663
-                $whereClauses[] = 't.' . $this->platform->quoteIdentifier($joinColumn->getColumnName()) . ' = ?';
663
+                $whereClauses[] = 't.'.$this->platform->quoteIdentifier($joinColumn->getColumnName()).' = ?';
664 664
                 $params[]       = $key;
665 665
                 $types[]        = $joinColumn->getType();
666 666
             }
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association);
671 671
 
672 672
             if ($filterSql) {
673
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
673
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
674 674
                 $whereClauses[] = $filterSql;
675 675
             }
676 676
         }
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
         $association       = $collection->getMapping();
695 695
         $owningAssociation = $association;
696 696
 
697
-        if (! $association->isOwningSide()) {
697
+        if ( ! $association->isOwningSide()) {
698 698
             $sourceClass = $this->em->getClassMetadata($association->getTargetEntity());
699 699
             $targetClass = $this->em->getClassMetadata($association->getSourceEntity());
700 700
             $sourceId = $this->uow->getEntityIdentifier($element);
@@ -719,13 +719,13 @@  discard block
 block discarded – undo
719 719
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
720 720
             $referencedColumnName = $joinColumn->getReferencedColumnName();
721 721
 
722
-            if (! $joinColumn->getType()) {
722
+            if ( ! $joinColumn->getType()) {
723 723
                 $joinColumn->setType(
724 724
                     PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em)
725 725
                 );
726 726
             }
727 727
 
728
-            $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?';
728
+            $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?';
729 729
             $params[]       = $sourceId[$sourceClass->fieldNames[$referencedColumnName]];
730 730
             $types[]        = $joinColumn->getType();
731 731
         }
@@ -734,13 +734,13 @@  discard block
 block discarded – undo
734 734
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
735 735
             $referencedColumnName = $joinColumn->getReferencedColumnName();
736 736
 
737
-            if (! $joinColumn->getType()) {
737
+            if ( ! $joinColumn->getType()) {
738 738
                 $joinColumn->setType(
739 739
                     PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)
740 740
                 );
741 741
             }
742 742
 
743
-            $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?';
743
+            $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?';
744 744
             $params[]       = $targetId[$targetClass->fieldNames[$referencedColumnName]];
745 745
             $types[]        = $joinColumn->getType();
746 746
         }
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association);
752 752
 
753 753
             if ($filterSql) {
754
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
754
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
755 755
                 $whereClauses[] = $filterSql;
756 756
             }
757 757
         }
@@ -800,10 +800,10 @@  discard block
 block discarded – undo
800 800
                 $property   = $targetClass->getProperty($name);
801 801
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
802 802
 
803
-                $orderBy[] = $columnName . ' ' . $direction;
803
+                $orderBy[] = $columnName.' '.$direction;
804 804
             }
805 805
 
806
-            return ' ORDER BY ' . implode(', ', $orderBy);
806
+            return ' ORDER BY '.implode(', ', $orderBy);
807 807
         }
808 808
         return '';
809 809
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/OneToManyPersister.php 3 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,6 @@
 block discarded – undo
22 22
 namespace Doctrine\ORM\Persisters\Collection;
23 23
 
24 24
 use Doctrine\Common\Collections\Criteria;
25
-use Doctrine\ORM\Mapping\ColumnMetadata;
26 25
 use Doctrine\ORM\Mapping\InheritanceType;
27 26
 use Doctrine\ORM\Mapping\ToManyAssociationMetadata;
28 27
 use Doctrine\ORM\PersistentCollection;
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -145,9 +145,9 @@  discard block
 block discarded – undo
145 145
         return (bool) $persister->count($criteria);
146 146
     }
147 147
 
148
-     /**
149
-     * {@inheritdoc}
150
-     */
148
+        /**
149
+         * {@inheritdoc}
150
+         */
151 151
     public function contains(PersistentCollection $collection, $element)
152 152
     {
153 153
         if ( ! $this->isValidEntityState($element)) {
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
         // 2) Build insert table records into temporary table
267 267
         $dql   = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames())
268
-               . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner';
268
+                . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner';
269 269
         $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner());
270 270
 
271 271
         $statement  = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL();
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 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\Collection;
6 6
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         // the entire collection with a new would trigger this operation.
31 31
         $association = $collection->getMapping();
32 32
 
33
-        if (! $association->isOrphanRemoval()) {
33
+        if ( ! $association->isOrphanRemoval()) {
34 34
             // Handling non-orphan removal should never happen, as @OneToMany
35 35
             // can only be inverse side. For owning side one to many, it is
36 36
             // required to have a join table, which would classify as a ManyToManyPersister.
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     {
63 63
         $association = $collection->getMapping();
64 64
 
65
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
65
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
66 66
             throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections.");
67 67
         }
68 68
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
     {
112 112
         $association = $collection->getMapping();
113 113
 
114
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
114
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
115 115
             throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections.");
116 116
         }
117 117
 
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         // only works with single id identifier entities. Will throw an
121 121
         // exception in Entity Persisters if that is not the case for the
122 122
         // 'mappedBy' field.
123
-        $criteria  = [
123
+        $criteria = [
124 124
             $association->getMappedBy()  => $collection->getOwner(),
125 125
             $association->getIndexedBy() => $key,
126 126
         ];
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
     {
158 158
         $association = $collection->getMapping();
159 159
 
160
-        if (! $association->isOrphanRemoval()) {
160
+        if ( ! $association->isOrphanRemoval()) {
161 161
             // no-op: this is not the owning side, therefore no operations should be applied
162 162
             return false;
163 163
         }
164 164
 
165
-        if (! $this->isValidEntityState($element)) {
165
+        if ( ! $this->isValidEntityState($element)) {
166 166
             return false;
167 167
         }
168 168
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         }
203 203
 
204 204
         $tableName = $targetClass->table->getQuotedQualifiedName($this->platform);
205
-        $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
205
+        $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?';
206 206
 
207 207
         return $this->conn->executeUpdate($statement, $parameters);
208 208
     }
@@ -241,17 +241,17 @@  discard block
 block discarded – undo
241 241
             ];
242 242
         }
243 243
 
244
-        $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable
245
-            . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')';
244
+        $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable
245
+            . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')';
246 246
 
247 247
         $this->conn->executeUpdate($statement);
248 248
 
249 249
         // 2) Build insert table records into temporary table
250
-        $dql   = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames())
251
-               . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner';
250
+        $dql   = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames())
251
+               . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner';
252 252
         $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner());
253 253
 
254
-        $statement  = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL();
254
+        $statement  = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL();
255 255
         $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner()));
256 256
         $numDeleted = $this->conn->executeUpdate($statement, $parameters);
257 257
 
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
         foreach (array_reverse($classNames) as $className) {
266 266
             $parentClass = $this->em->getClassMetadata($className);
267 267
             $tableName   = $parentClass->table->getQuotedQualifiedName($this->platform);
268
-            $statement   = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnNameList . ')'
269
-                . ' IN (SELECT ' . $idColumnNameList . ' FROM ' . $tempTable . ')';
268
+            $statement   = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnNameList.')'
269
+                . ' IN (SELECT '.$idColumnNameList.' FROM '.$tempTable.')';
270 270
 
271 271
             $this->conn->executeUpdate($statement);
272 272
         }
Please login to merge, or discard this patch.