@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Doctrine\ORM\Internal\Hydration\Cache; |
| 5 | 5 | |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | // Note: the reason why we use dynamic access to create a private-ish property is |
| 17 | 17 | // that we do not want this property to be statically defined. If that |
| 18 | 18 | // happens, then a consumer of `__get` may access it, and that's no good |
| 19 | - $this->{self::class . "\0callback"} = $instantiate; |
|
| 19 | + $this->{self::class."\0callback"} = $instantiate; |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | /** |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function __get(string $name) |
| 28 | 28 | { |
| 29 | - $this->$name = ($this->{self::class . "\0callback"})($name); |
|
| 29 | + $this->$name = ($this->{self::class."\0callback"})($name); |
|
| 30 | 30 | |
| 31 | 31 | return $this->$name; |
| 32 | 32 | } |
@@ -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 LazyMapTest; |
| 6 | 6 | |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | ->callback |
| 41 | 41 | ->expects(self::exactly(3)) |
| 42 | 42 | ->method('__invoke') |
| 43 | - ->will(self::returnCallback(function ($name) use (& $count) { |
|
| 43 | + ->will(self::returnCallback(function($name) use (& $count) { |
|
| 44 | 44 | $count += 1; |
| 45 | 45 | |
| 46 | - return $name . ' - ' . $count; |
|
| 46 | + return $name.' - '.$count; |
|
| 47 | 47 | })); |
| 48 | 48 | |
| 49 | 49 | $this->assertSame('foo - 1', $this->lazyMap->foo); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | public function init() : void |
| 35 | 35 | { |
| 36 | - $this->initializer = function (string $name) : stdClass { |
|
| 36 | + $this->initializer = function(string $name) : stdClass { |
|
| 37 | 37 | return (object) [$name => true]; |
| 38 | 38 | }; |
| 39 | 39 | $this->lazyMap = new LazyPropertyMap($this->initializer); |
@@ -60,14 +60,14 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | public function benchUninitializedPropertyAccess() : stdClass |
| 62 | 62 | { |
| 63 | - $key = 'key' . $this->currentKey++; |
|
| 63 | + $key = 'key'.$this->currentKey++; |
|
| 64 | 64 | |
| 65 | 65 | return $this->lazyMap->$key; |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | public function benchUninitializedArrayAccess() : stdClass |
| 69 | 69 | { |
| 70 | - $key = 'key' . $this->currentKey++; |
|
| 70 | + $key = 'key'.$this->currentKey++; |
|
| 71 | 71 | |
| 72 | 72 | return $this->array[$key] ?? $this->array[$key] = ($this->initializer)($key); |
| 73 | 73 | } |
@@ -25,7 +25,6 @@ |
||
| 25 | 25 | use Doctrine\ORM\PersistentCollection; |
| 26 | 26 | use Doctrine\ORM\Query; |
| 27 | 27 | use Doctrine\Common\Collections\ArrayCollection; |
| 28 | -use Doctrine\ORM\Proxy\Proxy; |
|
| 29 | 28 | |
| 30 | 29 | /** |
| 31 | 30 | * The ObjectHydrator constructs an object graph out of an SQL result set. |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $sourceClassName = $this->_rsm->aliasMap[$parent]; |
| 108 | 108 | $sourceClass = $this->getClassMetadata($sourceClassName); |
| 109 | - $assoc = $sourceClass->associationMappings[$this->_rsm->relationMap[$dqlAlias]]; |
|
| 109 | + $assoc = $sourceClass->associationMappings[$this->_rsm->relationMap[$dqlAlias]]; |
|
| 110 | 110 | |
| 111 | 111 | $this->_hints['fetched'][$parent][$assoc['fieldName']] = true; |
| 112 | 112 | |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $class->reflFields[$fieldName]->setValue($entity, $value); |
| 205 | 205 | $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value); |
| 206 | 206 | |
| 207 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 207 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 208 | 208 | } else if ( |
| 209 | 209 | isset($this->_hints[Query::HINT_REFRESH]) || |
| 210 | 210 | isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) && |
@@ -215,10 +215,10 @@ discard block |
||
| 215 | 215 | $value->setInitialized(true); |
| 216 | 216 | $value->unwrap()->clear(); |
| 217 | 217 | |
| 218 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 218 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 219 | 219 | } else { |
| 220 | 220 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
| 221 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
| 221 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | return $value; |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | $idHash = ''; |
| 299 | 299 | |
| 300 | 300 | foreach ($class->identifier as $fieldName) { |
| 301 | - $idHash .= ' ' . (isset($class->associationMappings[$fieldName]) |
|
| 301 | + $idHash .= ' '.(isset($class->associationMappings[$fieldName]) |
|
| 302 | 302 | ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']] |
| 303 | 303 | : $data[$fieldName]); |
| 304 | 304 | } |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias]; |
| 355 | 355 | // we need the $path to save into the identifier map which entities were already |
| 356 | 356 | // seen for this parent-child relationship |
| 357 | - $path = $parentAlias . '.' . $dqlAlias; |
|
| 357 | + $path = $parentAlias.'.'.$dqlAlias; |
|
| 358 | 358 | |
| 359 | 359 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
| 360 | 360 | if ( ! isset($nonemptyComponents[$parentAlias])) { |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | $reflFieldValue = $reflField->getValue($parentObject); |
| 395 | 395 | |
| 396 | 396 | if (isset($nonemptyComponents[$dqlAlias])) { |
| 397 | - $collKey = $oid . $relationField; |
|
| 397 | + $collKey = $oid.$relationField; |
|
| 398 | 398 | if (isset($this->initializedCollections[$collKey])) { |
| 399 | 399 | $reflFieldValue = $this->initializedCollections[$collKey]; |
| 400 | 400 | } else if ( ! isset($this->existingCollections[$collKey])) { |
@@ -486,7 +486,7 @@ discard block |
||
| 486 | 486 | $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; |
| 487 | 487 | |
| 488 | 488 | // if this row has a NULL value for the root result id then make it a null result. |
| 489 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
| 489 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 490 | 490 | if ($this->_rsm->isMixed) { |
| 491 | 491 | $result[] = [$entityKey => null]; |
| 492 | 492 | } else { |
@@ -542,13 +542,13 @@ discard block |
||
| 542 | 542 | } |
| 543 | 543 | } |
| 544 | 544 | |
| 545 | - if ( ! isset($resultKey) ) { |
|
| 545 | + if ( ! isset($resultKey)) { |
|
| 546 | 546 | $this->resultCounter++; |
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | // Append scalar values to mixed result sets |
| 550 | 550 | if (isset($rowData['scalars'])) { |
| 551 | - if ( ! isset($resultKey) ) { |
|
| 551 | + if ( ! isset($resultKey)) { |
|
| 552 | 552 | $resultKey = (isset($this->_rsm->indexByMap['scalars'])) |
| 553 | 553 | ? $row[$this->_rsm->indexByMap['scalars']] |
| 554 | 554 | : $this->resultCounter - 1; |
@@ -561,19 +561,19 @@ discard block |
||
| 561 | 561 | |
| 562 | 562 | // Append new object to mixed result sets |
| 563 | 563 | if (isset($rowData['newObjects'])) { |
| 564 | - if ( ! isset($resultKey) ) { |
|
| 564 | + if ( ! isset($resultKey)) { |
|
| 565 | 565 | $resultKey = $this->resultCounter - 1; |
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | |
| 569 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
| 569 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
| 570 | 570 | |
| 571 | 571 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
| 572 | 572 | $class = $newObject['class']; |
| 573 | 573 | $args = $newObject['args']; |
| 574 | 574 | $obj = $class->newInstanceArgs($args); |
| 575 | 575 | |
| 576 | - if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) { |
|
| 576 | + if ($scalarCount == 0 && count($rowData['newObjects']) == 1) { |
|
| 577 | 577 | $result[$resultKey] = $obj; |
| 578 | 578 | |
| 579 | 579 | continue; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $cm = $this->em->getClassMetadata($entityName); |
| 115 | 115 | |
| 116 | - $generateKeys = function (array $entry) use ($cm): EntityCacheKey { |
|
| 116 | + $generateKeys = function(array $entry) use ($cm): EntityCacheKey { |
|
| 117 | 117 | return new EntityCacheKey($cm->rootEntityName, $entry['identifier']); |
| 118 | 118 | }; |
| 119 | 119 | |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | continue; |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | - $generateKeys = function ($id) use ($assocMetadata): EntityCacheKey { |
|
| 178 | + $generateKeys = function($id) use ($assocMetadata): EntityCacheKey { |
|
| 179 | 179 | return new EntityCacheKey($assocMetadata->rootEntityName, $id); |
| 180 | 180 | }; |
| 181 | 181 | |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | // root entity association |
| 303 | 303 | if ($rootAlias === $parentAlias) { |
| 304 | 304 | // Cancel put result if association put fail |
| 305 | - if ( ($assocInfo = $this->storeAssociationCache($key, $assoc, $assocValue)) === null) { |
|
| 305 | + if (($assocInfo = $this->storeAssociationCache($key, $assoc, $assocValue)) === null) { |
|
| 306 | 306 | return false; |
| 307 | 307 | } |
| 308 | 308 | |