@@ -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\Tools; |
| 6 | 6 | |
@@ -77,20 +77,20 @@ discard block |
||
| 77 | 77 | fwrite($fh, "Flush Operation [".$this->context."] - Dumping identity map:\n"); |
| 78 | 78 | |
| 79 | 79 | foreach ($identityMap as $className => $map) { |
| 80 | - fwrite($fh, "Class: ". $className . "\n"); |
|
| 80 | + fwrite($fh, "Class: ".$className."\n"); |
|
| 81 | 81 | |
| 82 | 82 | foreach ($map as $entity) { |
| 83 | - fwrite($fh, " Entity: " . $this->getIdString($entity, $uow) . " " . spl_object_id($entity)."\n"); |
|
| 83 | + fwrite($fh, " Entity: ".$this->getIdString($entity, $uow)." ".spl_object_id($entity)."\n"); |
|
| 84 | 84 | fwrite($fh, " Associations:\n"); |
| 85 | 85 | |
| 86 | 86 | $cm = $em->getClassMetadata($className); |
| 87 | 87 | |
| 88 | 88 | foreach ($cm->getDeclaredPropertiesIterator() as $field => $association) { |
| 89 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 89 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 90 | 90 | continue; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - fwrite($fh, " " . $field . " "); |
|
| 93 | + fwrite($fh, " ".$field." "); |
|
| 94 | 94 | |
| 95 | 95 | $value = $association->getValue($entity); |
| 96 | 96 | |
@@ -101,25 +101,25 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | if ($association instanceof ToOneAssociationMetadata) { |
| 104 | - if ($value instanceof GhostObjectInterface && !$value->isProxyInitialized()) { |
|
| 104 | + if ($value instanceof GhostObjectInterface && ! $value->isProxyInitialized()) { |
|
| 105 | 105 | fwrite($fh, "[PROXY] "); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - fwrite($fh, $this->getIdString($value, $uow) . " " . spl_object_id($value) . "\n"); |
|
| 108 | + fwrite($fh, $this->getIdString($value, $uow)." ".spl_object_id($value)."\n"); |
|
| 109 | 109 | } else { |
| 110 | - $initialized = !($value instanceof PersistentCollection) || $value->isInitialized(); |
|
| 110 | + $initialized = ! ($value instanceof PersistentCollection) || $value->isInitialized(); |
|
| 111 | 111 | |
| 112 | 112 | if ($initialized) { |
| 113 | - fwrite($fh, "[INITIALIZED] " . $this->getType($value). " " . count($value) . " elements\n"); |
|
| 113 | + fwrite($fh, "[INITIALIZED] ".$this->getType($value)." ".count($value)." elements\n"); |
|
| 114 | 114 | |
| 115 | 115 | foreach ($value as $obj) { |
| 116 | - fwrite($fh, " " . $this->getIdString($obj, $uow) . " " . spl_object_id($obj)."\n"); |
|
| 116 | + fwrite($fh, " ".$this->getIdString($obj, $uow)." ".spl_object_id($obj)."\n"); |
|
| 117 | 117 | } |
| 118 | 118 | } else { |
| 119 | - fwrite($fh, "[PROXY] " . $this->getType($value) . " unknown element size\n"); |
|
| 119 | + fwrite($fh, "[PROXY] ".$this->getType($value)." unknown element size\n"); |
|
| 120 | 120 | |
| 121 | 121 | foreach ($value->unwrap() as $obj) { |
| 122 | - fwrite($fh, " " . $this->getIdString($obj, $uow) . " " . spl_object_id($obj)."\n"); |
|
| 122 | + fwrite($fh, " ".$this->getIdString($obj, $uow)." ".spl_object_id($obj)."\n"); |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | } |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Tools; |
| 6 | 6 | |
| 7 | -use Doctrine\Common\Persistence\Proxy; |
|
| 8 | 7 | use Doctrine\ORM\EntityManagerInterface; |
| 9 | 8 | use Doctrine\ORM\Event\OnFlushEventArgs; |
| 10 | 9 | use Doctrine\ORM\Mapping\AssociationMetadata; |
@@ -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\Repository; |
| 6 | 6 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function getRepository(EntityManagerInterface $entityManager, $entityName) |
| 28 | 28 | { |
| 29 | - $repositoryHash = $entityManager->getClassMetadata($entityName)->getClassName() . spl_object_id($entityManager); |
|
| 29 | + $repositoryHash = $entityManager->getClassMetadata($entityName)->getClassName().spl_object_id($entityManager); |
|
| 30 | 30 | |
| 31 | 31 | if (isset($this->repositoryList[$repositoryHash])) { |
| 32 | 32 | return $this->repositoryList[$repositoryHash]; |
@@ -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\Internal\Hydration; |
| 6 | 6 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | protected function prepare() |
| 68 | 68 | { |
| 69 | - if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
| 69 | + if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
| 70 | 70 | $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -76,13 +76,13 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // Remember which associations are "fetch joined", so that we know where to inject |
| 78 | 78 | // collection stubs or proxies and where not. |
| 79 | - if (! isset($this->rsm->relationMap[$dqlAlias])) { |
|
| 79 | + if ( ! isset($this->rsm->relationMap[$dqlAlias])) { |
|
| 80 | 80 | continue; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 84 | 84 | |
| 85 | - if (! isset($this->rsm->aliasMap[$parent])) { |
|
| 85 | + if ( ! isset($this->rsm->aliasMap[$parent])) { |
|
| 86 | 86 | throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent); |
| 87 | 87 | } |
| 88 | 88 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | $class = $this->getClassMetadata($className); |
| 109 | 109 | $inverseAssoc = $class->getProperty($association->getInversedBy()); |
| 110 | 110 | |
| 111 | - if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
| 111 | + if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
| 112 | 112 | continue; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -174,14 +174,14 @@ discard block |
||
| 174 | 174 | $value = $association->getValue($entity); |
| 175 | 175 | $oid = spl_object_id($entity); |
| 176 | 176 | |
| 177 | - if (! $value instanceof PersistentCollection) { |
|
| 177 | + if ( ! $value instanceof PersistentCollection) { |
|
| 178 | 178 | $value = $association->wrap($entity, $value, $this->em); |
| 179 | 179 | |
| 180 | 180 | $association->setValue($entity, $value); |
| 181 | 181 | |
| 182 | 182 | $this->uow->setOriginalEntityProperty($oid, $fieldName, $value); |
| 183 | 183 | |
| 184 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 184 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 185 | 185 | } elseif ( |
| 186 | 186 | isset($this->hints[Query::HINT_REFRESH]) || |
| 187 | 187 | (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized()) |
@@ -191,10 +191,10 @@ discard block |
||
| 191 | 191 | $value->setInitialized(true); |
| 192 | 192 | $value->unwrap()->clear(); |
| 193 | 193 | |
| 194 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 194 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 195 | 195 | } else { |
| 196 | 196 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
| 197 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
| 197 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | return $value; |
@@ -312,10 +312,10 @@ discard block |
||
| 312 | 312 | $parentAlias = $this->rsm->parentAliasMap[$dqlAlias]; |
| 313 | 313 | // we need the $path to save into the identifier map which entities were already |
| 314 | 314 | // seen for this parent-child relationship |
| 315 | - $path = $parentAlias . '.' . $dqlAlias; |
|
| 315 | + $path = $parentAlias.'.'.$dqlAlias; |
|
| 316 | 316 | |
| 317 | 317 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
| 318 | - if (! isset($nonemptyComponents[$parentAlias])) { |
|
| 318 | + if ( ! isset($nonemptyComponents[$parentAlias])) { |
|
| 319 | 319 | // TODO: Add special case code where we hydrate the right join objects into identity map at least |
| 320 | 320 | continue; |
| 321 | 321 | } |
@@ -346,15 +346,15 @@ discard block |
||
| 346 | 346 | $oid = spl_object_id($parentObject); |
| 347 | 347 | |
| 348 | 348 | // Check the type of the relation (many or single-valued) |
| 349 | - if (! ($association instanceof ToOneAssociationMetadata)) { |
|
| 349 | + if ( ! ($association instanceof ToOneAssociationMetadata)) { |
|
| 350 | 350 | // PATH A: Collection-valued association |
| 351 | 351 | $reflFieldValue = $association->getValue($parentObject); |
| 352 | 352 | |
| 353 | 353 | if (isset($nonemptyComponents[$dqlAlias])) { |
| 354 | - $collKey = $oid . $relationField; |
|
| 354 | + $collKey = $oid.$relationField; |
|
| 355 | 355 | if (isset($this->initializedCollections[$collKey])) { |
| 356 | 356 | $reflFieldValue = $this->initializedCollections[$collKey]; |
| 357 | - } elseif (! isset($this->existingCollections[$collKey])) { |
|
| 357 | + } elseif ( ! isset($this->existingCollections[$collKey])) { |
|
| 358 | 358 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
| 359 | 359 | } |
| 360 | 360 | |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | $index = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false; |
| 363 | 363 | $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false; |
| 364 | 364 | |
| 365 | - if (! $indexExists || ! $indexIsValid) { |
|
| 365 | + if ( ! $indexExists || ! $indexIsValid) { |
|
| 366 | 366 | if (isset($this->existingCollections[$collKey])) { |
| 367 | 367 | // Collection exists, only look for the element in the identity map. |
| 368 | 368 | if ($element = $this->getEntityFromIdentityMap($entityName, $data)) { |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | // PATH B: Single-valued association |
| 399 | 399 | $reflFieldValue = $association->getValue($parentObject); |
| 400 | 400 | |
| 401 | - if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
| 401 | + if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
| 402 | 402 | ($reflFieldValue instanceof GhostObjectInterface && ! $reflFieldValue->isProxyInitialized())) { |
| 403 | 403 | // we only need to take action if this value is null, |
| 404 | 404 | // we refresh the entity or its an uninitialized proxy. |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 460 | 460 | |
| 461 | 461 | // if this row has a NULL value for the root result id then make it a null result. |
| 462 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 462 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 463 | 463 | if ($this->rsm->isMixed) { |
| 464 | 464 | $result[] = [$entityKey => null]; |
| 465 | 465 | } else { |
@@ -515,13 +515,13 @@ discard block |
||
| 515 | 515 | } |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | - if ( ! isset($resultKey) ) { |
|
| 518 | + if ( ! isset($resultKey)) { |
|
| 519 | 519 | $this->resultCounter++; |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | // Append scalar values to mixed result sets |
| 523 | 523 | if (isset($rowData['scalars'])) { |
| 524 | - if ( ! isset($resultKey) ) { |
|
| 524 | + if ( ! isset($resultKey)) { |
|
| 525 | 525 | $resultKey = (isset($this->rsm->indexByMap['scalars'])) |
| 526 | 526 | ? $row[$this->rsm->indexByMap['scalars']] |
| 527 | 527 | : $this->resultCounter - 1; |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | |
| 535 | 535 | // Append new object to mixed result sets |
| 536 | 536 | if (isset($rowData['newObjects'])) { |
| 537 | - if ( ! isset($resultKey) ) { |
|
| 537 | + if ( ! isset($resultKey)) { |
|
| 538 | 538 | $resultKey = $this->resultCounter - 1; |
| 539 | 539 | } |
| 540 | 540 | |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $args = $newObject['args']; |
| 547 | 547 | $obj = $class->newInstanceArgs($args); |
| 548 | 548 | |
| 549 | - if ($hasNoScalars && \count($rowData['newObjects']) === 1 ) { |
|
| 549 | + if ($hasNoScalars && \count($rowData['newObjects']) === 1) { |
|
| 550 | 550 | $result[$resultKey] = $obj; |
| 551 | 551 | |
| 552 | 552 | continue; |
@@ -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 | |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | // Entity deletions come last and need to be in reverse commit order |
| 391 | 391 | if ($this->entityDeletions) { |
| 392 | 392 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 393 | - if (! $this->entityDeletions) { |
|
| 393 | + if ( ! $this->entityDeletions) { |
|
| 394 | 394 | break; // just a performance optimisation |
| 395 | 395 | } |
| 396 | 396 | |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $oid = spl_object_id($entity); |
| 476 | 476 | $data = []; |
| 477 | 477 | |
| 478 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 478 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 479 | 479 | return $data; |
| 480 | 480 | } |
| 481 | 481 | |
@@ -558,7 +558,7 @@ 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 | } |
@@ -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) || ($value = $property->getValue($entity)) === null) { |
|
| 676 | + if ( ! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) { |
|
| 677 | 677 | continue; |
| 678 | 678 | } |
| 679 | 679 | |
@@ -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(), |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | $persister = $this->getEntityPersister($class->getClassName()); |
| 846 | 846 | $generationPlan->executeImmediate($this->em, $entity); |
| 847 | 847 | |
| 848 | - if (! $generationPlan->containsDeferred()) { |
|
| 848 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 849 | 849 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 850 | 850 | $this->entityIdentifiers[$oid] = $id; |
| 851 | 851 | } |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | { |
| 879 | 879 | $oid = spl_object_id($entity); |
| 880 | 880 | |
| 881 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 881 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 882 | 882 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
| 883 | 883 | } |
| 884 | 884 | |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | break; |
| 901 | 901 | |
| 902 | 902 | case ($property instanceof FieldMetadata): |
| 903 | - if (! $property->isPrimaryKey() |
|
| 903 | + if ( ! $property->isPrimaryKey() |
|
| 904 | 904 | || ! $property->getValueGenerator() |
| 905 | 905 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 906 | 906 | $actualData[$name] = $property->getValue($entity); |
@@ -1053,7 +1053,7 @@ discard block |
||
| 1053 | 1053 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1054 | 1054 | // is obtained by a new entity because the old one went out of scope. |
| 1055 | 1055 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1056 | - if (! $class->isIdentifierComposite()) { |
|
| 1056 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1057 | 1057 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1058 | 1058 | |
| 1059 | 1059 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | // Calculate dependencies for new nodes |
| 1101 | 1101 | while ($class = array_pop($newNodes)) { |
| 1102 | 1102 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1103 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1103 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1104 | 1104 | continue; |
| 1105 | 1105 | } |
| 1106 | 1106 | |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | |
| 1115 | 1115 | $weight = ! array_filter( |
| 1116 | 1116 | $property->getJoinColumns(), |
| 1117 | - function (JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
| 1117 | + function(JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
| 1118 | 1118 | ); |
| 1119 | 1119 | |
| 1120 | 1120 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1409 | 1409 | $id = $persister->getIdentifier($entity); |
| 1410 | 1410 | |
| 1411 | - if (! $id) { |
|
| 1411 | + if ( ! $id) { |
|
| 1412 | 1412 | return self::STATE_NEW; |
| 1413 | 1413 | } |
| 1414 | 1414 | |
@@ -1641,7 +1641,7 @@ discard block |
||
| 1641 | 1641 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1642 | 1642 | |
| 1643 | 1643 | default: |
| 1644 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1644 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1645 | 1645 | } |
| 1646 | 1646 | |
| 1647 | 1647 | $this->cascadePersist($entity, $visited); |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | case self::STATE_DETACHED: |
| 1712 | 1712 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1713 | 1713 | default: |
| 1714 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1714 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1715 | 1715 | } |
| 1716 | 1716 | |
| 1717 | 1717 | } |
@@ -1780,7 +1780,7 @@ discard block |
||
| 1780 | 1780 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1781 | 1781 | |
| 1782 | 1782 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1783 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
| 1783 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
| 1784 | 1784 | continue; |
| 1785 | 1785 | } |
| 1786 | 1786 | |
@@ -1829,7 +1829,7 @@ discard block |
||
| 1829 | 1829 | } |
| 1830 | 1830 | |
| 1831 | 1831 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1832 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
| 1832 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
| 1833 | 1833 | continue; |
| 1834 | 1834 | } |
| 1835 | 1835 | |
@@ -1845,7 +1845,7 @@ discard block |
||
| 1845 | 1845 | |
| 1846 | 1846 | case ($relatedEntities instanceof Collection): |
| 1847 | 1847 | case (is_array($relatedEntities)): |
| 1848 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1848 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1849 | 1849 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1850 | 1850 | $this->em->getClassMetadata($targetEntity), |
| 1851 | 1851 | $association, |
@@ -1860,7 +1860,7 @@ discard block |
||
| 1860 | 1860 | break; |
| 1861 | 1861 | |
| 1862 | 1862 | case ($relatedEntities !== null): |
| 1863 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1863 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1864 | 1864 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1865 | 1865 | $this->em->getClassMetadata($targetEntity), |
| 1866 | 1866 | $association, |
@@ -1891,7 +1891,7 @@ discard block |
||
| 1891 | 1891 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1892 | 1892 | |
| 1893 | 1893 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1894 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
| 1894 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
| 1895 | 1895 | continue; |
| 1896 | 1896 | } |
| 1897 | 1897 | |
@@ -1975,7 +1975,7 @@ discard block |
||
| 1975 | 1975 | case LockMode::NONE === $lockMode: |
| 1976 | 1976 | case LockMode::PESSIMISTIC_READ === $lockMode: |
| 1977 | 1977 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
| 1978 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 1978 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 1979 | 1979 | throw TransactionRequiredException::transactionRequired(); |
| 1980 | 1980 | } |
| 1981 | 1981 | |
@@ -2195,7 +2195,7 @@ discard block |
||
| 2195 | 2195 | } |
| 2196 | 2196 | |
| 2197 | 2197 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2198 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2198 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2199 | 2199 | continue; |
| 2200 | 2200 | } |
| 2201 | 2201 | |
@@ -2244,7 +2244,7 @@ discard block |
||
| 2244 | 2244 | continue; |
| 2245 | 2245 | } |
| 2246 | 2246 | |
| 2247 | - if (! $association->isOwningSide()) { |
|
| 2247 | + if ( ! $association->isOwningSide()) { |
|
| 2248 | 2248 | // use the given entity association |
| 2249 | 2249 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2250 | 2250 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2294,7 +2294,7 @@ discard block |
||
| 2294 | 2294 | $associatedId[$targetField] = $joinColumnValue; |
| 2295 | 2295 | } |
| 2296 | 2296 | |
| 2297 | - if (! $associatedId) { |
|
| 2297 | + if ( ! $associatedId) { |
|
| 2298 | 2298 | // Foreign key is NULL |
| 2299 | 2299 | $association->setValue($entity, null); |
| 2300 | 2300 | $this->originalEntityData[$oid][$field] = null; |
@@ -2303,7 +2303,7 @@ discard block |
||
| 2303 | 2303 | } |
| 2304 | 2304 | |
| 2305 | 2305 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2306 | - if (!isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2306 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2307 | 2307 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2308 | 2308 | } |
| 2309 | 2309 | |
@@ -2320,7 +2320,7 @@ discard block |
||
| 2320 | 2320 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2321 | 2321 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2322 | 2322 | // then we can append this entity for eager loading! |
| 2323 | - if (!$targetClass->isIdentifierComposite() && |
|
| 2323 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2324 | 2324 | $newValue instanceof GhostObjectInterface && |
| 2325 | 2325 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2326 | 2326 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2357,7 +2357,7 @@ discard block |
||
| 2357 | 2357 | break; |
| 2358 | 2358 | |
| 2359 | 2359 | // Deferred eager load only works for single identifier classes |
| 2360 | - case (isset($hints[self::HINT_DEFEREAGERLOAD]) && !$targetClass->isIdentifierComposite()): |
|
| 2360 | + case (isset($hints[self::HINT_DEFEREAGERLOAD]) && ! $targetClass->isIdentifierComposite()): |
|
| 2361 | 2361 | // TODO: Is there a faster approach? |
| 2362 | 2362 | $this->eagerLoadingEntities[$targetClass->getRootClassName()][$relatedIdHash] = current($normalizedAssociatedId); |
| 2363 | 2363 | |
@@ -2764,7 +2764,7 @@ discard block |
||
| 2764 | 2764 | { |
| 2765 | 2765 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2766 | 2766 | |
| 2767 | - if (! $class->getProperty($propertyName)) { |
|
| 2767 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2768 | 2768 | return; // ignore non-persistent fields |
| 2769 | 2769 | } |
| 2770 | 2770 | |
@@ -2904,7 +2904,7 @@ discard block |
||
| 2904 | 2904 | */ |
| 2905 | 2905 | private function afterTransactionComplete() |
| 2906 | 2906 | { |
| 2907 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2907 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2908 | 2908 | $persister->afterTransactionComplete(); |
| 2909 | 2909 | }); |
| 2910 | 2910 | } |
@@ -2914,7 +2914,7 @@ discard block |
||
| 2914 | 2914 | */ |
| 2915 | 2915 | private function afterTransactionRolledBack() |
| 2916 | 2916 | { |
| 2917 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2917 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2918 | 2918 | $persister->afterTransactionRolledBack(); |
| 2919 | 2919 | }); |
| 2920 | 2920 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Mapping; |
| 7 | 7 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function __toString() |
| 310 | 310 | { |
| 311 | - return __CLASS__ . '@' . spl_object_id($this); |
|
| 311 | + return __CLASS__.'@'.spl_object_id($this); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /** |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | // Restore ReflectionClass and properties |
| 412 | 412 | $this->reflectionClass = $reflectionService->getClass($this->className); |
| 413 | 413 | |
| 414 | - if (! $this->reflectionClass) { |
|
| 414 | + if ( ! $this->reflectionClass) { |
|
| 415 | 415 | return; |
| 416 | 416 | } |
| 417 | 417 | |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | // Verify & complete identifier mapping |
| 440 | - if (! $this->identifier) { |
|
| 440 | + if ( ! $this->identifier) { |
|
| 441 | 441 | throw MappingException::identifierRequired($this->className); |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
| 444 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
| 445 | 445 | return $property instanceof FieldMetadata |
| 446 | 446 | && $property->isPrimaryKey() |
| 447 | 447 | && $property->hasValueGenerator(); |
@@ -462,14 +462,14 @@ discard block |
||
| 462 | 462 | public function validateAssociations() : void |
| 463 | 463 | { |
| 464 | 464 | array_map( |
| 465 | - function (Property $property) { |
|
| 466 | - if (! ($property instanceof AssociationMetadata)) { |
|
| 465 | + function(Property $property) { |
|
| 466 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
| 467 | 467 | return; |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | $targetEntity = $property->getTargetEntity(); |
| 471 | 471 | |
| 472 | - if (! class_exists($targetEntity)) { |
|
| 472 | + if ( ! class_exists($targetEntity)) { |
|
| 473 | 473 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
| 474 | 474 | } |
| 475 | 475 | }, |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | foreach ($this->lifecycleCallbacks as $callbacks) { |
| 492 | 492 | /** @var array $callbacks */ |
| 493 | 493 | foreach ($callbacks as $callbackFuncName) { |
| 494 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 494 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 495 | 495 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
| 496 | 496 | } |
| 497 | 497 | } |
@@ -519,11 +519,11 @@ discard block |
||
| 519 | 519 | */ |
| 520 | 520 | public function isIdentifier(string $fieldName) : bool |
| 521 | 521 | { |
| 522 | - if (! $this->identifier) { |
|
| 522 | + if ( ! $this->identifier) { |
|
| 523 | 523 | return false; |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | - if (! $this->isIdentifierComposite()) { |
|
| 526 | + if ( ! $this->isIdentifierComposite()) { |
|
| 527 | 527 | return $fieldName === $this->identifier[0]; |
| 528 | 528 | } |
| 529 | 529 | |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | public function getNamedQuery($queryName) : string |
| 553 | 553 | { |
| 554 | - if (! isset($this->namedQueries[$queryName])) { |
|
| 554 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
| 555 | 555 | throw MappingException::queryNotFound($this->className, $queryName); |
| 556 | 556 | } |
| 557 | 557 | |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | */ |
| 612 | 612 | public function getSqlResultSetMapping($name) |
| 613 | 613 | { |
| 614 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
| 614 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
| 615 | 615 | throw MappingException::resultMappingNotFound($this->className, $name); |
| 616 | 616 | } |
| 617 | 617 | |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $property->setColumnName($columnName); |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | - if (! $this->isMappedSuperclass) { |
|
| 649 | + if ( ! $this->isMappedSuperclass) { |
|
| 650 | 650 | $property->setTableName($this->getTableName()); |
| 651 | 651 | } |
| 652 | 652 | |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
| 667 | 667 | } |
| 668 | 668 | |
| 669 | - if (! in_array($fieldName, $this->identifier)) { |
|
| 669 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
| 670 | 670 | $this->identifier[] = $fieldName; |
| 671 | 671 | } |
| 672 | 672 | } |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | $fieldName = $property->getName(); |
| 721 | 721 | $targetEntity = $property->getTargetEntity(); |
| 722 | 722 | |
| 723 | - if (! $targetEntity) { |
|
| 723 | + if ( ! $targetEntity) { |
|
| 724 | 724 | throw MappingException::missingTargetEntity($fieldName); |
| 725 | 725 | } |
| 726 | 726 | |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | $this->identifier[] = $property->getName(); |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - if ($this->cache && !$property->getCache()) { |
|
| 749 | + if ($this->cache && ! $property->getCache()) { |
|
| 750 | 750 | throw CacheException::nonCacheableEntityAssociation($this->className, $fieldName); |
| 751 | 751 | } |
| 752 | 752 | |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | /** @var JoinColumnMetadata $joinColumn */ |
| 801 | 801 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
| 802 | 802 | if (1 === count($property->getJoinColumns())) { |
| 803 | - if (! $property->isPrimaryKey()) { |
|
| 803 | + if ( ! $property->isPrimaryKey()) { |
|
| 804 | 804 | $joinColumn->setUnique(true); |
| 805 | 805 | } |
| 806 | 806 | } else { |
@@ -808,13 +808,13 @@ discard block |
||
| 808 | 808 | } |
| 809 | 809 | } |
| 810 | 810 | |
| 811 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 811 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 812 | 812 | |
| 813 | - if (! $joinColumn->getColumnName()) { |
|
| 813 | + if ( ! $joinColumn->getColumnName()) { |
|
| 814 | 814 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 817 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 818 | 818 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 819 | 819 | } |
| 820 | 820 | |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | if ($property->isOrphanRemoval()) { |
| 843 | 843 | $cascades = $property->getCascade(); |
| 844 | 844 | |
| 845 | - if (! in_array('remove', $cascades)) { |
|
| 845 | + if ( ! in_array('remove', $cascades)) { |
|
| 846 | 846 | $cascades[] = 'remove'; |
| 847 | 847 | |
| 848 | 848 | $property->setCascade($cascades); |
@@ -908,14 +908,14 @@ discard block |
||
| 908 | 908 | $property->setOwningSide(false); |
| 909 | 909 | |
| 910 | 910 | // OneToMany MUST have mappedBy |
| 911 | - if (! $property->getMappedBy()) { |
|
| 911 | + if ( ! $property->getMappedBy()) { |
|
| 912 | 912 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | if ($property->isOrphanRemoval()) { |
| 916 | 916 | $cascades = $property->getCascade(); |
| 917 | 917 | |
| 918 | - if (! in_array('remove', $cascades)) { |
|
| 918 | + if ( ! in_array('remove', $cascades)) { |
|
| 919 | 919 | $cascades[] = 'remove'; |
| 920 | 920 | |
| 921 | 921 | $property->setCascade($cascades); |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | |
| 939 | 939 | $property->setJoinTable($joinTable); |
| 940 | 940 | |
| 941 | - if (! $joinTable->getName()) { |
|
| 941 | + if ( ! $joinTable->getName()) { |
|
| 942 | 942 | $joinTableName = $this->namingStrategy->joinTableName( |
| 943 | 943 | $property->getSourceEntity(), |
| 944 | 944 | $property->getTargetEntity(), |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | |
| 951 | 951 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
| 952 | 952 | |
| 953 | - if (! $joinTable->getJoinColumns()) { |
|
| 953 | + if ( ! $joinTable->getJoinColumns()) { |
|
| 954 | 954 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 955 | 955 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
| 956 | 956 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | $joinTable->addJoinColumn($joinColumn); |
| 964 | 964 | } |
| 965 | 965 | |
| 966 | - if (! $joinTable->getInverseJoinColumns()) { |
|
| 966 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
| 967 | 967 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 968 | 968 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
| 969 | 969 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -978,13 +978,13 @@ discard block |
||
| 978 | 978 | |
| 979 | 979 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 980 | 980 | /** @var JoinColumnMetadata $joinColumn */ |
| 981 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 981 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 982 | 982 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 983 | 983 | } |
| 984 | 984 | |
| 985 | 985 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 986 | 986 | |
| 987 | - if (! $joinColumn->getColumnName()) { |
|
| 987 | + if ( ! $joinColumn->getColumnName()) { |
|
| 988 | 988 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 989 | 989 | $property->getSourceEntity(), |
| 990 | 990 | $referencedColumnName |
@@ -996,13 +996,13 @@ discard block |
||
| 996 | 996 | |
| 997 | 997 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
| 998 | 998 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
| 999 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 999 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 1000 | 1000 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
| 1004 | 1004 | |
| 1005 | - if (! $inverseJoinColumn->getColumnName()) { |
|
| 1005 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
| 1006 | 1006 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 1007 | 1007 | $property->getTargetEntity(), |
| 1008 | 1008 | $referencedColumnName |
@@ -1099,7 +1099,7 @@ discard block |
||
| 1099 | 1099 | // Association defined as Id field |
| 1100 | 1100 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1101 | 1101 | |
| 1102 | - if (! $property->isOwningSide()) { |
|
| 1102 | + if ( ! $property->isOwningSide()) { |
|
| 1103 | 1103 | $property = $targetClass->getProperty($property->getMappedBy()); |
| 1104 | 1104 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1105 | 1105 | } |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | $columnName = $joinColumn->getColumnName(); |
| 1115 | 1115 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1116 | 1116 | |
| 1117 | - if (! $joinColumn->getType()) { |
|
| 1117 | + if ( ! $joinColumn->getType()) { |
|
| 1118 | 1118 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
| 1119 | 1119 | } |
| 1120 | 1120 | |
@@ -1154,11 +1154,11 @@ discard block |
||
| 1154 | 1154 | { |
| 1155 | 1155 | $schema = null === $this->getSchemaName() |
| 1156 | 1156 | ? '' |
| 1157 | - : $this->getSchemaName() . '_' |
|
| 1157 | + : $this->getSchemaName().'_' |
|
| 1158 | 1158 | ; |
| 1159 | 1159 | |
| 1160 | 1160 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 1161 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
| 1161 | + return $schema.$this->getTableName().'_id_tmp'; |
|
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | 1164 | /** |
@@ -1218,7 +1218,7 @@ discard block |
||
| 1218 | 1218 | { |
| 1219 | 1219 | $fieldName = $property->getName(); |
| 1220 | 1220 | |
| 1221 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
| 1221 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
| 1222 | 1222 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
| 1223 | 1223 | } |
| 1224 | 1224 | |
@@ -1426,7 +1426,7 @@ discard block |
||
| 1426 | 1426 | $declaringClass = $property->getDeclaringClass(); |
| 1427 | 1427 | |
| 1428 | 1428 | if ($inheritedProperty instanceof FieldMetadata) { |
| 1429 | - if (! $declaringClass->isMappedSuperclass) { |
|
| 1429 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
| 1430 | 1430 | $inheritedProperty->setTableName($property->getTableName()); |
| 1431 | 1431 | } |
| 1432 | 1432 | |
@@ -1494,7 +1494,7 @@ discard block |
||
| 1494 | 1494 | throw MappingException::duplicateQueryMapping($this->className, $name); |
| 1495 | 1495 | } |
| 1496 | 1496 | |
| 1497 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1497 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1498 | 1498 | throw MappingException::missingQueryMapping($this->className, $name); |
| 1499 | 1499 | } |
| 1500 | 1500 | |
@@ -1517,7 +1517,7 @@ discard block |
||
| 1517 | 1517 | */ |
| 1518 | 1518 | public function addSqlResultSetMapping(array $resultMapping) |
| 1519 | 1519 | { |
| 1520 | - if (!isset($resultMapping['name'])) { |
|
| 1520 | + if ( ! isset($resultMapping['name'])) { |
|
| 1521 | 1521 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
| 1522 | 1522 | } |
| 1523 | 1523 | |
@@ -1527,7 +1527,7 @@ discard block |
||
| 1527 | 1527 | |
| 1528 | 1528 | if (isset($resultMapping['entities'])) { |
| 1529 | 1529 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
| 1530 | - if (! isset($entityResult['entityClass'])) { |
|
| 1530 | + if ( ! isset($entityResult['entityClass'])) { |
|
| 1531 | 1531 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
| 1532 | 1532 | } |
| 1533 | 1533 | |
@@ -1540,11 +1540,11 @@ discard block |
||
| 1540 | 1540 | |
| 1541 | 1541 | if (isset($entityResult['fields'])) { |
| 1542 | 1542 | foreach ($entityResult['fields'] as $k => $field) { |
| 1543 | - if (! isset($field['name'])) { |
|
| 1543 | + if ( ! isset($field['name'])) { |
|
| 1544 | 1544 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
| 1545 | 1545 | } |
| 1546 | 1546 | |
| 1547 | - if (! isset($field['column'])) { |
|
| 1547 | + if ( ! isset($field['column'])) { |
|
| 1548 | 1548 | $fieldName = $field['name']; |
| 1549 | 1549 | |
| 1550 | 1550 | if (strpos($fieldName, '.')) { |
@@ -1653,11 +1653,11 @@ discard block |
||
| 1653 | 1653 | 'method' => $method, |
| 1654 | 1654 | ]; |
| 1655 | 1655 | |
| 1656 | - if (! class_exists($class)) { |
|
| 1656 | + if ( ! class_exists($class)) { |
|
| 1657 | 1657 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | - if (! method_exists($class, $method)) { |
|
| 1660 | + if ( ! method_exists($class, $method)) { |
|
| 1661 | 1661 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
| 1662 | 1662 | } |
| 1663 | 1663 | |
@@ -1733,7 +1733,7 @@ discard block |
||
| 1733 | 1733 | return; |
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | - if (! (class_exists($className) || interface_exists($className))) { |
|
| 1736 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
| 1737 | 1737 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
| 1738 | 1738 | } |
| 1739 | 1739 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * <http://www.doctrine-project.org>. |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | -declare(strict_types=1); |
|
| 21 | +declare(strict_types = 1); |
|
| 22 | 22 | |
| 23 | 23 | namespace Doctrine\ORM\Mapping\Driver; |
| 24 | 24 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | foreach ($this->drivers as $namespace => $driver) { |
| 131 | 131 | $oid = spl_object_id($driver); |
| 132 | 132 | |
| 133 | - if (!isset($driverClasses[$oid])) { |
|
| 133 | + if ( ! isset($driverClasses[$oid])) { |
|
| 134 | 134 | $driverClasses[$oid] = $driver->getAllClassNames(); |
| 135 | 135 | } |
| 136 | 136 | |