Passed
Pull Request — master (#7747)
by Javier
09:24
created
lib/Doctrine/ORM/Mapping/Exporter/TransientMetadataExporter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
     {
20 20
         /** @var TransientMetadata $value */
21 21
         $indentation     = str_repeat(self::INDENTATION, $indentationLevel);
22
-        $objectReference = $indentation . self::VARIABLE;
22
+        $objectReference = $indentation.self::VARIABLE;
23 23
 
24
-        return $objectReference . ' = ' . $this->exportInstantiation($value);
24
+        return $objectReference.' = '.$this->exportInstantiation($value);
25 25
     }
26 26
 
27 27
     protected function exportInstantiation(TransientMetadata $metadata) : string
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/Exporter/CacheMetadataExporter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@
 block discarded – undo
22 22
     {
23 23
         /** @var CacheMetadata $value */
24 24
         $indentation     = str_repeat(self::INDENTATION, $indentationLevel);
25
-        $objectReference = $indentation . self::VARIABLE;
25
+        $objectReference = $indentation.self::VARIABLE;
26 26
         $lines           = [];
27 27
 
28
-        $lines[] = $objectReference . ' = ' . $this->exportInstantiation($value);
28
+        $lines[] = $objectReference.' = '.$this->exportInstantiation($value);
29 29
 
30 30
         return implode(PHP_EOL, $lines);
31 31
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $classMetadata = $this->em->getClassMetadata($class);
123 123
         $platform      = $this->em->getConnection()->getDatabasePlatform();
124 124
 
125
-        if (! $this->isInheritanceSupported($classMetadata)) {
125
+        if ( ! $this->isInheritanceSupported($classMetadata)) {
126 126
             throw new InvalidArgumentException(
127 127
                 'ResultSetMapping builder does not currently support your inheritance scheme.'
128 128
             );
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                             );
163 163
                         }
164 164
 
165
-                        if (! $joinColumn->getType()) {
165
+                        if ( ! $joinColumn->getType()) {
166 166
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
167 167
                         }
168 168
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
     {
202 202
         switch ($mode) {
203 203
             case self::COLUMN_RENAMING_INCREMENT:
204
-                return $columnName . $this->sqlCounter++;
204
+                return $columnName.$this->sqlCounter++;
205 205
             case self::COLUMN_RENAMING_CUSTOM:
206 206
                 return $customRenameColumns[$columnName] ?? $columnName;
207 207
             case self::COLUMN_RENAMING_NONE:
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                 $sql .= ', ';
231 231
             }
232 232
 
233
-            $sql .= $tableAlias . '.';
233
+            $sql .= $tableAlias.'.';
234 234
 
235 235
             if (isset($this->fieldMappings[$columnName])) {
236 236
                 $class = $this->em->getClassMetadata($this->declaringClasses[$columnName]);
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                 $sql .= $this->discriminatorColumns[$dqlAlias];
243 243
             }
244 244
 
245
-            $sql .= ' AS ' . $columnName;
245
+            $sql .= ' AS '.$columnName;
246 246
         }
247 247
 
248 248
         return $sql;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/QueryExpressionVisitor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             case CompositeExpression::TYPE_OR:
95 95
                 return new Expr\Orx($expressionList);
96 96
             default:
97
-                throw new RuntimeException('Unknown composite ' . $expr->getType());
97
+                throw new RuntimeException('Unknown composite '.$expr->getType());
98 98
         }
99 99
     }
100 100
 
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
      */
104 104
     public function walkComparison(Comparison $comparison)
105 105
     {
106
-        if (! isset($this->queryAliases[0])) {
106
+        if ( ! isset($this->queryAliases[0])) {
107 107
             throw new QueryException('No aliases are set before invoking walkComparison().');
108 108
         }
109 109
 
110
-        $field = $this->queryAliases[0] . '.' . $comparison->getField();
110
+        $field = $this->queryAliases[0].'.'.$comparison->getField();
111 111
 
112 112
         foreach ($this->queryAliases as $alias) {
113
-            if (strpos($comparison->getField() . '.', $alias . '.') === 0) {
113
+            if (strpos($comparison->getField().'.', $alias.'.') === 0) {
114 114
                 $field = $comparison->getField();
115 115
                 break;
116 116
             }
@@ -121,13 +121,13 @@  discard block
 block discarded – undo
121 121
 
122 122
         foreach ($this->parameters as $parameter) {
123 123
             if ($parameter->getName() === $parameterName) {
124
-                $parameterName .= '_' . $parameterCount;
124
+                $parameterName .= '_'.$parameterCount;
125 125
                 break;
126 126
             }
127 127
         }
128 128
 
129 129
         $parameter   = new Parameter($parameterName, $this->walkValue($comparison->getValue()));
130
-        $placeholder = ':' . $parameterName;
130
+        $placeholder = ':'.$parameterName;
131 131
 
132 132
         switch ($comparison->getOperator()) {
133 133
             case Comparison::IN:
@@ -154,17 +154,17 @@  discard block
 block discarded – undo
154 154
 
155 155
                 return $this->expr->neq($field, $placeholder);
156 156
             case Comparison::CONTAINS:
157
-                $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType());
157
+                $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType());
158 158
                 $this->parameters[] = $parameter;
159 159
 
160 160
                 return $this->expr->like($field, $placeholder);
161 161
             case Comparison::STARTS_WITH:
162
-                $parameter->setValue($parameter->getValue() . '%', $parameter->getType());
162
+                $parameter->setValue($parameter->getValue().'%', $parameter->getType());
163 163
                 $this->parameters[] = $parameter;
164 164
 
165 165
                 return $this->expr->like($field, $placeholder);
166 166
             case Comparison::ENDS_WITH:
167
-                $parameter->setValue('%' . $parameter->getValue(), $parameter->getType());
167
+                $parameter->setValue('%'.$parameter->getValue(), $parameter->getType());
168 168
                 $this->parameters[] = $parameter;
169 169
 
170 170
                 return $this->expr->like($field, $placeholder);
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                     );
181 181
                 }
182 182
 
183
-                throw new RuntimeException('Unknown comparison operator: ' . $comparison->getOperator());
183
+                throw new RuntimeException('Unknown comparison operator: '.$comparison->getOperator());
184 184
         }
185 185
     }
