Completed
Push — master ( 23a060...e747f7 )
by Luís
45s queued 37s
created
tests/Doctrine/Performance/Query/QueryBoundParameterProcessingBench.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,8 @@
 block discarded – undo
57 57
         $this->parsedQueryWithDeclaredParameterType = $entityManager->createQuery($dql);
58 58
 
59 59
         foreach (range(1, 10) as $index) {
60
-            $this->parsedQueryWithInferredParameterType->setParameter('parameter' . $index, new DateTime());
61
-            $this->parsedQueryWithDeclaredParameterType->setParameter('parameter' . $index, new DateTime(), DateTimeType::DATETIME);
60
+            $this->parsedQueryWithInferredParameterType->setParameter('parameter'.$index, new DateTime());
61
+            $this->parsedQueryWithDeclaredParameterType->setParameter('parameter'.$index, new DateTime(), DateTimeType::DATETIME);
62 62
         }
63 63
 
64 64
         // Force parsing upfront - we don't benchmark that bit in this scenario
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.
tests/Doctrine/Performance/EntityManagerFactory.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,13 +23,13 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $config = new Configuration();
25 25
 
26
-        $config->setProxyDir(__DIR__ . '/../Tests/Proxies');
26
+        $config->setProxyDir(__DIR__.'/../Tests/Proxies');
27 27
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
28 28
         $config->setAutoGenerateProxyClasses(StaticProxyFactory::AUTOGENERATE_EVAL);
29 29
         $config->setMetadataDriverImpl(
30 30
             $config->newDefaultAnnotationDriver([
31
-                realpath(__DIR__ . '/Models/Cache'),
32
-                realpath(__DIR__ . '/Models/GeoNames'),
31
+                realpath(__DIR__.'/Models/Cache'),
32
+                realpath(__DIR__.'/Models/GeoNames'),
33 33
             ])
34 34
         );
35 35
 
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
     {
52 52
         $config = new Configuration();
53 53
 
54
-        $config->setProxyDir(__DIR__ . '/../Tests/Proxies');
54
+        $config->setProxyDir(__DIR__.'/../Tests/Proxies');
55 55
         $config->setProxyNamespace('Doctrine\Tests\Proxies');
56 56
         $config->setAutoGenerateProxyClasses(ProxyFactory::AUTOGENERATE_EVAL);
57 57
         $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver([
58
-            realpath(__DIR__ . '/Models/Cache'),
59
-            realpath(__DIR__ . '/Models/Generic'),
60
-            realpath(__DIR__ . '/Models/GeoNames'),
58
+            realpath(__DIR__.'/Models/Cache'),
59
+            realpath(__DIR__.'/Models/Generic'),
60
+            realpath(__DIR__.'/Models/GeoNames'),
61 61
         ], true));
62 62
 
63 63
         // A connection that doesn't really do anything
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Query/QueryTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
      */
338 338
     public function testGetParameterTypeJuggling() : void
339 339
     {
340
-        $query = $this->em->createQuery('select u from ' . CmsUser::class . ' u where u.id = ?0');
340
+        $query = $this->em->createQuery('select u from '.CmsUser::class.' u where u.id = ?0');
341 341
 
342 342
         $query->setParameter(0, 0);
343 343
 
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
      */
352 352
     public function testSetParameterWithNameZeroIsNotOverridden() : void
353 353
     {
354
-        $query = $this->em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name');
354
+        $query = $this->em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name');
355 355
 
356 356
         $query->setParameter(0, 0);
357 357
         $query->setParameter('name', 'Doctrine');
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      */
367 367
     public function testSetParameterWithNameZeroDoesNotOverrideAnotherParameter() : void
368 368
     {
369
-        $query = $this->em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name');
369
+        $query = $this->em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name');
370 370
 
371 371
         $query->setParameter('name', 'Doctrine');
372 372
         $query->setParameter(0, 0);
@@ -381,7 +381,7 @@  discard block
 block discarded – undo
381 381
      */
382 382
     public function testSetParameterWithTypeJugglingWorks() : void
383 383
     {
384
-        $query = $this->em->createQuery('select u from ' . CmsUser::class . ' u where u.id != ?0 and u.username = :name');
384
+        $query = $this->em->createQuery('select u from '.CmsUser::class.' u where u.id != ?0 and u.username = :name');
385 385
 
386 386
         $query->setParameter('0', 1);
387 387
         $query->setParameter('name', 'Doctrine');
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
     {
402 402
         $this->em->getConfiguration()->setResultCacheImpl(new ArrayCache());
403 403
 
404
-        $query = $this->em->createQuery('SELECT u FROM ' . CmsUser::class . ' u');
404
+        $query = $this->em->createQuery('SELECT u FROM '.CmsUser::class.' u');
405 405
         $query->useResultCache(true);
406 406
         $query->setResultCacheProfile();
407 407
 
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
             ->expects(self::never())
420 420
             ->method('getSingleIdentifierValue');
421 421
 
422
-        $query = $this->em->createQuery('SELECT d FROM ' . DateTimeModel::class . ' d WHERE d.datetime = :value');
422
+        $query = $this->em->createQuery('SELECT d FROM '.DateTimeModel::class.' d WHERE d.datetime = :value');
423 423
 
424 424
         $query->setParameter('value', new DateTime(), Type::DATETIME);
425 425
 
Please login to merge, or discard this patch.