@@ -130,7 +130,7 @@ |
||
| 130 | 130 | { |
| 131 | 131 | $this->expectException(MappingException::class); |
| 132 | 132 | $this->expectExceptionMessage( |
| 133 | - 'Entity \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' has to be part of the discriminator map' |
|
| 133 | + 'Entity \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' has to be part of the discriminator map' |
|
| 134 | 134 | . ' of \'Doctrine\Tests\ORM\Mapping\HierarchyBase\' to be properly mapped in the inheritance hierarchy.' |
| 135 | 135 | . ' Alternatively you can make \'Doctrine\Tests\ORM\Mapping\HierarchyBEntity\' an abstract class to' |
| 136 | 136 | . ' avoid this exception from occurring.' |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
| 6 | 6 | |
@@ -24,18 +24,18 @@ |
||
| 24 | 24 | public $avatar; |
| 25 | 25 | |
| 26 | 26 | public function getId() { |
| 27 | - return $this->id; |
|
| 27 | + return $this->id; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function getUsername() { |
| 31 | - return $this->username; |
|
| 31 | + return $this->username; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function getAvatar() { |
| 35 | - return $this->avatar; |
|
| 35 | + return $this->avatar; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public function setAvatar(ForumAvatar $avatar) { |
| 39 | - $this->avatar = $avatar; |
|
| 39 | + $this->avatar = $avatar; |
|
| 40 | 40 | } |
| 41 | 41 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\Models\Forum; |
| 6 | 6 | |
@@ -25,12 +25,12 @@ |
||
| 25 | 25 | |
| 26 | 26 | if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) { |
| 27 | 27 | $this->fail( |
| 28 | - sprintf( |
|
| 28 | + sprintf( |
|
| 29 | 29 | 'expected running time: <= %s but was: %s', |
| 30 | 30 | |
| 31 | 31 | $this->maxRunningTime, |
| 32 | 32 | $time |
| 33 | - ) |
|
| 33 | + ) |
|
| 34 | 34 | ); |
| 35 | 35 | } |
| 36 | 36 | } |
@@ -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\Tests; |
| 6 | 6 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function setMaxRunningTime($maxRunningTime) |
| 50 | 50 | { |
| 51 | - if (! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
| 51 | + if ( ! (is_int($maxRunningTime) && $maxRunningTime >= 0)) { |
|
| 52 | 52 | throw new \InvalidArgumentException; |
| 53 | 53 | } |
| 54 | 54 | |
@@ -23,7 +23,6 @@ |
||
| 23 | 23 | namespace Doctrine\ORM\Cache; |
| 24 | 24 | |
| 25 | 25 | use Doctrine\Common\Util\ClassUtils; |
| 26 | - |
|
| 27 | 26 | use Doctrine\ORM\Mapping\FetchMode; |
| 28 | 27 | use Doctrine\ORM\Mapping\FieldMetadata; |
| 29 | 28 | use Doctrine\ORM\Mapping\OneToOneAssociationMetadata; |
@@ -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\Cache; |
| 24 | 24 | |
@@ -76,11 +76,11 @@ discard block |
||
| 76 | 76 | $data = array_merge($data, $persister->getIdentifier($entity)); // why update has no identifier values ? |
| 77 | 77 | |
| 78 | 78 | foreach ($metadata->getProperties() as $name => $association) { |
| 79 | - if (! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
| 79 | + if ( ! isset($data[$name]) || $association instanceof FieldMetadata) { |
|
| 80 | 80 | continue; |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | - if (! $association instanceof ToOneAssociationMetadata) { |
|
| 83 | + if ( ! $association instanceof ToOneAssociationMetadata) { |
|
| 84 | 84 | unset($data[$name]); |
| 85 | 85 | |
| 86 | 86 | continue; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $targetClassMetadata = $this->em->getClassMetadata($targetEntity); |
| 91 | 91 | $targetPersister = $this->uow->getEntityPersister($targetEntity); |
| 92 | 92 | |
| 93 | - if (! $association->getCache()) { |
|
| 93 | + if ( ! $association->getCache()) { |
|
| 94 | 94 | $owningAssociation = ! $association->isOwningSide() |
| 95 | 95 | ? $targetClassMetadata->getProperty($association->getMappedBy()) |
| 96 | 96 | : $association; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | continue; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - if (! $association->isPrimaryKey()) { |
|
| 141 | + if ( ! $association->isPrimaryKey()) { |
|
| 142 | 142 | $targetClass = ClassUtils::getClass($data[$name]); |
| 143 | 143 | $targetId = $this->uow->getEntityIdentifier($data[$name]); |
| 144 | 144 | $data[$name] = new AssociationCacheEntry($targetClass, $targetId); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | ($association instanceof OneToOneAssociationMetadata && ! $association->isOwningSide()) |
| 189 | 189 | ); |
| 190 | 190 | |
| 191 | - if (! $isEagerLoad) { |
|
| 191 | + if ( ! $isEagerLoad) { |
|
| 192 | 192 | $data[$name] = $this->em->getReference($assocClass, $assocId); |
| 193 | 193 | |
| 194 | 194 | continue; |
@@ -45,6 +45,7 @@ |
||
| 45 | 45 | * {@inheritDoc} |
| 46 | 46 | * |
| 47 | 47 | * @param MultiGetCache $cache |
| 48 | + * @param string $name |
|
| 48 | 49 | */ |
| 49 | 50 | public function __construct($name, MultiGetCache $cache, $lifetime = 0) |
| 50 | 51 | { |
@@ -18,7 +18,7 @@ |
||
| 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\Cache\Region; |
| 24 | 24 | |
@@ -23,7 +23,6 @@ |
||
| 23 | 23 | |
| 24 | 24 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 25 | 25 | use PDO; |
| 26 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 27 | 26 | |
| 28 | 27 | /** |
| 29 | 28 | * The ArrayHydrator produces a nested array "graph" that is often (not always) |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * <http://www.doctrine-project.org>. |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -declare(strict_types=1); |
|
| 20 | +declare(strict_types = 1); |
|
| 21 | 21 | |
| 22 | 22 | namespace Doctrine\ORM\Internal\Hydration; |
| 23 | 23 | |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | // It's a joined result |
| 112 | 112 | |
| 113 | 113 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 114 | - $path = $parent . '.' . $dqlAlias; |
|
| 114 | + $path = $parent.'.'.$dqlAlias; |
|
| 115 | 115 | |
| 116 | 116 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
| 117 | - if ( ! isset($nonemptyComponents[$parent]) ) { |
|
| 117 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
| 118 | 118 | continue; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -123,9 +123,9 @@ discard block |
||
| 123 | 123 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
| 124 | 124 | $first = reset($this->resultPointers); |
| 125 | 125 | // TODO: Exception if $key === null ? |
| 126 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
| 126 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
| 127 | 127 | } else if (isset($this->resultPointers[$parent])) { |
| 128 | - $baseElement =& $this->resultPointers[$parent]; |
|
| 128 | + $baseElement = & $this->resultPointers[$parent]; |
|
| 129 | 129 | } else { |
| 130 | 130 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
| 131 | 131 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | $relation = $parentClass->getProperty($relationAlias); |
| 138 | 138 | |
| 139 | 139 | // Check the type of the relation (many or single-valued) |
| 140 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
| 140 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
| 141 | 141 | $oneToOne = false; |
| 142 | 142 | |
| 143 | 143 | if ( ! isset($baseElement[$relationAlias])) { |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - $coll =& $baseElement[$relationAlias]; |
|
| 179 | + $coll = & $baseElement[$relationAlias]; |
|
| 180 | 180 | |
| 181 | 181 | if (is_array($coll)) { |
| 182 | 182 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 189 | 189 | |
| 190 | 190 | // if this row has a NULL value for the root result id then make it a null result. |
| 191 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 191 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 192 | 192 | $result[] = $this->rsm->isMixed |
| 193 | 193 | ? [$entityKey => null] |
| 194 | 194 | : null; |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $resultKey = $this->resultCounter - 1; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
| 252 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
| 253 | 253 | |
| 254 | 254 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
| 255 | 255 | $class = $newObject['class']; |
@@ -287,13 +287,13 @@ discard block |
||
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | if ($oneToOne) { |
| 290 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
| 290 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
| 291 | 291 | |
| 292 | 292 | return; |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | if ($index !== false) { |
| 296 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
| 296 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
| 297 | 297 | |
| 298 | 298 | return; |
| 299 | 299 | } |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | end($coll); |
| 306 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
| 306 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
| 307 | 307 | |
| 308 | 308 | return; |
| 309 | 309 | } |
@@ -25,8 +25,6 @@ |
||
| 25 | 25 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
| 26 | 26 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 27 | 27 | use PDO; |
| 28 | -use Doctrine\Common\Collections\ArrayCollection; |
|
| 29 | -use Doctrine\ORM\Event\PostLoadEventDispatcher; |
|
| 30 | 28 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 31 | 29 | use Doctrine\ORM\PersistentCollection; |
| 32 | 30 | use Doctrine\ORM\Proxy\Proxy; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * <http://www.doctrine-project.org>. |
| 18 | 18 | */ |
| 19 | 19 | |
| 20 | -declare(strict_types=1); |
|
| 20 | +declare(strict_types = 1); |
|
| 21 | 21 | |
| 22 | 22 | namespace Doctrine\ORM\Internal\Hydration; |
| 23 | 23 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | */ |
| 86 | 86 | protected function prepare() |
| 87 | 87 | { |
| 88 | - if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
| 88 | + if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
| 89 | 89 | $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true; |
| 90 | 90 | } |
| 91 | 91 | |
@@ -95,13 +95,13 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // Remember which associations are "fetch joined", so that we know where to inject |
| 97 | 97 | // collection stubs or proxies and where not. |
| 98 | - if (! isset($this->rsm->relationMap[$dqlAlias])) { |
|
| 98 | + if ( ! isset($this->rsm->relationMap[$dqlAlias])) { |
|
| 99 | 99 | continue; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 103 | 103 | |
| 104 | - if (! isset($this->rsm->aliasMap[$parent])) { |
|
| 104 | + if ( ! isset($this->rsm->aliasMap[$parent])) { |
|
| 105 | 105 | throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $class = $this->getClassMetadata($className); |
| 128 | 128 | $inverseAssoc = $class->getProperty($association->getInversedBy()); |
| 129 | 129 | |
| 130 | - if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
| 130 | + if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
| 131 | 131 | continue; |
| 132 | 132 | } |
| 133 | 133 | |
@@ -193,14 +193,14 @@ discard block |
||
| 193 | 193 | $value = $association->getValue($entity); |
| 194 | 194 | $oid = spl_object_hash($entity); |
| 195 | 195 | |
| 196 | - if (! $value instanceof PersistentCollection) { |
|
| 196 | + if ( ! $value instanceof PersistentCollection) { |
|
| 197 | 197 | $value = $association->wrap($entity, $value, $this->em); |
| 198 | 198 | |
| 199 | 199 | $association->setValue($entity, $value); |
| 200 | 200 | |
| 201 | 201 | $this->uow->setOriginalEntityProperty($oid, $fieldName, $value); |
| 202 | 202 | |
| 203 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 203 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 204 | 204 | } else if ( |
| 205 | 205 | isset($this->hints[Query::HINT_REFRESH]) || |
| 206 | 206 | (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized()) |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | $value->setInitialized(true); |
| 211 | 211 | $value->unwrap()->clear(); |
| 212 | 212 | |
| 213 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 213 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 214 | 214 | } else { |
| 215 | 215 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
| 216 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
| 216 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | return $value; |
@@ -331,10 +331,10 @@ discard block |
||
| 331 | 331 | $parentAlias = $this->rsm->parentAliasMap[$dqlAlias]; |
| 332 | 332 | // we need the $path to save into the identifier map which entities were already |
| 333 | 333 | // seen for this parent-child relationship |
| 334 | - $path = $parentAlias . '.' . $dqlAlias; |
|
| 334 | + $path = $parentAlias.'.'.$dqlAlias; |
|
| 335 | 335 | |
| 336 | 336 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
| 337 | - if (! isset($nonemptyComponents[$parentAlias])) { |
|
| 337 | + if ( ! isset($nonemptyComponents[$parentAlias])) { |
|
| 338 | 338 | // TODO: Add special case code where we hydrate the right join objects into identity map at least |
| 339 | 339 | continue; |
| 340 | 340 | } |
@@ -365,15 +365,15 @@ discard block |
||
| 365 | 365 | $oid = spl_object_hash($parentObject); |
| 366 | 366 | |
| 367 | 367 | // Check the type of the relation (many or single-valued) |
| 368 | - if (! ($association instanceof ToOneAssociationMetadata)) { |
|
| 368 | + if ( ! ($association instanceof ToOneAssociationMetadata)) { |
|
| 369 | 369 | // PATH A: Collection-valued association |
| 370 | 370 | $reflFieldValue = $association->getValue($parentObject); |
| 371 | 371 | |
| 372 | 372 | if (isset($nonemptyComponents[$dqlAlias])) { |
| 373 | - $collKey = $oid . $relationField; |
|
| 373 | + $collKey = $oid.$relationField; |
|
| 374 | 374 | if (isset($this->initializedCollections[$collKey])) { |
| 375 | 375 | $reflFieldValue = $this->initializedCollections[$collKey]; |
| 376 | - } else if (! isset($this->existingCollections[$collKey])) { |
|
| 376 | + } else if ( ! isset($this->existingCollections[$collKey])) { |
|
| 377 | 377 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
| 378 | 378 | } |
| 379 | 379 | |
@@ -381,7 +381,7 @@ discard block |
||
| 381 | 381 | $index = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false; |
| 382 | 382 | $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false; |
| 383 | 383 | |
| 384 | - if (! $indexExists || ! $indexIsValid) { |
|
| 384 | + if ( ! $indexExists || ! $indexIsValid) { |
|
| 385 | 385 | if (isset($this->existingCollections[$collKey])) { |
| 386 | 386 | // Collection exists, only look for the element in the identity map. |
| 387 | 387 | if ($element = $this->getEntityFromIdentityMap($entityName, $data)) { |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | // PATH B: Single-valued association |
| 418 | 418 | $reflFieldValue = $association->getValue($parentObject); |
| 419 | 419 | |
| 420 | - if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
| 420 | + if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
| 421 | 421 | ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized())) { |
| 422 | 422 | // we only need to take action if this value is null, |
| 423 | 423 | // we refresh the entity or its an uninitialized proxy. |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 479 | 479 | |
| 480 | 480 | // if this row has a NULL value for the root result id then make it a null result. |
| 481 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 481 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 482 | 482 | if ($this->rsm->isMixed) { |
| 483 | 483 | $result[] = [$entityKey => null]; |
| 484 | 484 | } else { |
@@ -534,13 +534,13 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | - if ( ! isset($resultKey) ) { |
|
| 537 | + if ( ! isset($resultKey)) { |
|
| 538 | 538 | $this->resultCounter++; |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | // Append scalar values to mixed result sets |
| 542 | 542 | if (isset($rowData['scalars'])) { |
| 543 | - if ( ! isset($resultKey) ) { |
|
| 543 | + if ( ! isset($resultKey)) { |
|
| 544 | 544 | $resultKey = (isset($this->rsm->indexByMap['scalars'])) |
| 545 | 545 | ? $row[$this->rsm->indexByMap['scalars']] |
| 546 | 546 | : $this->resultCounter - 1; |
@@ -553,19 +553,19 @@ discard block |
||
| 553 | 553 | |
| 554 | 554 | // Append new object to mixed result sets |
| 555 | 555 | if (isset($rowData['newObjects'])) { |
| 556 | - if ( ! isset($resultKey) ) { |
|
| 556 | + if ( ! isset($resultKey)) { |
|
| 557 | 557 | $resultKey = $this->resultCounter - 1; |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | |
| 561 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
| 561 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
| 562 | 562 | |
| 563 | 563 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
| 564 | 564 | $class = $newObject['class']; |
| 565 | 565 | $args = $newObject['args']; |
| 566 | 566 | $obj = $class->newInstanceArgs($args); |
| 567 | 567 | |
| 568 | - if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) { |
|
| 568 | + if ($scalarCount == 0 && count($rowData['newObjects']) == 1) { |
|
| 569 | 569 | $result[$resultKey] = $obj; |
| 570 | 570 | |
| 571 | 571 | continue; |
@@ -156,7 +156,7 @@ |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
| 159 | - * @return array |
|
| 159 | + * @return string[] |
|
| 160 | 160 | */ |
| 161 | 161 | public function getCascade() |
| 162 | 162 | { |
@@ -18,7 +18,7 @@ |
||
| 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; |
| 24 | 24 | |
@@ -1278,7 +1278,7 @@ |
||
| 1278 | 1278 | * |
| 1279 | 1279 | * @todo guilhermeblanco Only used for ClassMetadataTest. Remove if possible! |
| 1280 | 1280 | * |
| 1281 | - * @param array $subclasses The names of all mapped subclasses. |
|
| 1281 | + * @param string[] $subclasses The names of all mapped subclasses. |
|
| 1282 | 1282 | * |
| 1283 | 1283 | * @return void |
| 1284 | 1284 | */ |
@@ -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; |
| 24 | 24 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | * |
| 331 | 331 | * @return void |
| 332 | 332 | */ |
| 333 | - public function setCache(?CacheMetadata $cache = null) |
|
| 333 | + public function setCache(? CacheMetadata $cache = null) |
|
| 334 | 334 | { |
| 335 | 335 | $this->cache = $cache; |
| 336 | 336 | } |
@@ -338,7 +338,7 @@ discard block |
||
| 338 | 338 | /** |
| 339 | 339 | * @return CacheMetadata|null |
| 340 | 340 | */ |
| 341 | - public function getCache(): ?CacheMetadata |
|
| 341 | + public function getCache(): ? CacheMetadata |
|
| 342 | 342 | { |
| 343 | 343 | return $this->cache; |
| 344 | 344 | } |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | /** |
| 347 | 347 | * @return \ReflectionClass|null |
| 348 | 348 | */ |
| 349 | - public function getReflectionClass() : ?\ReflectionClass |
|
| 349 | + public function getReflectionClass() : ? \ReflectionClass |
|
| 350 | 350 | { |
| 351 | 351 | return $this->reflectionClass; |
| 352 | 352 | } |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | */ |
| 375 | 375 | public function __toString() |
| 376 | 376 | { |
| 377 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
| 377 | + return __CLASS__.'@'.spl_object_hash($this); |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | /** |
@@ -478,7 +478,7 @@ discard block |
||
| 478 | 478 | // Restore ReflectionClass and properties |
| 479 | 479 | $this->reflectionClass = $reflService->getClass($this->name); |
| 480 | 480 | |
| 481 | - if (! $this->reflectionClass) { |
|
| 481 | + if ( ! $this->reflectionClass) { |
|
| 482 | 482 | return; |
| 483 | 483 | } |
| 484 | 484 | |
@@ -553,11 +553,11 @@ discard block |
||
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | // Verify & complete identifier mapping |
| 556 | - if (! $this->identifier) { |
|
| 556 | + if ( ! $this->identifier) { |
|
| 557 | 557 | throw MappingException::identifierRequired($this->name); |
| 558 | 558 | } |
| 559 | 559 | |
| 560 | - $explicitlyGeneratedProperties = array_filter($this->properties, function (Property $property) : bool { |
|
| 560 | + $explicitlyGeneratedProperties = array_filter($this->properties, function(Property $property) : bool { |
|
| 561 | 561 | return $property instanceof FieldMetadata |
| 562 | 562 | && $property->isPrimaryKey() |
| 563 | 563 | && $property->hasValueGenerator(); |
@@ -578,8 +578,8 @@ discard block |
||
| 578 | 578 | public function validateAssociations() |
| 579 | 579 | { |
| 580 | 580 | array_map( |
| 581 | - function (Property $property) { |
|
| 582 | - if (! ($property instanceof AssociationMetadata)) { |
|
| 581 | + function(Property $property) { |
|
| 582 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
| 583 | 583 | return; |
| 584 | 584 | } |
| 585 | 585 | |
@@ -635,11 +635,11 @@ discard block |
||
| 635 | 635 | */ |
| 636 | 636 | public function isIdentifier($fieldName) |
| 637 | 637 | { |
| 638 | - if (! $this->identifier) { |
|
| 638 | + if ( ! $this->identifier) { |
|
| 639 | 639 | return false; |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | - if (! $this->isIdentifierComposite()) { |
|
| 642 | + if ( ! $this->isIdentifierComposite()) { |
|
| 643 | 643 | return $fieldName === $this->identifier[0]; |
| 644 | 644 | } |
| 645 | 645 | |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | */ |
| 668 | 668 | public function getNamedQuery($queryName) |
| 669 | 669 | { |
| 670 | - if (! isset($this->namedQueries[$queryName])) { |
|
| 670 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
| 671 | 671 | throw MappingException::queryNotFound($this->name, $queryName); |
| 672 | 672 | } |
| 673 | 673 | |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | */ |
| 728 | 728 | public function getSqlResultSetMapping($name) |
| 729 | 729 | { |
| 730 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
| 730 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
| 731 | 731 | throw MappingException::resultMappingNotFound($this->name, $name); |
| 732 | 732 | } |
| 733 | 733 | |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | $property->setColumnName($columnName); |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | - if (! $this->isMappedSuperclass) { |
|
| 765 | + if ( ! $this->isMappedSuperclass) { |
|
| 766 | 766 | $property->setTableName($this->getTableName()); |
| 767 | 767 | } |
| 768 | 768 | |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
| 783 | 783 | }; |
| 784 | 784 | |
| 785 | - if (! in_array($fieldName, $this->identifier)) { |
|
| 785 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
| 786 | 786 | $this->identifier[] = $fieldName; |
| 787 | 787 | } |
| 788 | 788 | } |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | $fieldName = $property->getName(); |
| 837 | 837 | $targetEntity = $property->getTargetEntity(); |
| 838 | 838 | |
| 839 | - if (! $targetEntity) { |
|
| 839 | + if ( ! $targetEntity) { |
|
| 840 | 840 | throw MappingException::missingTargetEntity($fieldName); |
| 841 | 841 | } |
| 842 | 842 | |
@@ -867,7 +867,7 @@ discard block |
||
| 867 | 867 | $this->identifier[] = $property->getName(); |
| 868 | 868 | } |
| 869 | 869 | |
| 870 | - if ($this->cache && !$property->getCache()) { |
|
| 870 | + if ($this->cache && ! $property->getCache()) { |
|
| 871 | 871 | throw CacheException::nonCacheableEntityAssociation($this->name, $fieldName); |
| 872 | 872 | } |
| 873 | 873 | |
@@ -920,7 +920,7 @@ discard block |
||
| 920 | 920 | foreach ($property->getJoinColumns() as $joinColumn) { |
| 921 | 921 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
| 922 | 922 | if (1 === count($property->getJoinColumns())) { |
| 923 | - if (! $property->isPrimaryKey()) { |
|
| 923 | + if ( ! $property->isPrimaryKey()) { |
|
| 924 | 924 | $joinColumn->setUnique(true); |
| 925 | 925 | } |
| 926 | 926 | } else { |
@@ -928,13 +928,13 @@ discard block |
||
| 928 | 928 | } |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 931 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 932 | 932 | |
| 933 | - if (! $joinColumn->getColumnName()) { |
|
| 933 | + if ( ! $joinColumn->getColumnName()) { |
|
| 934 | 934 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->name)); |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 937 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 938 | 938 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 939 | 939 | } |
| 940 | 940 | |
@@ -962,7 +962,7 @@ discard block |
||
| 962 | 962 | if ($property->isOrphanRemoval()) { |
| 963 | 963 | $cascades = $property->getCascade(); |
| 964 | 964 | |
| 965 | - if (! in_array('remove', $cascades)) { |
|
| 965 | + if ( ! in_array('remove', $cascades)) { |
|
| 966 | 966 | $cascades[] = 'remove'; |
| 967 | 967 | |
| 968 | 968 | $property->setCascade($cascades); |
@@ -1030,14 +1030,14 @@ discard block |
||
| 1030 | 1030 | $property->setOwningSide(false); |
| 1031 | 1031 | |
| 1032 | 1032 | // OneToMany MUST have mappedBy |
| 1033 | - if (! $property->getMappedBy()) { |
|
| 1033 | + if ( ! $property->getMappedBy()) { |
|
| 1034 | 1034 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | 1037 | if ($property->isOrphanRemoval()) { |
| 1038 | 1038 | $cascades = $property->getCascade(); |
| 1039 | 1039 | |
| 1040 | - if (! in_array('remove', $cascades)) { |
|
| 1040 | + if ( ! in_array('remove', $cascades)) { |
|
| 1041 | 1041 | $cascades[] = 'remove'; |
| 1042 | 1042 | |
| 1043 | 1043 | $property->setCascade($cascades); |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | |
| 1061 | 1061 | $property->setJoinTable($joinTable); |
| 1062 | 1062 | |
| 1063 | - if (! $joinTable->getName()) { |
|
| 1063 | + if ( ! $joinTable->getName()) { |
|
| 1064 | 1064 | $joinTableName = $this->namingStrategy->joinTableName( |
| 1065 | 1065 | $property->getSourceEntity(), |
| 1066 | 1066 | $property->getTargetEntity(), |
@@ -1072,7 +1072,7 @@ discard block |
||
| 1072 | 1072 | |
| 1073 | 1073 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
| 1074 | 1074 | |
| 1075 | - if (! $joinTable->getJoinColumns()) { |
|
| 1075 | + if ( ! $joinTable->getJoinColumns()) { |
|
| 1076 | 1076 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 1077 | 1077 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
| 1078 | 1078 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -1085,7 +1085,7 @@ discard block |
||
| 1085 | 1085 | $joinTable->addJoinColumn($joinColumn); |
| 1086 | 1086 | } |
| 1087 | 1087 | |
| 1088 | - if (! $joinTable->getInverseJoinColumns()) { |
|
| 1088 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
| 1089 | 1089 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 1090 | 1090 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
| 1091 | 1091 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -1099,13 +1099,13 @@ discard block |
||
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | 1101 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 1102 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 1102 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 1103 | 1103 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1107 | 1107 | |
| 1108 | - if (! $joinColumn->getColumnName()) { |
|
| 1108 | + if ( ! $joinColumn->getColumnName()) { |
|
| 1109 | 1109 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 1110 | 1110 | $property->getSourceEntity(), |
| 1111 | 1111 | $referencedColumnName |
@@ -1116,13 +1116,13 @@ discard block |
||
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
| 1119 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 1119 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 1120 | 1120 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 1121 | 1121 | } |
| 1122 | 1122 | |
| 1123 | 1123 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
| 1124 | 1124 | |
| 1125 | - if (! $inverseJoinColumn->getColumnName()) { |
|
| 1125 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
| 1126 | 1126 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 1127 | 1127 | $property->getTargetEntity(), |
| 1128 | 1128 | $referencedColumnName |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | // Association defined as Id field |
| 1216 | 1216 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1217 | 1217 | |
| 1218 | - if (! $property->isOwningSide()) { |
|
| 1218 | + if ( ! $property->isOwningSide()) { |
|
| 1219 | 1219 | $property = $targetClass->getProperty($property->getMappedBy()); |
| 1220 | 1220 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1221 | 1221 | } |
@@ -1266,11 +1266,11 @@ discard block |
||
| 1266 | 1266 | { |
| 1267 | 1267 | $schema = empty($this->getSchemaName()) |
| 1268 | 1268 | ? '' |
| 1269 | - : $this->getSchemaName() . '_' |
|
| 1269 | + : $this->getSchemaName().'_' |
|
| 1270 | 1270 | ; |
| 1271 | 1271 | |
| 1272 | 1272 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 1273 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
| 1273 | + return $schema.$this->getTableName().'_id_tmp'; |
|
| 1274 | 1274 | } |
| 1275 | 1275 | |
| 1276 | 1276 | /** |
@@ -1356,7 +1356,7 @@ discard block |
||
| 1356 | 1356 | { |
| 1357 | 1357 | $fieldName = $property->getName(); |
| 1358 | 1358 | |
| 1359 | - if (! isset($this->properties[$fieldName])) { |
|
| 1359 | + if ( ! isset($this->properties[$fieldName])) { |
|
| 1360 | 1360 | throw MappingException::invalidOverrideFieldName($this->name, $fieldName); |
| 1361 | 1361 | } |
| 1362 | 1362 | |
@@ -1476,7 +1476,7 @@ discard block |
||
| 1476 | 1476 | * |
| 1477 | 1477 | * @return LocalColumnMetadata|null |
| 1478 | 1478 | */ |
| 1479 | - public function getColumn(string $columnName): ?LocalColumnMetadata |
|
| 1479 | + public function getColumn(string $columnName): ? LocalColumnMetadata |
|
| 1480 | 1480 | { |
| 1481 | 1481 | foreach ($this->properties as $property) { |
| 1482 | 1482 | if ($property instanceof LocalColumnMetadata && $property->getColumnName() === $columnName) { |
@@ -1583,7 +1583,7 @@ discard block |
||
| 1583 | 1583 | $declaringClass = $property->getDeclaringClass(); |
| 1584 | 1584 | |
| 1585 | 1585 | if ($inheritedProperty instanceof FieldMetadata) { |
| 1586 | - if (! $declaringClass->isMappedSuperclass) { |
|
| 1586 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
| 1587 | 1587 | $inheritedProperty->setTableName($property->getTableName()); |
| 1588 | 1588 | } |
| 1589 | 1589 | |
@@ -1641,7 +1641,7 @@ discard block |
||
| 1641 | 1641 | throw MappingException::duplicateQueryMapping($this->name, $name); |
| 1642 | 1642 | } |
| 1643 | 1643 | |
| 1644 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1644 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1645 | 1645 | throw MappingException::missingQueryMapping($this->name, $name); |
| 1646 | 1646 | } |
| 1647 | 1647 | |
@@ -1664,7 +1664,7 @@ discard block |
||
| 1664 | 1664 | */ |
| 1665 | 1665 | public function addSqlResultSetMapping(array $resultMapping) |
| 1666 | 1666 | { |
| 1667 | - if (!isset($resultMapping['name'])) { |
|
| 1667 | + if ( ! isset($resultMapping['name'])) { |
|
| 1668 | 1668 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
| 1669 | 1669 | } |
| 1670 | 1670 | |
@@ -1674,7 +1674,7 @@ discard block |
||
| 1674 | 1674 | |
| 1675 | 1675 | if (isset($resultMapping['entities'])) { |
| 1676 | 1676 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
| 1677 | - if (! isset($entityResult['entityClass'])) { |
|
| 1677 | + if ( ! isset($entityResult['entityClass'])) { |
|
| 1678 | 1678 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
| 1679 | 1679 | } |
| 1680 | 1680 | |
@@ -1687,11 +1687,11 @@ discard block |
||
| 1687 | 1687 | |
| 1688 | 1688 | if (isset($entityResult['fields'])) { |
| 1689 | 1689 | foreach ($entityResult['fields'] as $k => $field) { |
| 1690 | - if (! isset($field['name'])) { |
|
| 1690 | + if ( ! isset($field['name'])) { |
|
| 1691 | 1691 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
| 1692 | 1692 | } |
| 1693 | 1693 | |
| 1694 | - if (! isset($field['column'])) { |
|
| 1694 | + if ( ! isset($field['column'])) { |
|
| 1695 | 1695 | $fieldName = $field['name']; |
| 1696 | 1696 | |
| 1697 | 1697 | if (strpos($fieldName, '.')) { |
@@ -1715,7 +1715,7 @@ discard block |
||
| 1715 | 1715 | * |
| 1716 | 1716 | * @return void |
| 1717 | 1717 | */ |
| 1718 | - public function setCustomRepositoryClassName(?string $repositoryClassName) |
|
| 1718 | + public function setCustomRepositoryClassName(? string $repositoryClassName) |
|
| 1719 | 1719 | { |
| 1720 | 1720 | $this->customRepositoryClassName = $repositoryClassName; |
| 1721 | 1721 | } |
@@ -1723,7 +1723,7 @@ discard block |
||
| 1723 | 1723 | /** |
| 1724 | 1724 | * @return string|null |
| 1725 | 1725 | */ |
| 1726 | - public function getCustomRepositoryClassName() : ?string |
|
| 1726 | + public function getCustomRepositoryClassName() : ? string |
|
| 1727 | 1727 | { |
| 1728 | 1728 | return $this->customRepositoryClassName; |
| 1729 | 1729 | } |
@@ -1798,11 +1798,11 @@ discard block |
||
| 1798 | 1798 | 'method' => $method, |
| 1799 | 1799 | ]; |
| 1800 | 1800 | |
| 1801 | - if (! class_exists($class)) { |
|
| 1801 | + if ( ! class_exists($class)) { |
|
| 1802 | 1802 | throw MappingException::entityListenerClassNotFound($class, $this->name); |
| 1803 | 1803 | } |
| 1804 | 1804 | |
| 1805 | - if (! method_exists($class, $method)) { |
|
| 1805 | + if ( ! method_exists($class, $method)) { |
|
| 1806 | 1806 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->name); |
| 1807 | 1807 | } |
| 1808 | 1808 | |
@@ -1876,7 +1876,7 @@ discard block |
||
| 1876 | 1876 | return; |
| 1877 | 1877 | } |
| 1878 | 1878 | |
| 1879 | - if (! (class_exists($className) || interface_exists($className))) { |
|
| 1879 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
| 1880 | 1880 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->name); |
| 1881 | 1881 | } |
| 1882 | 1882 | |
@@ -1973,7 +1973,7 @@ discard block |
||
| 1973 | 1973 | $namespace = $this->reflectionClass->getNamespaceName(); |
| 1974 | 1974 | |
| 1975 | 1975 | if ($className !== null && strpos($className, '\\') === false && $namespace) { |
| 1976 | - return ltrim($namespace . '\\' . $className, '\\'); |
|
| 1976 | + return ltrim($namespace.'\\'.$className, '\\'); |
|
| 1977 | 1977 | } |
| 1978 | 1978 | |
| 1979 | 1979 | return ltrim($className, '\\'); |