186 186
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Reflection/StaticReflectionService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
     public function getClassShortName(string $className) : string
31 31
     {
32 32
         if (strpos($className, '\\') !== false) {
33
-            $className = substr($className, strrpos($className, '\\')+1);
33
+            $className = substr($className, strrpos($className, '\\') + 1);
34 34
         }
35 35
 
36 36
         return $className;
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $namespace = '';
45 45
 
46 46
         if (strpos($className, '\\') !== false) {
47
-            $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\')+1));
47
+            $namespace = strrev(substr(strrev($className), strpos(strrev($className), '\\') + 1));
48 48
         }
49 49
 
50 50
         return $namespace;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/UnitOfWork.php 1 patch
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 
341 341
         $this->computeChangeSets();
342 342
 
343
-        if (! ($this->entityInsertions ||
343
+        if ( ! ($this->entityInsertions ||
344 344
                 $this->entityDeletions ||
345 345
                 $this->entityUpdates ||
346 346
                 $this->collectionUpdates ||
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             // Entity deletions come last and need to be in reverse commit order
402 402
             if ($this->entityDeletions) {
403 403
                 foreach (array_reverse($commitOrder) as $committedEntityName) {
404
-                    if (! $this->entityDeletions) {
404
+                    if ( ! $this->entityDeletions) {
405 405
                         break; // just a performance optimisation
406 406
                     }
407 407
 
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         $oid  = spl_object_id($entity);
486 486
         $data = [];
487 487
 
488
-        if (! isset($this->entityChangeSets[$oid])) {
488
+        if ( ! isset($this->entityChangeSets[$oid])) {
489 489
             return $data;
490 490
         }
491 491
 
@@ -565,12 +565,12 @@  discard block
 block discarded – undo
565 565
                     || ! $class->getProperty($name) instanceof FieldMetadata
566 566
                     || ! $class->getProperty($name)->hasValueGenerator()
567 567
                     || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY
568
-                ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
568
+                ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
569 569
                 $actualData[$name] = $value;
570 570
             }
571 571
         }
572 572
 
573
-        if (! isset($this->originalEntityData[$oid])) {
573
+        if ( ! isset($this->originalEntityData[$oid])) {
574 574
             // Entity is either NEW or MANAGED but not yet fully persisted (only has an id).
575 575
             // These result in an INSERT.
576 576
             $this->originalEntityData[$oid] = $actualData;
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 
598 598
             foreach ($actualData as $propName => $actualValue) {
599 599
                 // skip field, its a partially omitted one!
600
-                if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) {
600
+                if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) {
601 601
                     continue;
602 602
                 }
603 603
 
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
                     if ($owner === null) { // cloned
620 620
                         $actualValue->setOwner($entity, $property);
621 621
                     } elseif ($owner !== $entity) { // no clone, we have to fix
622
-                        if (! $actualValue->isInitialized()) {
622
+                        if ( ! $actualValue->isInitialized()) {
623 623
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
624 624
                         }
625 625
 
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                         // Check if original value exists
658 658
                         if ($orgValue instanceof PersistentCollection) {
659 659
                             // A PersistentCollection was de-referenced, so delete it.
660
-                            if (! $this->isCollectionScheduledForDeletion($orgValue)) {
660
+                            if ( ! $this->isCollectionScheduledForDeletion($orgValue)) {
661 661
                                 $this->scheduleCollectionDeletion($orgValue);
662 662
 
663 663
                                 $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored
@@ -680,7 +680,7 @@  discard block
 block discarded – undo
680 680
 
681 681
         // Look for changes in associations of the entity
682 682
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
683
-            if (! $property instanceof AssociationMetadata) {
683
+            if ( ! $property instanceof AssociationMetadata) {
684 684
                 continue;
685 685
             }
686 686
 
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
                 // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here.
748 748
                 $oid = spl_object_id($entity);
749 749
 
750
-                if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) {
750
+                if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) {
751 751
                     $this->computeChangeSet($class, $entity);
752 752
                 }
753 753
             }
@@ -784,13 +784,13 @@  discard block
 block discarded – undo
784 784
         $targetClass    = $this->em->getClassMetadata($targetEntity);
785 785
 
786 786
         foreach ($unwrappedValue as $key => $entry) {
787
-            if (! ($entry instanceof $targetEntity)) {
787
+            if ( ! ($entry instanceof $targetEntity)) {
788 788
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry);
789 789
             }
790 790
 
791 791
             $state = $this->getEntityState($entry, self::STATE_NEW);
792 792
 
793
-            if (! ($entry instanceof $targetEntity)) {
793
+            if ( ! ($entry instanceof $targetEntity)) {
794 794
                 throw UnexpectedAssociationValue::create(
795 795
                     $association->getSourceEntity(),
796 796
                     $association->getName(),
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 
802 802
             switch ($state) {
803 803
                 case self::STATE_NEW:
804
-                    if (! in_array('persist', $association->getCascade(), true)) {
804
+                    if ( ! in_array('persist', $association->getCascade(), true)) {
805 805
                         $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry];
806 806
 
807 807
                         break;
@@ -850,12 +850,12 @@  discard block
 block discarded – undo
850 850
         $persister      = $this->getEntityPersister($class->getClassName());
851 851
         $generationPlan->executeImmediate($this->em, $entity);
852 852
 
853
-        if (! $generationPlan->containsDeferred()) {
853
+        if ( ! $generationPlan->containsDeferred()) {
854 854
             $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity));
855 855
 
856 856
             // Some identifiers may be foreign keys to new entities.
857 857
             // In this case, we don't have the value yet and should treat it as if we have a post-insert generator
858
-            if (! $this->hasMissingIdsWhichAreForeignKeys($class, $id)) {
858
+            if ( ! $this->hasMissingIdsWhichAreForeignKeys($class, $id)) {
859 859
                 $this->entityIdentifiers[$oid] = $id;
860 860
             }
861 861
         }
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
     {
901 901
         $oid = spl_object_id($entity);
902 902
 
903
-        if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
903
+        if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
904 904
             throw ORMInvalidArgumentException::entityNotManaged($entity);
905 905
         }
906 906
 
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
                     break;
923 923
 
924 924
                 case $property instanceof FieldMetadata:
925
-                    if (! $property->isPrimaryKey()
925
+                    if ( ! $property->isPrimaryKey()
926 926
                         || ! $property->getValueGenerator()
927 927
                         || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) {
928 928
                         $actualData[$name] = $property->getValue($entity);
@@ -936,7 +936,7 @@  discard block
 block discarded – undo
936 936
             }
937 937
         }
938 938
 
939
-        if (! isset($this->originalEntityData[$oid])) {
939
+        if ( ! isset($this->originalEntityData[$oid])) {
940 940
             throw new RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.');
941 941
         }
942 942
 
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
         if ($changeSet) {
955 955
             if (isset($this->entityChangeSets[$oid])) {
956 956
                 $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet);
957
-            } elseif (! isset($this->entityInsertions[$oid])) {
957
+            } elseif ( ! isset($this->entityInsertions[$oid])) {
958 958
                 $this->entityChangeSets[$oid] = $changeSet;
959 959
                 $this->entityUpdates[$oid]    = $entity;
960 960
             }
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
                 $this->recomputeSingleEntityChangeSet($class, $entity);
1051 1051
             }
1052 1052
 
1053
-            if (! empty($this->entityChangeSets[$oid])) {
1053
+            if ( ! empty($this->entityChangeSets[$oid])) {
1054 1054
                 $persister->update($entity);
1055 1055
             }
1056 1056
 
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 
1090 1090
             // Entity with this $oid after deletion treated as NEW, even if the $oid
1091 1091
             // is obtained by a new entity because the old one went out of scope.
1092
-            if (! $class->isIdentifierComposite()) {
1092
+            if ( ! $class->isIdentifierComposite()) {
1093 1093
                 $property = $class->getProperty($class->getSingleIdentifierFieldName());
1094 1094
 
1095 1095
                 if ($property instanceof FieldMetadata && $property->hasValueGenerator()) {
@@ -1136,13 +1136,13 @@  discard block
 block discarded – undo
1136 1136
         // Calculate dependencies for new nodes
1137 1137
         while ($class = array_pop($newNodes)) {
1138 1138
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
1139
-                if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1139
+                if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1140 1140
                     continue;
1141 1141
                 }
1142 1142
 
1143 1143
                 $targetClass = $this->em->getClassMetadata($property->getTargetEntity());
1144 1144
 
1145
-                if (! $calc->hasNode($targetClass->getClassName())) {
1145
+                if ( ! $calc->hasNode($targetClass->getClassName())) {
1146 1146
                     $calc->addNode($targetClass->getClassName(), $targetClass);
1147 1147
 
1148 1148
                     $newNodes[] = $targetClass;
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 
1151 1151
                 $weight = ! array_filter(
1152 1152
                     $property->getJoinColumns(),
1153
-                    static function (JoinColumnMetadata $joinColumn) {
1153
+                    static function(JoinColumnMetadata $joinColumn) {
1154 1154
                         return $joinColumn->isNullable();
1155 1155
                     }
1156 1156
                 );
@@ -1158,14 +1158,14 @@  discard block
 block discarded – undo
1158 1158
                 $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight);
1159 1159
 
1160 1160
                 // If the target class has mapped subclasses, these share the same dependency.
1161
-                if (! $targetClass->getSubClasses()) {
1161
+                if ( ! $targetClass->getSubClasses()) {
1162 1162
                     continue;
1163 1163
                 }
1164 1164
 
1165 1165
                 foreach ($targetClass->getSubClasses() as $subClassName) {
1166 1166
                     $targetSubClass = $this->em->getClassMetadata($subClassName);
1167 1167
 
1168
-                    if (! $calc->hasNode($subClassName)) {
1168
+                    if ( ! $calc->hasNode($subClassName)) {
1169 1169
                         $calc->addNode($targetSubClass->getClassName(), $targetSubClass);
1170 1170
 
1171 1171
                         $newNodes[] = $targetSubClass;
@@ -1241,7 +1241,7 @@  discard block
 block discarded – undo
1241 1241
     {
1242 1242
         $oid = spl_object_id($entity);
1243 1243
 
1244
-        if (! isset($this->entityIdentifiers[$oid])) {
1244
+        if ( ! isset($this->entityIdentifiers[$oid])) {
1245 1245
             throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update');
1246 1246
         }
1247 1247
 
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
             throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update');
1250 1250
         }
1251 1251
 
1252
-        if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
1252
+        if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) {
1253 1253
             $this->entityUpdates[$oid] = $entity;
1254 1254
         }
1255 1255
     }
@@ -1324,7 +1324,7 @@  discard block
 block discarded – undo
1324 1324
             return; // entity has not been persisted yet, so nothing more to do.
1325 1325
         }
1326 1326
 
1327
-        if (! $this->isInIdentityMap($entity)) {
1327
+        if ( ! $this->isInIdentityMap($entity)) {
1328 1328
             return;
1329 1329
         }
1330 1330
 
@@ -1332,7 +1332,7 @@  discard block
 block discarded – undo
1332 1332
 
1333 1333
         unset($this->entityUpdates[$oid]);
1334 1334
 
1335
-        if (! isset($this->entityDeletions[$oid])) {
1335
+        if ( ! isset($this->entityDeletions[$oid])) {
1336 1336
             $this->entityDeletions[$oid] = $entity;
1337 1337
             $this->entityStates[$oid]    = self::STATE_REMOVED;
1338 1338
         }
@@ -1434,7 +1434,7 @@  discard block
 block discarded – undo
1434 1434
         $persister = $this->getEntityPersister($class->getClassName());
1435 1435
         $id        = $persister->getIdentifier($entity);
1436 1436
 
1437
-        if (! $id) {
1437
+        if ( ! $id) {
1438 1438
             return self::STATE_NEW;
1439 1439
         }
1440 1440
 
@@ -1792,7 +1792,7 @@  discard block
 block discarded – undo
1792 1792
         $class = $this->em->getClassMetadata(get_class($entity));
1793 1793
 
1794 1794
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1795
-            if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) {
1795
+            if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) {
1796 1796
                 continue;
1797 1797
             }
1798 1798
 
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
         }
1840 1840
 
1841 1841
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1842
-            if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) {
1842
+            if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) {
1843 1843
                 continue;
1844 1844
             }
1845 1845
 
@@ -1855,7 +1855,7 @@  discard block
 block discarded – undo
1855 1855
 
1856 1856
                 case $relatedEntities instanceof Collection:
1857 1857
                 case is_array($relatedEntities):
1858
-                    if (! ($association instanceof ToManyAssociationMetadata)) {
1858
+                    if ( ! ($association instanceof ToManyAssociationMetadata)) {
1859 1859
                         throw ORMInvalidArgumentException::invalidAssociation(
1860 1860
                             $this->em->getClassMetadata($targetEntity),
1861 1861
                             $association,
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
                     break;
1871 1871
 
1872 1872
                 case $relatedEntities !== null:
1873
-                    if (! $relatedEntities instanceof $targetEntity) {
1873
+                    if ( ! $relatedEntities instanceof $targetEntity) {
1874 1874
                         throw ORMInvalidArgumentException::invalidAssociation(
1875 1875
                             $this->em->getClassMetadata($targetEntity),
1876 1876
                             $association,
@@ -1899,7 +1899,7 @@  discard block
 block discarded – undo
1899 1899
         $class             = $this->em->getClassMetadata(get_class($entity));
1900 1900
 
1901 1901
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
1902
-            if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) {
1902
+            if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) {
1903 1903
                 continue;
1904 1904
             }
1905 1905
 
@@ -1958,7 +1958,7 @@  discard block
 block discarded – undo
1958 1958
 
1959 1959
         switch (true) {
1960 1960
             case $lockMode === LockMode::OPTIMISTIC:
1961
-                if (! $class->isVersioned()) {
1961
+                if ( ! $class->isVersioned()) {
1962 1962
                     throw OptimisticLockException::notVersioned($class->getClassName());
1963 1963
                 }
1964 1964
 
@@ -1981,7 +1981,7 @@  discard block
 block discarded – undo
1981 1981
             case $lockMode === LockMode::NONE:
1982 1982
             case $lockMode === LockMode::PESSIMISTIC_READ:
1983 1983
             case $lockMode === LockMode::PESSIMISTIC_WRITE:
1984
-                if (! $this->em->getConnection()->isTransactionActive()) {
1984
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
1985 1985
                     throw TransactionRequiredException::transactionRequired();
1986 1986
                 }
1987 1987
 
@@ -2139,7 +2139,7 @@  discard block
 block discarded – undo
2139 2139
                     $entity->addPropertyChangedListener($this);
2140 2140
                 }
2141 2141
             } else {
2142
-                if (! isset($hints[Query::HINT_REFRESH])
2142
+                if ( ! isset($hints[Query::HINT_REFRESH])
2143 2143
                     || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) {
2144 2144
                     return $entity;
2145 2145
                 }
@@ -2187,7 +2187,7 @@  discard block
 block discarded – undo
2187 2187
         }
2188 2188
 
2189 2189
         foreach ($class->getDeclaredPropertiesIterator() as $field => $association) {
2190
-            if (! ($association instanceof AssociationMetadata)) {
2190
+            if ( ! ($association instanceof AssociationMetadata)) {
2191 2191
                 continue;
2192 2192
             }
2193 2193
 
@@ -2236,7 +2236,7 @@  discard block
 block discarded – undo
2236 2236
                 continue;
2237 2237
             }
2238 2238
 
2239
-            if (! $association->isOwningSide()) {
2239
+            if ( ! $association->isOwningSide()) {
2240 2240
                 // use the given entity association
2241 2241
                 if (isset($data[$field]) && is_object($data[$field]) &&
2242 2242
                     isset($this->entityStates[spl_object_id($data[$field])])) {
@@ -2286,7 +2286,7 @@  discard block
 block discarded – undo
2286 2286
                 $associatedId[$targetField] = $joinColumnValue;
2287 2287
             }
2288 2288
 
2289
-            if (! $associatedId) {
2289
+            if ( ! $associatedId) {
2290 2290
                 // Foreign key is NULL
2291 2291
                 $association->setValue($entity, null);
2292 2292
                 $this->originalEntityData[$oid][$field] = null;
@@ -2295,7 +2295,7 @@  discard block
 block discarded – undo
2295 2295
             }
2296 2296
 
2297 2297
             // @todo guilhermeblanco Can we remove the need of this somehow?
2298
-            if (! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2298
+            if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2299 2299
                 $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode();
2300 2300
             }
2301 2301
 
@@ -2312,7 +2312,7 @@  discard block
 block discarded – undo
2312 2312
                     // If this is an uninitialized proxy, we are deferring eager loads,
2313 2313
                     // this association is marked as eager fetch, and its an uninitialized proxy (wtf!)
2314 2314
                     // then we can append this entity for eager loading!
2315
-                    if (! $targetClass->isIdentifierComposite() &&
2315
+                    if ( ! $targetClass->isIdentifierComposite() &&
2316 2316
                         $newValue instanceof GhostObjectInterface &&
2317 2317
                         isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2318 2318
                         $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER &&
@@ -2395,7 +2395,7 @@  discard block
 block discarded – undo
2395 2395
 
2396 2396
     public function triggerEagerLoads()
2397 2397
     {
2398
-        if (! $this->eagerLoadingEntities) {
2398
+        if ( ! $this->eagerLoadingEntities) {
2399 2399
             return;
2400 2400
         }
2401 2401
 
@@ -2404,7 +2404,7 @@  discard block
 block discarded – undo
2404 2404
         $this->eagerLoadingEntities = [];
2405 2405
 
2406 2406
         foreach ($eagerLoadingEntities as $entityName => $ids) {
2407
-            if (! $ids) {
2407
+            if ( ! $ids) {
2408 2408
                 continue;
2409 2409
             }
2410 2410
 
@@ -2702,7 +2702,7 @@  discard block
 block discarded – undo
2702 2702
     {
2703 2703
         $class = $this->em->getClassMetadata(get_class($entity));
2704 2704
 
2705
-        if (! $class->getProperty($propertyName)) {
2705
+        if ( ! $class->getProperty($propertyName)) {
2706 2706
             return; // ignore non-persistent fields
2707 2707
         }
2708 2708
 
@@ -2711,7 +2711,7 @@  discard block
 block discarded – undo
2711 2711
         // Update changeset and mark entity for synchronization
2712 2712
         $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue];
2713 2713
 
2714
-        if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) {
2714
+        if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) {
2715 2715
             $this->scheduleForSynchronization($entity);
2716 2716
         }
2717 2717
     }
@@ -2793,7 +2793,7 @@  discard block
 block discarded – undo
2793 2793
      */
2794 2794
     private static function objToStr($obj)
2795 2795
     {
2796
-        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj);
2796
+        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj);
2797 2797
     }
2798 2798
 
2799 2799
     /**
@@ -2808,7 +2808,7 @@  discard block
 block discarded – undo
2808 2808
      */
2809 2809
     public function markReadOnly($object)
2810 2810
     {
2811
-        if (! is_object($object) || ! $this->isInIdentityMap($object)) {
2811
+        if ( ! is_object($object) || ! $this->isInIdentityMap($object)) {
2812 2812
             throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object);
2813 2813
         }
2814 2814
 
@@ -2826,7 +2826,7 @@  discard block
 block discarded – undo
2826 2826
      */
2827 2827
     public function isReadOnly($object)
2828 2828
     {
2829
-        if (! is_object($object)) {
2829
+        if ( ! is_object($object)) {
2830 2830
             throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object);
2831 2831
         }
2832 2832
 
@@ -2838,7 +2838,7 @@  discard block
 block discarded – undo
2838 2838
      */
2839 2839
     private function afterTransactionComplete()
2840 2840
     {
2841
-        $this->performCallbackOnCachedPersister(static function (CachedPersister $persister) {
2841
+        $this->performCallbackOnCachedPersister(static function(CachedPersister $persister) {
2842 2842
             $persister->afterTransactionComplete();
2843 2843
         });
2844 2844
     }
@@ -2848,7 +2848,7 @@  discard block
 block discarded – undo
2848 2848
      */
2849 2849
     private function afterTransactionRolledBack()
2850 2850
     {
2851
-        $this->performCallbackOnCachedPersister(static function (CachedPersister $persister) {
2851
+        $this->performCallbackOnCachedPersister(static function(CachedPersister $persister) {
2852 2852
             $persister->afterTransactionRolledBack();
2853 2853
         });
2854 2854
     }
@@ -2858,7 +2858,7 @@  discard block
 block discarded – undo
2858 2858
      */
2859 2859
     private function performCallbackOnCachedPersister(callable $callback)
2860 2860
     {
2861
-        if (! $this->hasCache) {
2861
+        if ( ! $this->hasCache) {
2862 2862
             return;
2863 2863
         }
2864 2864
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/AbstractQuery.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
     public function getParameter($key)
302 302
     {
303 303
         $filteredParameters = $this->parameters->filter(
304
-            static function (Query\Parameter $parameter) use ($key) : bool {
304
+            static function(Query\Parameter $parameter) use ($key) : bool {
305 305
                 $parameterName = $parameter->getName();
306 306
 
307 307
                 return $key === $parameterName || (string) $key === (string) $parameterName;
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
             return $value;
395 395
         }
396 396
 
397
-        if (! is_object($value)) {
397
+        if ( ! is_object($value)) {
398 398
             return $value;
399 399
         }
400 400
 
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
             return null;
726 726
         }
727 727
 
728
-        if (! is_array($result)) {
728
+        if ( ! is_array($result)) {
729 729
             return $result;
730 730
         }
731 731
 
@@ -759,7 +759,7 @@  discard block
 block discarded – undo
759 759
             throw new NoResultException();
760 760
         }
761 761
 
762
-        if (! is_array($result)) {
762
+        if ( ! is_array($result)) {
763 763
             return $result;
764 764
         }
765 765
 
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
             $this->setHydrationMode($hydrationMode);
850 850
         }
851 851
 
852
-        if (! empty($parameters)) {
852
+        if ( ! empty($parameters)) {
853 853
             $this->setParameters($parameters);
854 854
         }
855 855
 
@@ -888,11 +888,11 @@  discard block
 block discarded – undo
888 888
             $this->setHydrationMode($hydrationMode);
889 889
         }
890 890
 
891
-        if (! empty($parameters)) {
891
+        if ( ! empty($parameters)) {
892 892
             $this->setParameters($parameters);
893 893
         }
894 894
 
895
-        $setCacheEntry = static function () {
895
+        $setCacheEntry = static function() {
896 896
         };
897 897
 
898 898
         if ($this->hydrationCacheProfile !== null) {
@@ -906,11 +906,11 @@  discard block
 block discarded – undo
906 906
                 return $result[$realCacheKey];
907 907
             }
908 908
 
909
-            if (! $result) {
909
+            if ( ! $result) {
910 910
                 $result = [];
911 911
             }
912 912
 
913
-            $setCacheEntry = static function ($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) {
913
+            $setCacheEntry = static function($data) use ($cache, $result, $cacheKey, $realCacheKey, $queryCacheProfile) {
914 914
                 $result[$realCacheKey] = $data;
915 915
 
916 916
                 $cache->save($cacheKey, $result, $queryCacheProfile->getLifetime());
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
     {
1073 1073
         $query  = $this->getSQL();
1074 1074
         $hints  = $this->getHints();
1075
-        $params = array_map(function (Parameter $parameter) {
1075
+        $params = array_map(function(Parameter $parameter) {
1076 1076
             $value = $parameter->getValue();
1077 1077
 
1078 1078
             // Small optimization
@@ -1086,6 +1086,6 @@  discard block
 block discarded – undo
1086 1086
 
1087 1087
         ksort($hints);
1088 1088
 
1089
-        return sha1($query . '-' . serialize($params) . '-' . serialize($hints));
1089
+        return sha1($query.'-'.serialize($params).'-'.serialize($hints));
1090 1090
     }
1091 1091
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
         // Check query cache.
234 234
         $queryCache = $this->getQueryCacheDriver();
235
-        if (! ($this->useQueryCache && $queryCache)) {
235
+        if ( ! ($this->useQueryCache && $queryCache)) {
236 236
             $parser = new Parser($this);
237 237
 
238 238
             $this->parserResult = $parser->parse();
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
         foreach ($this->parameters as $parameter) {
368 368
             $key = $parameter->getName();
369 369
 
370
-            if (! isset($paramMappings[$key])) {
370
+            if ( ! isset($paramMappings[$key])) {
371 371
                 throw QueryException::unknownParameter($key);
372 372
             }
373 373
 
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
     public function setLockMode($lockMode)
697 697
     {
698 698
         if (in_array($lockMode, [LockMode::NONE, LockMode::PESSIMISTIC_READ, LockMode::PESSIMISTIC_WRITE], true)) {
699
-            if (! $this->em->getConnection()->isTransactionActive()) {
699
+            if ( ! $this->em->getConnection()->isTransactionActive()) {
700 700
                 throw TransactionRequiredException::transactionRequired();
701 701
             }
702 702
         }
@@ -737,11 +737,11 @@  discard block
 block discarded – undo
737 737
             ->getName();
738 738
 
739 739
         return md5(
740
-            $this->getDQL() . serialize($this->hints) .
741
-            '&platform=' . $platform .
742
-            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') .
743
-            '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults .
744
-            '&hydrationMode=' . $this->hydrationMode . '&types=' . serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT'
740
+            $this->getDQL().serialize($this->hints).
741
+            '&platform='.$platform.
742
+            ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '').
743
+            '&firstResult='.$this->firstResult.'&maxResult='.$this->maxResults.
744
+            '&hydrationMode='.$this->hydrationMode.'&types='.serialize($this->parsedTypes).'DOCTRINE_QUERY_CACHE_SALT'
745 745
         );
746 746
     }
747 747
 
@@ -750,7 +750,7 @@  discard block
 block discarded – undo
750 750
      */
751 751
     protected function getHash()
752 752
     {
753
-        return sha1(parent::getHash() . '-' . $this->firstResult . '-' . $this->maxResults);
753
+        return sha1(parent::getHash().'-'.$this->firstResult.'-'.$this->maxResults);
754 754
     }
755 755
 
756 756
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/AbstractClassMetadataFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
      */
127 127
     public function getAllMetadata() : array
128 128
     {
129
-        if (! $this->initialized) {
129
+        if ( ! $this->initialized) {
130 130
             $this->initialize();
131 131
         }
132 132
 
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 
167 167
         try {
168 168
             if ($this->cacheDriver) {
169
-                $cached = $this->cacheDriver->fetch($entityClassName . $this->cacheSalt);
169
+                $cached = $this->cacheDriver->fetch($entityClassName.$this->cacheSalt);
170 170
 
171 171
                 if ($cached instanceof ClassMetadata) {
172 172
                     $this->loadedMetadata[$entityClassName] = $cached;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                     foreach ($this->loadMetadata($entityClassName, $metadataBuildingContext) as $loadedClass) {
177 177
                         $loadedClassName = $loadedClass->getClassName();
178 178
 
179
-                        $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, null);
179
+                        $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, null);
180 180
                     }
181 181
                 }
182 182
             } else {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         } catch (CommonMappingException $loadingException) {
186 186
             $fallbackMetadataResponse = $this->onNotFoundMetadata($entityClassName, $metadataBuildingContext);
187 187
 
188
-            if (! $fallbackMetadataResponse) {
188
+            if ( ! $fallbackMetadataResponse) {
189 189
                 throw $loadingException;
190 190
             }
191 191
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
      */
222 222
     protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array
223 223
     {
224
-        if (! $this->initialized) {
224
+        if ( ! $this->initialized) {
225 225
             $this->initialize();
226 226
         }
227 227
 
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
      */
258 258
     public function isTransient($className) : bool
259 259
     {
260
-        if (! $this->initialized) {
260
+        if ( ! $this->initialized) {
261 261
             $this->initialize();
262 262
         }
263 263
 
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $parentClasses = [];
282 282
 
283 283
         foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) {
284
-            if (! $this->getDriver()->isTransient($parentClass)) {
284
+            if ( ! $this->getDriver()->isTransient($parentClass)) {
285 285
                 $parentClasses[] = $parentClass;
286 286
             }
287 287
         }
Please login to merge, or discard this patch.