@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | try { |
| 383 | 383 | // Collection deletions (deletions of complete collections) |
| 384 | 384 | foreach ($this->collectionDeletions as $collectionToDelete) { |
| 385 | - if (! $collectionToDelete instanceof PersistentCollection) { |
|
| 385 | + if ( ! $collectionToDelete instanceof PersistentCollection) { |
|
| 386 | 386 | $this->getCollectionPersister($collectionToDelete->getMapping())->delete($collectionToDelete); |
| 387 | 387 | |
| 388 | 388 | continue; |
@@ -522,7 +522,7 @@ discard block |
||
| 522 | 522 | $state = $this->getEntityState($entity); |
| 523 | 523 | |
| 524 | 524 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
| 525 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
| 525 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -578,7 +578,7 @@ discard block |
||
| 578 | 578 | $oid = spl_object_hash($entity); |
| 579 | 579 | $data = []; |
| 580 | 580 | |
| 581 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 581 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 582 | 582 | return $data; |
| 583 | 583 | } |
| 584 | 584 | |
@@ -741,7 +741,7 @@ discard block |
||
| 741 | 741 | if ($owner === null) { // cloned |
| 742 | 742 | $actualValue->setOwner($entity, $assoc); |
| 743 | 743 | } else if ($owner !== $entity) { // no clone, we have to fix |
| 744 | - if (!$actualValue->isInitialized()) { |
|
| 744 | + if ( ! $actualValue->isInitialized()) { |
|
| 745 | 745 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 746 | 746 | } |
| 747 | 747 | $newValue = clone $actualValue; |
@@ -887,7 +887,7 @@ discard block |
||
| 887 | 887 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
| 888 | 888 | |
| 889 | 889 | foreach ($unwrappedValue as $key => $entry) { |
| 890 | - if (! ($entry instanceof $targetClass->name)) { |
|
| 890 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
| 891 | 891 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
| 892 | 892 | } |
| 893 | 893 | |
@@ -965,7 +965,7 @@ discard block |
||
| 965 | 965 | |
| 966 | 966 | // Some identifiers may be foreign keys to new entities. |
| 967 | 967 | // In this case, we don't have the value yet and should treat it as if we have a post-insert generator |
| 968 | - if (! $this->hasMissingIdsWhichAreForeignKeys($class, $idValue)) { |
|
| 968 | + if ( ! $this->hasMissingIdsWhichAreForeignKeys($class, $idValue)) { |
|
| 969 | 969 | $this->entityIdentifiers[$oid] = $idValue; |
| 970 | 970 | } |
| 971 | 971 | } |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | } |
| 1115 | 1115 | } else { |
| 1116 | 1116 | foreach ($insertionsForClass as $oid => $entity) { |
| 1117 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
| 1117 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
| 1118 | 1118 | //entity was not added to identity map because some identifiers are foreign keys to new entities. |
| 1119 | 1119 | //add it now |
| 1120 | 1120 | $this->addToEntityIdentifiersAndEntityMap($class, $oid, $entity); |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | |
| 1280 | 1280 | $joinColumns = reset($assoc['joinColumns']); |
| 1281 | 1281 | |
| 1282 | - $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable'])); |
|
| 1282 | + $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable'])); |
|
| 1283 | 1283 | |
| 1284 | 1284 | // If the target class has mapped subclasses, these share the same dependency. |
| 1285 | 1285 | if ( ! $targetClass->subClasses) { |
@@ -1802,7 +1802,7 @@ discard block |
||
| 1802 | 1802 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1803 | 1803 | |
| 1804 | 1804 | default: |
| 1805 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1805 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1806 | 1806 | } |
| 1807 | 1807 | |
| 1808 | 1808 | $this->cascadePersist($entity, $visited); |
@@ -1872,7 +1872,7 @@ discard block |
||
| 1872 | 1872 | case self::STATE_DETACHED: |
| 1873 | 1873 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1874 | 1874 | default: |
| 1875 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1875 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1876 | 1876 | } |
| 1877 | 1877 | |
| 1878 | 1878 | } |
@@ -2011,7 +2011,7 @@ discard block |
||
| 2011 | 2011 | */ |
| 2012 | 2012 | private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy) |
| 2013 | 2013 | { |
| 2014 | - if (! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
| 2014 | + if ( ! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
| 2015 | 2015 | return; |
| 2016 | 2016 | } |
| 2017 | 2017 | |
@@ -2036,7 +2036,7 @@ discard block |
||
| 2036 | 2036 | */ |
| 2037 | 2037 | private function isLoaded($entity) |
| 2038 | 2038 | { |
| 2039 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 2039 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 2040 | 2040 | } |
| 2041 | 2041 | |
| 2042 | 2042 | /** |
@@ -2196,7 +2196,7 @@ discard block |
||
| 2196 | 2196 | |
| 2197 | 2197 | $associationMappings = array_filter( |
| 2198 | 2198 | $class->associationMappings, |
| 2199 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2199 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2200 | 2200 | ); |
| 2201 | 2201 | |
| 2202 | 2202 | foreach ($associationMappings as $assoc) { |
@@ -2239,7 +2239,7 @@ discard block |
||
| 2239 | 2239 | |
| 2240 | 2240 | $associationMappings = array_filter( |
| 2241 | 2241 | $class->associationMappings, |
| 2242 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2242 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2243 | 2243 | ); |
| 2244 | 2244 | |
| 2245 | 2245 | foreach ($associationMappings as $assoc) { |
@@ -2283,7 +2283,7 @@ discard block |
||
| 2283 | 2283 | |
| 2284 | 2284 | $associationMappings = array_filter( |
| 2285 | 2285 | $class->associationMappings, |
| 2286 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2286 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2287 | 2287 | ); |
| 2288 | 2288 | |
| 2289 | 2289 | foreach ($associationMappings as $assoc) { |
@@ -2322,7 +2322,7 @@ discard block |
||
| 2322 | 2322 | |
| 2323 | 2323 | $associationMappings = array_filter( |
| 2324 | 2324 | $class->associationMappings, |
| 2325 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
| 2325 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
| 2326 | 2326 | ); |
| 2327 | 2327 | |
| 2328 | 2328 | foreach ($associationMappings as $assoc) { |
@@ -2351,7 +2351,7 @@ discard block |
||
| 2351 | 2351 | break; |
| 2352 | 2352 | |
| 2353 | 2353 | case ($relatedEntities !== null): |
| 2354 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2354 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2355 | 2355 | throw ORMInvalidArgumentException::invalidAssociation( |
| 2356 | 2356 | $this->em->getClassMetadata($assoc['targetEntity']), |
| 2357 | 2357 | $assoc, |
@@ -2382,13 +2382,13 @@ discard block |
||
| 2382 | 2382 | |
| 2383 | 2383 | $associationMappings = array_filter( |
| 2384 | 2384 | $class->associationMappings, |
| 2385 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2385 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2386 | 2386 | ); |
| 2387 | 2387 | |
| 2388 | 2388 | $entitiesToCascade = []; |
| 2389 | 2389 | |
| 2390 | 2390 | foreach ($associationMappings as $assoc) { |
| 2391 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2391 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2392 | 2392 | $entity->__load(); |
| 2393 | 2393 | } |
| 2394 | 2394 | |
@@ -2452,7 +2452,7 @@ discard block |
||
| 2452 | 2452 | return; |
| 2453 | 2453 | } |
| 2454 | 2454 | |
| 2455 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2455 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2456 | 2456 | $entity->__load(); |
| 2457 | 2457 | } |
| 2458 | 2458 | |
@@ -2467,7 +2467,7 @@ discard block |
||
| 2467 | 2467 | case LockMode::NONE === $lockMode: |
| 2468 | 2468 | case LockMode::PESSIMISTIC_READ === $lockMode: |
| 2469 | 2469 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
| 2470 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 2470 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 2471 | 2471 | throw TransactionRequiredException::transactionRequired(); |
| 2472 | 2472 | } |
| 2473 | 2473 | |
@@ -2793,7 +2793,7 @@ discard block |
||
| 2793 | 2793 | // then we can append this entity for eager loading! |
| 2794 | 2794 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
| 2795 | 2795 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2796 | - !$targetClass->isIdentifierComposite && |
|
| 2796 | + ! $targetClass->isIdentifierComposite && |
|
| 2797 | 2797 | $newValue instanceof Proxy && |
| 2798 | 2798 | $newValue->__isInitialized__ === false) { |
| 2799 | 2799 | |
@@ -2849,7 +2849,7 @@ discard block |
||
| 2849 | 2849 | $this->originalEntityData[$oid][$field] = $newValue; |
| 2850 | 2850 | $class->reflFields[$field]->setValue($entity, $newValue); |
| 2851 | 2851 | if ( ! $assoc['inversedBy'] && ! $assoc['type'] && ! isset($targetClass->associationMappings[$assoc['inversedBy']])) { |
| 2852 | - throw new ORMException("The column " . $assoc['inversedBy'] . " is needed by " . $targetClass->getName() . " entity and should be are on the database", 1); |
|
| 2852 | + throw new ORMException("The column ".$assoc['inversedBy']." is needed by ".$targetClass->getName()." entity and should be are on the database", 1); |
|
| 2853 | 2853 | } |
| 2854 | 2854 | |
| 2855 | 2855 | if ($assoc['inversedBy'] && $assoc['type'] & ClassMetadata::ONE_TO_ONE) { |
@@ -3162,7 +3162,7 @@ discard block |
||
| 3162 | 3162 | public function getCollectionPersister(array $association) |
| 3163 | 3163 | { |
| 3164 | 3164 | $role = isset($association['cache']) |
| 3165 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
| 3165 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
| 3166 | 3166 | : $association['type']; |
| 3167 | 3167 | |
| 3168 | 3168 | if (isset($this->collectionPersisters[$role])) { |
@@ -3380,7 +3380,7 @@ discard block |
||
| 3380 | 3380 | */ |
| 3381 | 3381 | private function afterTransactionComplete() |
| 3382 | 3382 | { |
| 3383 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3383 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3384 | 3384 | $persister->afterTransactionComplete(); |
| 3385 | 3385 | }); |
| 3386 | 3386 | } |
@@ -3390,7 +3390,7 @@ discard block |
||
| 3390 | 3390 | */ |
| 3391 | 3391 | private function afterTransactionRolledBack() |
| 3392 | 3392 | { |
| 3393 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3393 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3394 | 3394 | $persister->afterTransactionRolledBack(); |
| 3395 | 3395 | }); |
| 3396 | 3396 | } |
@@ -3486,11 +3486,11 @@ discard block |
||
| 3486 | 3486 | */ |
| 3487 | 3487 | private function mergeEntityStateIntoManagedCopy($entity, $managedCopy) |
| 3488 | 3488 | { |
| 3489 | - if (! $this->isLoaded($entity)) { |
|
| 3489 | + if ( ! $this->isLoaded($entity)) { |
|
| 3490 | 3490 | return; |
| 3491 | 3491 | } |
| 3492 | 3492 | |
| 3493 | - if (! $this->isLoaded($managedCopy)) { |
|
| 3493 | + if ( ! $this->isLoaded($managedCopy)) { |
|
| 3494 | 3494 | $managedCopy->__load(); |
| 3495 | 3495 | } |
| 3496 | 3496 | |
@@ -3513,7 +3513,7 @@ discard block |
||
| 3513 | 3513 | if ($other === null) { |
| 3514 | 3514 | $prop->setValue($managedCopy, null); |
| 3515 | 3515 | } else { |
| 3516 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
| 3516 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
| 3517 | 3517 | // do not merge fields marked lazy that have not been fetched. |
| 3518 | 3518 | continue; |
| 3519 | 3519 | } |
@@ -3600,7 +3600,7 @@ discard block |
||
| 3600 | 3600 | */ |
| 3601 | 3601 | private function clearIdentityMapForEntityName($entityName) |
| 3602 | 3602 | { |
| 3603 | - if (! isset($this->identityMap[$entityName])) { |
|
| 3603 | + if ( ! isset($this->identityMap[$entityName])) { |
|
| 3604 | 3604 | return; |
| 3605 | 3605 | } |
| 3606 | 3606 | |