@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM; |
| 6 | 6 | |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | |
| 336 | 336 | $this->computeChangeSets(); |
| 337 | 337 | |
| 338 | - if (! ($this->entityInsertions || |
|
| 338 | + if ( ! ($this->entityInsertions || |
|
| 339 | 339 | $this->entityDeletions || |
| 340 | 340 | $this->entityUpdates || |
| 341 | 341 | $this->collectionUpdates || |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | // Entity deletions come last and need to be in reverse commit order |
| 395 | 395 | if ($this->entityDeletions) { |
| 396 | 396 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 397 | - if (! $this->entityDeletions) { |
|
| 397 | + if ( ! $this->entityDeletions) { |
|
| 398 | 398 | break; // just a performance optimisation |
| 399 | 399 | } |
| 400 | 400 | |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | $oid = spl_object_id($entity); |
| 478 | 478 | $data = []; |
| 479 | 479 | |
| 480 | - if (! isset($this->entityChangeSets[$oid])) { |
|
| 480 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 481 | 481 | return $data; |
| 482 | 482 | } |
| 483 | 483 | |
@@ -558,12 +558,12 @@ discard block |
||
| 558 | 558 | || ! $class->getProperty($name) instanceof FieldMetadata |
| 559 | 559 | || ! $class->getProperty($name)->hasValueGenerator() |
| 560 | 560 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
| 561 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 561 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 562 | 562 | $actualData[$name] = $value; |
| 563 | 563 | } |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 566 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 567 | 567 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
| 568 | 568 | // These result in an INSERT. |
| 569 | 569 | $this->originalEntityData[$oid] = $actualData; |
@@ -590,7 +590,7 @@ discard block |
||
| 590 | 590 | |
| 591 | 591 | foreach ($actualData as $propName => $actualValue) { |
| 592 | 592 | // skip field, its a partially omitted one! |
| 593 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 593 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 594 | 594 | continue; |
| 595 | 595 | } |
| 596 | 596 | |
@@ -612,7 +612,7 @@ discard block |
||
| 612 | 612 | if ($owner === null) { // cloned |
| 613 | 613 | $actualValue->setOwner($entity, $property); |
| 614 | 614 | } elseif ($owner !== $entity) { // no clone, we have to fix |
| 615 | - if (! $actualValue->isInitialized()) { |
|
| 615 | + if ( ! $actualValue->isInitialized()) { |
|
| 616 | 616 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 617 | 617 | } |
| 618 | 618 | |
@@ -650,7 +650,7 @@ discard block |
||
| 650 | 650 | // Check if original value exists |
| 651 | 651 | if ($orgValue instanceof PersistentCollection) { |
| 652 | 652 | // A PersistentCollection was de-referenced, so delete it. |
| 653 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 653 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 654 | 654 | $this->scheduleCollectionDeletion($orgValue); |
| 655 | 655 | |
| 656 | 656 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | |
| 674 | 674 | // Look for changes in associations of the entity |
| 675 | 675 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 676 | - if (! $property instanceof AssociationMetadata) { |
|
| 676 | + if ( ! $property instanceof AssociationMetadata) { |
|
| 677 | 677 | continue; |
| 678 | 678 | } |
| 679 | 679 | |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
| 741 | 741 | $oid = spl_object_id($entity); |
| 742 | 742 | |
| 743 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 743 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 744 | 744 | $this->computeChangeSet($class, $entity); |
| 745 | 745 | } |
| 746 | 746 | } |
@@ -777,13 +777,13 @@ discard block |
||
| 777 | 777 | $targetClass = $this->em->getClassMetadata($targetEntity); |
| 778 | 778 | |
| 779 | 779 | foreach ($unwrappedValue as $key => $entry) { |
| 780 | - if (! ($entry instanceof $targetEntity)) { |
|
| 780 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 781 | 781 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 785 | 785 | |
| 786 | - if (! ($entry instanceof $targetEntity)) { |
|
| 786 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 787 | 787 | throw ORMException::unexpectedAssociationValue( |
| 788 | 788 | $association->getSourceEntity(), |
| 789 | 789 | $association->getName(), |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | |
| 795 | 795 | switch ($state) { |
| 796 | 796 | case self::STATE_NEW: |
| 797 | - if (! in_array('persist', $association->getCascade(), true)) { |
|
| 797 | + if ( ! in_array('persist', $association->getCascade(), true)) { |
|
| 798 | 798 | $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry]; |
| 799 | 799 | |
| 800 | 800 | break; |
@@ -843,7 +843,7 @@ discard block |
||
| 843 | 843 | $persister = $this->getEntityPersister($class->getClassName()); |
| 844 | 844 | $generationPlan->executeImmediate($this->em, $entity); |
| 845 | 845 | |
| 846 | - if (! $generationPlan->containsDeferred()) { |
|
| 846 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 847 | 847 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 848 | 848 | $this->entityIdentifiers[$oid] = $id; |
| 849 | 849 | } |
@@ -874,7 +874,7 @@ discard block |
||
| 874 | 874 | { |
| 875 | 875 | $oid = spl_object_id($entity); |
| 876 | 876 | |
| 877 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 877 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 878 | 878 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
| 879 | 879 | } |
| 880 | 880 | |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | break; |
| 897 | 897 | |
| 898 | 898 | case ($property instanceof FieldMetadata): |
| 899 | - if (! $property->isPrimaryKey() |
|
| 899 | + if ( ! $property->isPrimaryKey() |
|
| 900 | 900 | || ! $property->getValueGenerator() |
| 901 | 901 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 902 | 902 | $actualData[$name] = $property->getValue($entity); |
@@ -910,7 +910,7 @@ discard block |
||
| 910 | 910 | } |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 913 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 914 | 914 | throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
| 915 | 915 | } |
| 916 | 916 | |
@@ -928,7 +928,7 @@ discard block |
||
| 928 | 928 | if ($changeSet) { |
| 929 | 929 | if (isset($this->entityChangeSets[$oid])) { |
| 930 | 930 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
| 931 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
| 931 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
| 932 | 932 | $this->entityChangeSets[$oid] = $changeSet; |
| 933 | 933 | $this->entityUpdates[$oid] = $entity; |
| 934 | 934 | } |
@@ -998,7 +998,7 @@ discard block |
||
| 998 | 998 | $this->recomputeSingleEntityChangeSet($class, $entity); |
| 999 | 999 | } |
| 1000 | 1000 | |
| 1001 | - if (! empty($this->entityChangeSets[$oid])) { |
|
| 1001 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
| 1002 | 1002 | // echo 'Update: '; |
| 1003 | 1003 | // \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3); |
| 1004 | 1004 | |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1042 | 1042 | // is obtained by a new entity because the old one went out of scope. |
| 1043 | 1043 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1044 | - if (! $class->isIdentifierComposite()) { |
|
| 1044 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1045 | 1045 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1046 | 1046 | |
| 1047 | 1047 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1088,13 +1088,13 @@ discard block |
||
| 1088 | 1088 | // Calculate dependencies for new nodes |
| 1089 | 1089 | while ($class = array_pop($newNodes)) { |
| 1090 | 1090 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1091 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1091 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1092 | 1092 | continue; |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | 1095 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 1096 | 1096 | |
| 1097 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
| 1097 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
| 1098 | 1098 | $calc->addNode($targetClass->getClassName(), $targetClass); |
| 1099 | 1099 | |
| 1100 | 1100 | $newNodes[] = $targetClass; |
@@ -1102,7 +1102,7 @@ discard block |
||
| 1102 | 1102 | |
| 1103 | 1103 | $weight = ! array_filter( |
| 1104 | 1104 | $property->getJoinColumns(), |
| 1105 | - function (JoinColumnMetadata $joinColumn) { |
|
| 1105 | + function(JoinColumnMetadata $joinColumn) { |
|
| 1106 | 1106 | return $joinColumn->isNullable(); |
| 1107 | 1107 | } |
| 1108 | 1108 | ); |
@@ -1110,14 +1110,14 @@ discard block |
||
| 1110 | 1110 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
| 1111 | 1111 | |
| 1112 | 1112 | // If the target class has mapped subclasses, these share the same dependency. |
| 1113 | - if (! $targetClass->getSubClasses()) { |
|
| 1113 | + if ( ! $targetClass->getSubClasses()) { |
|
| 1114 | 1114 | continue; |
| 1115 | 1115 | } |
| 1116 | 1116 | |
| 1117 | 1117 | foreach ($targetClass->getSubClasses() as $subClassName) { |
| 1118 | 1118 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
| 1119 | 1119 | |
| 1120 | - if (! $calc->hasNode($subClassName)) { |
|
| 1120 | + if ( ! $calc->hasNode($subClassName)) { |
|
| 1121 | 1121 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
| 1122 | 1122 | |
| 1123 | 1123 | $newNodes[] = $targetSubClass; |
@@ -1193,7 +1193,7 @@ discard block |
||
| 1193 | 1193 | { |
| 1194 | 1194 | $oid = spl_object_id($entity); |
| 1195 | 1195 | |
| 1196 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
| 1196 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
| 1197 | 1197 | throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update'); |
| 1198 | 1198 | } |
| 1199 | 1199 | |
@@ -1201,7 +1201,7 @@ discard block |
||
| 1201 | 1201 | throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update'); |
| 1202 | 1202 | } |
| 1203 | 1203 | |
| 1204 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1204 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1205 | 1205 | $this->entityUpdates[$oid] = $entity; |
| 1206 | 1206 | } |
| 1207 | 1207 | } |
@@ -1277,7 +1277,7 @@ discard block |
||
| 1277 | 1277 | return; // entity has not been persisted yet, so nothing more to do. |
| 1278 | 1278 | } |
| 1279 | 1279 | |
| 1280 | - if (! $this->isInIdentityMap($entity)) { |
|
| 1280 | + if ( ! $this->isInIdentityMap($entity)) { |
|
| 1281 | 1281 | return; |
| 1282 | 1282 | } |
| 1283 | 1283 | |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | |
| 1286 | 1286 | unset($this->entityUpdates[$oid]); |
| 1287 | 1287 | |
| 1288 | - if (! isset($this->entityDeletions[$oid])) { |
|
| 1288 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
| 1289 | 1289 | $this->entityDeletions[$oid] = $entity; |
| 1290 | 1290 | $this->entityStates[$oid] = self::STATE_REMOVED; |
| 1291 | 1291 | } |
@@ -1387,7 +1387,7 @@ discard block |
||
| 1387 | 1387 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1388 | 1388 | $id = $persister->getIdentifier($entity); |
| 1389 | 1389 | |
| 1390 | - if (! $id) { |
|
| 1390 | + if ( ! $id) { |
|
| 1391 | 1391 | return self::STATE_NEW; |
| 1392 | 1392 | } |
| 1393 | 1393 | |
@@ -1747,7 +1747,7 @@ discard block |
||
| 1747 | 1747 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1748 | 1748 | |
| 1749 | 1749 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1750 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1750 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1751 | 1751 | continue; |
| 1752 | 1752 | } |
| 1753 | 1753 | |
@@ -1794,7 +1794,7 @@ discard block |
||
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | 1796 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1797 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1797 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1798 | 1798 | continue; |
| 1799 | 1799 | } |
| 1800 | 1800 | |
@@ -1810,7 +1810,7 @@ discard block |
||
| 1810 | 1810 | |
| 1811 | 1811 | case ($relatedEntities instanceof Collection): |
| 1812 | 1812 | case (is_array($relatedEntities)): |
| 1813 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1813 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1814 | 1814 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1815 | 1815 | $this->em->getClassMetadata($targetEntity), |
| 1816 | 1816 | $association, |
@@ -1825,7 +1825,7 @@ discard block |
||
| 1825 | 1825 | break; |
| 1826 | 1826 | |
| 1827 | 1827 | case ($relatedEntities !== null): |
| 1828 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1828 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1829 | 1829 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1830 | 1830 | $this->em->getClassMetadata($targetEntity), |
| 1831 | 1831 | $association, |
@@ -1854,7 +1854,7 @@ discard block |
||
| 1854 | 1854 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1855 | 1855 | |
| 1856 | 1856 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1857 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1857 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1858 | 1858 | continue; |
| 1859 | 1859 | } |
| 1860 | 1860 | |
@@ -1913,7 +1913,7 @@ discard block |
||
| 1913 | 1913 | |
| 1914 | 1914 | switch (true) { |
| 1915 | 1915 | case $lockMode === LockMode::OPTIMISTIC: |
| 1916 | - if (! $class->isVersioned()) { |
|
| 1916 | + if ( ! $class->isVersioned()) { |
|
| 1917 | 1917 | throw OptimisticLockException::notVersioned($class->getClassName()); |
| 1918 | 1918 | } |
| 1919 | 1919 | |
@@ -1936,7 +1936,7 @@ discard block |
||
| 1936 | 1936 | case $lockMode === LockMode::NONE: |
| 1937 | 1937 | case $lockMode === LockMode::PESSIMISTIC_READ: |
| 1938 | 1938 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
| 1939 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
| 1939 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 1940 | 1940 | throw TransactionRequiredException::transactionRequired(); |
| 1941 | 1941 | } |
| 1942 | 1942 | |
@@ -1993,7 +1993,7 @@ discard block |
||
| 1993 | 1993 | { |
| 1994 | 1994 | // Entities should not be scheduled for orphan removal, |
| 1995 | 1995 | // if they do not exist in the identity map or if they are not about to be inserted. |
| 1996 | - if (!$this->isInIdentityMap($entity) && !$this->isScheduledForInsert($entity)) { |
|
| 1996 | + if ( ! $this->isInIdentityMap($entity) && ! $this->isScheduledForInsert($entity)) { |
|
| 1997 | 1997 | return; |
| 1998 | 1998 | } |
| 1999 | 1999 | |
@@ -2101,7 +2101,7 @@ discard block |
||
| 2101 | 2101 | $entity->addPropertyChangedListener($this); |
| 2102 | 2102 | } |
| 2103 | 2103 | } else { |
| 2104 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
| 2104 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
| 2105 | 2105 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
| 2106 | 2106 | return $entity; |
| 2107 | 2107 | } |
@@ -2149,7 +2149,7 @@ discard block |
||
| 2149 | 2149 | } |
| 2150 | 2150 | |
| 2151 | 2151 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2152 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2152 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2153 | 2153 | continue; |
| 2154 | 2154 | } |
| 2155 | 2155 | |
@@ -2198,7 +2198,7 @@ discard block |
||
| 2198 | 2198 | continue; |
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | - if (! $association->isOwningSide()) { |
|
| 2201 | + if ( ! $association->isOwningSide()) { |
|
| 2202 | 2202 | // use the given entity association |
| 2203 | 2203 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2204 | 2204 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2248,7 +2248,7 @@ discard block |
||
| 2248 | 2248 | $associatedId[$targetField] = $joinColumnValue; |
| 2249 | 2249 | } |
| 2250 | 2250 | |
| 2251 | - if (! $associatedId) { |
|
| 2251 | + if ( ! $associatedId) { |
|
| 2252 | 2252 | // Foreign key is NULL |
| 2253 | 2253 | $association->setValue($entity, null); |
| 2254 | 2254 | $this->originalEntityData[$oid][$field] = null; |
@@ -2257,7 +2257,7 @@ discard block |
||
| 2257 | 2257 | } |
| 2258 | 2258 | |
| 2259 | 2259 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2260 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2260 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2261 | 2261 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2262 | 2262 | } |
| 2263 | 2263 | |
@@ -2274,7 +2274,7 @@ discard block |
||
| 2274 | 2274 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2275 | 2275 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2276 | 2276 | // then we can append this entity for eager loading! |
| 2277 | - if (! $targetClass->isIdentifierComposite() && |
|
| 2277 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2278 | 2278 | $newValue instanceof GhostObjectInterface && |
| 2279 | 2279 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2280 | 2280 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2357,7 +2357,7 @@ discard block |
||
| 2357 | 2357 | |
| 2358 | 2358 | public function triggerEagerLoads() |
| 2359 | 2359 | { |
| 2360 | - if (! $this->eagerLoadingEntities) { |
|
| 2360 | + if ( ! $this->eagerLoadingEntities) { |
|
| 2361 | 2361 | return; |
| 2362 | 2362 | } |
| 2363 | 2363 | |
@@ -2366,7 +2366,7 @@ discard block |
||
| 2366 | 2366 | $this->eagerLoadingEntities = []; |
| 2367 | 2367 | |
| 2368 | 2368 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
| 2369 | - if (! $ids) { |
|
| 2369 | + if ( ! $ids) { |
|
| 2370 | 2370 | continue; |
| 2371 | 2371 | } |
| 2372 | 2372 | |
@@ -2664,7 +2664,7 @@ discard block |
||
| 2664 | 2664 | { |
| 2665 | 2665 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2666 | 2666 | |
| 2667 | - if (! $class->getProperty($propertyName)) { |
|
| 2667 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2668 | 2668 | return; // ignore non-persistent fields |
| 2669 | 2669 | } |
| 2670 | 2670 | |
@@ -2673,7 +2673,7 @@ discard block |
||
| 2673 | 2673 | // Update changeset and mark entity for synchronization |
| 2674 | 2674 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
| 2675 | 2675 | |
| 2676 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2676 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2677 | 2677 | $this->scheduleForSynchronization($entity); |
| 2678 | 2678 | } |
| 2679 | 2679 | } |
@@ -2755,7 +2755,7 @@ discard block |
||
| 2755 | 2755 | */ |
| 2756 | 2756 | private static function objToStr($obj) |
| 2757 | 2757 | { |
| 2758 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
| 2758 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
| 2759 | 2759 | } |
| 2760 | 2760 | |
| 2761 | 2761 | /** |
@@ -2770,7 +2770,7 @@ discard block |
||
| 2770 | 2770 | */ |
| 2771 | 2771 | public function markReadOnly($object) |
| 2772 | 2772 | { |
| 2773 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2773 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2774 | 2774 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
| 2775 | 2775 | } |
| 2776 | 2776 | |
@@ -2788,7 +2788,7 @@ discard block |
||
| 2788 | 2788 | */ |
| 2789 | 2789 | public function isReadOnly($object) |
| 2790 | 2790 | { |
| 2791 | - if (! is_object($object)) { |
|
| 2791 | + if ( ! is_object($object)) { |
|
| 2792 | 2792 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
| 2793 | 2793 | } |
| 2794 | 2794 | |
@@ -2800,7 +2800,7 @@ discard block |
||
| 2800 | 2800 | */ |
| 2801 | 2801 | private function afterTransactionComplete() |
| 2802 | 2802 | { |
| 2803 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2803 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2804 | 2804 | $persister->afterTransactionComplete(); |
| 2805 | 2805 | }); |
| 2806 | 2806 | } |
@@ -2810,7 +2810,7 @@ discard block |
||
| 2810 | 2810 | */ |
| 2811 | 2811 | private function afterTransactionRolledBack() |
| 2812 | 2812 | { |
| 2813 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2813 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2814 | 2814 | $persister->afterTransactionRolledBack(); |
| 2815 | 2815 | }); |
| 2816 | 2816 | } |
@@ -2820,7 +2820,7 @@ discard block |
||
| 2820 | 2820 | */ |
| 2821 | 2821 | private function performCallbackOnCachedPersister(callable $callback) |
| 2822 | 2822 | { |
| 2823 | - if (! $this->hasCache) { |
|
| 2823 | + if ( ! $this->hasCache) { |
|
| 2824 | 2824 | return; |
| 2825 | 2825 | } |
| 2826 | 2826 | |