@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | if ($property instanceof AssociationMetadata) { |
| 55 | 55 | throw new \RuntimeException( |
| 56 | - 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. ' . |
|
| 56 | + 'Paginating an entity with foreign key as identifier only works when using the Output Walkers. '. |
|
| 57 | 57 | 'Call Paginator#setUseOutputWalkers(true) before iterating the paginator.' |
| 58 | 58 | ); |
| 59 | 59 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $AST->selectClause->selectExpressions = [new SelectExpression($pathExpression, '_dctrn_id')]; |
| 72 | 72 | $AST->selectClause->isDistinct = true; |
| 73 | 73 | |
| 74 | - if (! isset($AST->orderByClause)) { |
|
| 74 | + if ( ! isset($AST->orderByClause)) { |
|
| 75 | 75 | return; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | if ($item->expression instanceof PathExpression) { |
| 80 | 80 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
| 81 | 81 | $this->createSelectExpressionItem($item->expression), |
| 82 | - '_dctrn_ord' . $this->aliasCounter++ |
|
| 82 | + '_dctrn_ord'.$this->aliasCounter++ |
|
| 83 | 83 | ); |
| 84 | 84 | |
| 85 | 85 | continue; |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | |
| 192 | 192 | $innerSql = $this->getInnerSQL($AST); |
| 193 | 193 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 194 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
| 194 | + $sqlAliasIdentifier = array_map(function($info) { |
|
| 195 | 195 | return $info['alias']; |
| 196 | 196 | }, $sqlIdentifier); |
| 197 | 197 | |
| 198 | 198 | if ($hasOrderBy) { |
| 199 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlAliasIdentifier); |
|
| 200 | - $sqlPiece = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
| 199 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlAliasIdentifier); |
|
| 200 | + $sqlPiece = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
| 201 | 201 | |
| 202 | 202 | $sqlAliasIdentifier[] = $sqlPiece; |
| 203 | 203 | $sqlIdentifier[] = [ |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $sql = sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', implode(', ', $sqlAliasIdentifier), $innerSql); |
| 211 | 211 | |
| 212 | 212 | if ($hasOrderBy) { |
| 213 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
| 213 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | // Apply the limit and offset. |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | $innerSql = $this->getInnerSQL($AST); |
| 256 | 256 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
| 257 | - $sqlAliasIdentifier = array_map(function ($info) { |
|
| 257 | + $sqlAliasIdentifier = array_map(function($info) { |
|
| 258 | 258 | return $info['alias']; |
| 259 | 259 | }, $sqlIdentifier); |
| 260 | 260 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | $idVar = $pathExpression->identificationVariable; |
| 313 | 313 | $field = $pathExpression->field; |
| 314 | 314 | |
| 315 | - if (! isset($selects[$idVar])) { |
|
| 315 | + if ( ! isset($selects[$idVar])) { |
|
| 316 | 316 | $selects[$idVar] = []; |
| 317 | 317 | } |
| 318 | 318 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | if ($selectExpression instanceof SelectExpression) { |
| 326 | 326 | $idVar = $selectExpression->expression; |
| 327 | 327 | |
| 328 | - if (! is_string($idVar)) { |
|
| 328 | + if ( ! is_string($idVar)) { |
|
| 329 | 329 | continue; |
| 330 | 330 | } |
| 331 | 331 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | ?OrderByClause $orderByClause |
| 361 | 361 | ) : string { |
| 362 | 362 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement |
| 363 | - if (! $orderByClause) { |
|
| 363 | + if ( ! $orderByClause) { |
|
| 364 | 364 | return $sql; |
| 365 | 365 | } |
| 366 | 366 | |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | $orderByItems[] = $orderByItemString; |
| 399 | 399 | $identifier = substr($orderByItemString, 0, strrpos($orderByItemString, ' ')); |
| 400 | 400 | |
| 401 | - if (! in_array($identifier, $identifiers, true)) { |
|
| 401 | + if ( ! in_array($identifier, $identifiers, true)) { |
|
| 402 | 402 | $identifiers[] = $identifier; |
| 403 | 403 | } |
| 404 | 404 | } |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | public function walkPathExpression($pathExpr) |
| 553 | 553 | { |
| 554 | - if (! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
| 554 | + if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! in_array($pathExpr, $this->orderByPathExpressions, true)) { |
|
| 555 | 555 | $this->orderByPathExpressions[] = $pathExpr; |
| 556 | 556 | } |
| 557 | 557 | |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | [$pathExpression] |
| 90 | 90 | ); |
| 91 | 91 | $expression = new InExpression($arithmeticExpression); |
| 92 | - $expression->literals[] = new InputParameter(':' . self::PAGINATOR_ID_ALIAS); |
|
| 92 | + $expression->literals[] = new InputParameter(':'.self::PAGINATOR_ID_ALIAS); |
|
| 93 | 93 | } else { |
| 94 | 94 | $expression = new NullComparisonExpression($pathExpression); |
| 95 | 95 | $expression->not = false; |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | /** @var ClassMetadata $metadata */ |
| 43 | 43 | $metadata = $event->getClassMetadata(); |
| 44 | 44 | |
| 45 | - if (! isset($this->entityListeners[$metadata->getClassName()])) { |
|
| 45 | + if ( ! isset($this->entityListeners[$metadata->getClassName()])) { |
|
| 46 | 46 | return; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | public static function registerAutoloadDirectory($directory) |
| 33 | 33 | { |
| 34 | - if (! class_exists('Doctrine\Common\ClassLoader', false)) { |
|
| 35 | - require_once $directory . '/Doctrine/Common/ClassLoader.php'; |
|
| 34 | + if ( ! class_exists('Doctrine\Common\ClassLoader', false)) { |
|
| 35 | + require_once $directory.'/Doctrine/Common/ClassLoader.php'; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $loader = new ClassLoader('Doctrine', $directory); |
| 39 | 39 | $loader->register(); |
| 40 | 40 | |
| 41 | - $loader = new ClassLoader('Symfony\Component', $directory . '/Doctrine'); |
|
| 41 | + $loader = new ClassLoader('Symfony\Component', $directory.'/Doctrine'); |
|
| 42 | 42 | $loader->register(); |
| 43 | 43 | } |
| 44 | 44 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | { |
| 106 | 106 | $cache = self::createCacheInstance($isDevMode, $cache); |
| 107 | 107 | |
| 108 | - if (! $cache instanceof CacheProvider) { |
|
| 108 | + if ( ! $cache instanceof CacheProvider) { |
|
| 109 | 109 | return $cache; |
| 110 | 110 | } |
| 111 | 111 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $namespace .= ':'; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $cache->setNamespace($namespace . 'dc2_' . md5($proxyDir) . '_'); // to avoid collisions |
|
| 118 | + $cache->setNamespace($namespace.'dc2_'.md5($proxyDir).'_'); // to avoid collisions |
|
| 119 | 119 | |
| 120 | 120 | return $cache; |
| 121 | 121 | } |
@@ -2,44 +2,44 @@ |
||
| 2 | 2 | |
| 3 | 3 | declare(strict_types=1); |
| 4 | 4 | |
| 5 | -require_once __DIR__ . '/Annotation.php'; |
|
| 6 | -require_once __DIR__ . '/AssociationOverride.php'; |
|
| 7 | -require_once __DIR__ . '/AssociationOverrides.php'; |
|
| 8 | -require_once __DIR__ . '/AttributeOverride.php'; |
|
| 9 | -require_once __DIR__ . '/AttributeOverrides.php'; |
|
| 10 | -require_once __DIR__ . '/Cache.php'; |
|
| 11 | -require_once __DIR__ . '/ChangeTrackingPolicy.php'; |
|
| 12 | -require_once __DIR__ . '/Column.php'; |
|
| 13 | -require_once __DIR__ . '/CustomIdGenerator.php'; |
|
| 14 | -require_once __DIR__ . '/DiscriminatorColumn.php'; |
|
| 15 | -require_once __DIR__ . '/DiscriminatorMap.php'; |
|
| 16 | -require_once __DIR__ . '/Embeddable.php'; |
|
| 17 | -require_once __DIR__ . '/Embedded.php'; |
|
| 18 | -require_once __DIR__ . '/Entity.php'; |
|
| 19 | -require_once __DIR__ . '/EntityListeners.php'; |
|
| 20 | -require_once __DIR__ . '/GeneratedValue.php'; |
|
| 21 | -require_once __DIR__ . '/HasLifecycleCallbacks.php'; |
|
| 22 | -require_once __DIR__ . '/Id.php'; |
|
| 23 | -require_once __DIR__ . '/Index.php'; |
|
| 24 | -require_once __DIR__ . '/InheritanceType.php'; |
|
| 25 | -require_once __DIR__ . '/JoinColumn.php'; |
|
| 26 | -require_once __DIR__ . '/JoinColumns.php'; |
|
| 27 | -require_once __DIR__ . '/JoinTable.php'; |
|
| 28 | -require_once __DIR__ . '/ManyToMany.php'; |
|
| 29 | -require_once __DIR__ . '/ManyToOne.php'; |
|
| 30 | -require_once __DIR__ . '/MappedSuperclass.php'; |
|
| 31 | -require_once __DIR__ . '/OneToMany.php'; |
|
| 32 | -require_once __DIR__ . '/OneToOne.php'; |
|
| 33 | -require_once __DIR__ . '/OrderBy.php'; |
|
| 34 | -require_once __DIR__ . '/PrePersist.php'; |
|
| 35 | -require_once __DIR__ . '/PostLoad.php'; |
|
| 36 | -require_once __DIR__ . '/PostPersist.php'; |
|
| 37 | -require_once __DIR__ . '/PostRemove.php'; |
|
| 38 | -require_once __DIR__ . '/PostUpdate.php'; |
|
| 39 | -require_once __DIR__ . '/PreFlush.php'; |
|
| 40 | -require_once __DIR__ . '/PreRemove.php'; |
|
| 41 | -require_once __DIR__ . '/PreUpdate.php'; |
|
| 42 | -require_once __DIR__ . '/SequenceGenerator.php'; |
|
| 43 | -require_once __DIR__ . '/Table.php'; |
|
| 44 | -require_once __DIR__ . '/UniqueConstraint.php'; |
|
| 45 | -require_once __DIR__ . '/Version.php'; |
|
| 5 | +require_once __DIR__.'/Annotation.php'; |
|
| 6 | +require_once __DIR__.'/AssociationOverride.php'; |
|
| 7 | +require_once __DIR__.'/AssociationOverrides.php'; |
|
| 8 | +require_once __DIR__.'/AttributeOverride.php'; |
|
| 9 | +require_once __DIR__.'/AttributeOverrides.php'; |
|
| 10 | +require_once __DIR__.'/Cache.php'; |
|
| 11 | +require_once __DIR__.'/ChangeTrackingPolicy.php'; |
|
| 12 | +require_once __DIR__.'/Column.php'; |
|
| 13 | +require_once __DIR__.'/CustomIdGenerator.php'; |
|
| 14 | +require_once __DIR__.'/DiscriminatorColumn.php'; |
|
| 15 | +require_once __DIR__.'/DiscriminatorMap.php'; |
|
| 16 | +require_once __DIR__.'/Embeddable.php'; |
|
| 17 | +require_once __DIR__.'/Embedded.php'; |
|
| 18 | +require_once __DIR__.'/Entity.php'; |
|
| 19 | +require_once __DIR__.'/EntityListeners.php'; |
|
| 20 | +require_once __DIR__.'/GeneratedValue.php'; |
|
| 21 | +require_once __DIR__.'/HasLifecycleCallbacks.php'; |
|
| 22 | +require_once __DIR__.'/Id.php'; |
|
| 23 | +require_once __DIR__.'/Index.php'; |
|
| 24 | +require_once __DIR__.'/InheritanceType.php'; |
|
| 25 | +require_once __DIR__.'/JoinColumn.php'; |
|
| 26 | +require_once __DIR__.'/JoinColumns.php'; |
|
| 27 | +require_once __DIR__.'/JoinTable.php'; |
|
| 28 | +require_once __DIR__.'/ManyToMany.php'; |
|
| 29 | +require_once __DIR__.'/ManyToOne.php'; |
|
| 30 | +require_once __DIR__.'/MappedSuperclass.php'; |
|
| 31 | +require_once __DIR__.'/OneToMany.php'; |
|
| 32 | +require_once __DIR__.'/OneToOne.php'; |
|
| 33 | +require_once __DIR__.'/OrderBy.php'; |
|
| 34 | +require_once __DIR__.'/PrePersist.php'; |
|
| 35 | +require_once __DIR__.'/PostLoad.php'; |
|
| 36 | +require_once __DIR__.'/PostPersist.php'; |
|
| 37 | +require_once __DIR__.'/PostRemove.php'; |
|
| 38 | +require_once __DIR__.'/PostUpdate.php'; |
|
| 39 | +require_once __DIR__.'/PreFlush.php'; |
|
| 40 | +require_once __DIR__.'/PreRemove.php'; |
|
| 41 | +require_once __DIR__.'/PreUpdate.php'; |
|
| 42 | +require_once __DIR__.'/SequenceGenerator.php'; |
|
| 43 | +require_once __DIR__.'/Table.php'; |
|
| 44 | +require_once __DIR__.'/UniqueConstraint.php'; |
|
| 45 | +require_once __DIR__.'/Version.php'; |
|
@@ -85,10 +85,10 @@ discard block |
||
| 85 | 85 | // It's a joined result |
| 86 | 86 | |
| 87 | 87 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 88 | - $path = $parent . '.' . $dqlAlias; |
|
| 88 | + $path = $parent.'.'.$dqlAlias; |
|
| 89 | 89 | |
| 90 | 90 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
| 91 | - if (! isset($nonemptyComponents[$parent])) { |
|
| 91 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
| 92 | 92 | continue; |
| 93 | 93 | } |
| 94 | 94 | |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
| 98 | 98 | $first = reset($this->resultPointers); |
| 99 | 99 | // TODO: Exception if $key === null ? |
| 100 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
| 100 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
| 101 | 101 | } elseif (isset($this->resultPointers[$parent])) { |
| 102 | - $baseElement =& $this->resultPointers[$parent]; |
|
| 102 | + $baseElement = & $this->resultPointers[$parent]; |
|
| 103 | 103 | } else { |
| 104 | 104 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
| 105 | 105 | |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | $relation = $parentClass->getProperty($relationAlias); |
| 112 | 112 | |
| 113 | 113 | // Check the type of the relation (many or single-valued) |
| 114 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
| 114 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
| 115 | 115 | $oneToOne = false; |
| 116 | 116 | |
| 117 | - if (! isset($baseElement[$relationAlias])) { |
|
| 117 | + if ( ! isset($baseElement[$relationAlias])) { |
|
| 118 | 118 | $baseElement[$relationAlias] = []; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | $index = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false; |
| 124 | 124 | $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false; |
| 125 | 125 | |
| 126 | - if (! $indexExists || ! $indexIsValid) { |
|
| 126 | + if ( ! $indexExists || ! $indexIsValid) { |
|
| 127 | 127 | $element = $data; |
| 128 | 128 | |
| 129 | 129 | if (isset($this->rsm->indexByMap[$dqlAlias])) { |
@@ -144,12 +144,12 @@ discard block |
||
| 144 | 144 | ( ! isset($baseElement[$relationAlias])) |
| 145 | 145 | ) { |
| 146 | 146 | $baseElement[$relationAlias] = null; |
| 147 | - } elseif (! isset($baseElement[$relationAlias])) { |
|
| 147 | + } elseif ( ! isset($baseElement[$relationAlias])) { |
|
| 148 | 148 | $baseElement[$relationAlias] = $data; |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - $coll =& $baseElement[$relationAlias]; |
|
| 152 | + $coll = & $baseElement[$relationAlias]; |
|
| 153 | 153 | |
| 154 | 154 | if (is_array($coll)) { |
| 155 | 155 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 162 | 162 | |
| 163 | 163 | // if this row has a NULL value for the root result id then make it a null result. |
| 164 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
| 164 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 165 | 165 | $result[] = $this->rsm->isMixed |
| 166 | 166 | ? [$entityKey => null] |
| 167 | 167 | : null; |
@@ -198,13 +198,13 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - if (! isset($resultKey)) { |
|
| 201 | + if ( ! isset($resultKey)) { |
|
| 202 | 202 | $this->resultCounter++; |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | // Append scalar values to mixed result sets |
| 206 | 206 | if (isset($rowData['scalars'])) { |
| 207 | - if (! isset($resultKey)) { |
|
| 207 | + if ( ! isset($resultKey)) { |
|
| 208 | 208 | // this only ever happens when no object is fetched (scalar result only) |
| 209 | 209 | $resultKey = isset($this->rsm->indexByMap['scalars']) |
| 210 | 210 | ? $row[$this->rsm->indexByMap['scalars']] |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | |
| 219 | 219 | // Append new object to mixed result sets |
| 220 | 220 | if (isset($rowData['newObjects'])) { |
| 221 | - if (! isset($resultKey)) { |
|
| 221 | + if ( ! isset($resultKey)) { |
|
| 222 | 222 | $resultKey = $this->resultCounter - 1; |
| 223 | 223 | } |
| 224 | 224 | |
@@ -260,22 +260,22 @@ discard block |
||
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | if ($oneToOne) { |
| 263 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
| 263 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
| 264 | 264 | |
| 265 | 265 | return; |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | if ($index !== false) { |
| 269 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
| 269 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
| 270 | 270 | |
| 271 | 271 | return; |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | - if (! $coll) { |
|
| 274 | + if ( ! $coll) { |
|
| 275 | 275 | return; |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | end($coll); |
| 279 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
| 279 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
| 280 | 280 | } |
| 281 | 281 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | protected function prepare() |
| 55 | 55 | { |
| 56 | - if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
| 56 | + if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) { |
|
| 57 | 57 | $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true; |
| 58 | 58 | } |
| 59 | 59 | |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | // Remember which associations are "fetch joined", so that we know where to inject |
| 65 | 65 | // collection stubs or proxies and where not. |
| 66 | - if (! isset($this->rsm->relationMap[$dqlAlias])) { |
|
| 66 | + if ( ! isset($this->rsm->relationMap[$dqlAlias])) { |
|
| 67 | 67 | continue; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 71 | 71 | |
| 72 | - if (! isset($this->rsm->aliasMap[$parent])) { |
|
| 72 | + if ( ! isset($this->rsm->aliasMap[$parent])) { |
|
| 73 | 73 | throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $class = $this->getClassMetadata($className); |
| 96 | 96 | $inverseAssoc = $class->getProperty($association->getInversedBy()); |
| 97 | 97 | |
| 98 | - if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
| 98 | + if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) { |
|
| 99 | 99 | continue; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -161,14 +161,14 @@ discard block |
||
| 161 | 161 | $value = $association->getValue($entity); |
| 162 | 162 | $oid = spl_object_id($entity); |
| 163 | 163 | |
| 164 | - if (! $value instanceof PersistentCollection) { |
|
| 164 | + if ( ! $value instanceof PersistentCollection) { |
|
| 165 | 165 | $value = $association->wrap($entity, $value, $this->em); |
| 166 | 166 | |
| 167 | 167 | $association->setValue($entity, $value); |
| 168 | 168 | |
| 169 | 169 | $this->uow->setOriginalEntityProperty($oid, $fieldName, $value); |
| 170 | 170 | |
| 171 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 171 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 172 | 172 | } elseif (isset($this->hints[Query::HINT_REFRESH]) || |
| 173 | 173 | (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized()) |
| 174 | 174 | ) { |
@@ -177,10 +177,10 @@ discard block |
||
| 177 | 177 | $value->setInitialized(true); |
| 178 | 178 | $value->unwrap()->clear(); |
| 179 | 179 | |
| 180 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
| 180 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
| 181 | 181 | } else { |
| 182 | 182 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
| 183 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
| 183 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | return $value; |
@@ -203,13 +203,13 @@ discard block |
||
| 203 | 203 | if (isset($this->rsm->discriminatorColumns[$dqlAlias])) { |
| 204 | 204 | $fieldName = $this->rsm->discriminatorColumns[$dqlAlias]; |
| 205 | 205 | |
| 206 | - if (! isset($this->rsm->metaMappings[$fieldName])) { |
|
| 206 | + if ( ! isset($this->rsm->metaMappings[$fieldName])) { |
|
| 207 | 207 | throw HydrationException::missingDiscriminatorMetaMappingColumn($className, $fieldName, $dqlAlias); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | $discrColumn = $this->rsm->metaMappings[$fieldName]; |
| 211 | 211 | |
| 212 | - if (! isset($data[$discrColumn])) { |
|
| 212 | + if ( ! isset($data[$discrColumn])) { |
|
| 213 | 213 | throw HydrationException::missingDiscriminatorColumn($className, $discrColumn, $dqlAlias); |
| 214 | 214 | } |
| 215 | 215 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $discrMap = $this->metadataCache[$className]->discriminatorMap; |
| 221 | 221 | $discriminatorValue = (string) $data[$discrColumn]; |
| 222 | 222 | |
| 223 | - if (! isset($discrMap[$discriminatorValue])) { |
|
| 223 | + if ( ! isset($discrMap[$discriminatorValue])) { |
|
| 224 | 224 | throw HydrationException::invalidDiscriminatorValue($discriminatorValue, array_keys($discrMap)); |
| 225 | 225 | } |
| 226 | 226 | |
@@ -296,10 +296,10 @@ discard block |
||
| 296 | 296 | $parentAlias = $this->rsm->parentAliasMap[$dqlAlias]; |
| 297 | 297 | // we need the $path to save into the identifier map which entities were already |
| 298 | 298 | // seen for this parent-child relationship |
| 299 | - $path = $parentAlias . '.' . $dqlAlias; |
|
| 299 | + $path = $parentAlias.'.'.$dqlAlias; |
|
| 300 | 300 | |
| 301 | 301 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
| 302 | - if (! isset($nonemptyComponents[$parentAlias])) { |
|
| 302 | + if ( ! isset($nonemptyComponents[$parentAlias])) { |
|
| 303 | 303 | // TODO: Add special case code where we hydrate the right join objects into identity map at least |
| 304 | 304 | continue; |
| 305 | 305 | } |
@@ -330,15 +330,15 @@ discard block |
||
| 330 | 330 | $oid = spl_object_id($parentObject); |
| 331 | 331 | |
| 332 | 332 | // Check the type of the relation (many or single-valued) |
| 333 | - if (! ($association instanceof ToOneAssociationMetadata)) { |
|
| 333 | + if ( ! ($association instanceof ToOneAssociationMetadata)) { |
|
| 334 | 334 | // PATH A: Collection-valued association |
| 335 | 335 | $reflFieldValue = $association->getValue($parentObject); |
| 336 | 336 | |
| 337 | 337 | if (isset($nonemptyComponents[$dqlAlias])) { |
| 338 | - $collKey = $oid . $relationField; |
|
| 338 | + $collKey = $oid.$relationField; |
|
| 339 | 339 | if (isset($this->initializedCollections[$collKey])) { |
| 340 | 340 | $reflFieldValue = $this->initializedCollections[$collKey]; |
| 341 | - } elseif (! isset($this->existingCollections[$collKey])) { |
|
| 341 | + } elseif ( ! isset($this->existingCollections[$collKey])) { |
|
| 342 | 342 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
| 343 | 343 | } |
| 344 | 344 | |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | $index = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false; |
| 347 | 347 | $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false; |
| 348 | 348 | |
| 349 | - if (! $indexExists || ! $indexIsValid) { |
|
| 349 | + if ( ! $indexExists || ! $indexIsValid) { |
|
| 350 | 350 | if (isset($this->existingCollections[$collKey])) { |
| 351 | 351 | $element = $this->getEntityFromIdentityMap($entityName, $data); |
| 352 | 352 | |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | // Update result pointer |
| 376 | 376 | $this->resultPointers[$dqlAlias] = $reflFieldValue[$index]; |
| 377 | 377 | } |
| 378 | - } elseif (! $reflFieldValue) { |
|
| 378 | + } elseif ( ! $reflFieldValue) { |
|
| 379 | 379 | $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias); |
| 380 | 380 | } elseif ($reflFieldValue instanceof PersistentCollection && $reflFieldValue->isInitialized() === false) { |
| 381 | 381 | $reflFieldValue->setInitialized(true); |
@@ -384,7 +384,7 @@ discard block |
||
| 384 | 384 | // PATH B: Single-valued association |
| 385 | 385 | $reflFieldValue = $association->getValue($parentObject); |
| 386 | 386 | |
| 387 | - if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
| 387 | + if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) || |
|
| 388 | 388 | ($reflFieldValue instanceof GhostObjectInterface && ! $reflFieldValue->isProxyInitialized())) { |
| 389 | 389 | // we only need to take action if this value is null, |
| 390 | 390 | // we refresh the entity or its an uninitialized proxy. |
@@ -445,7 +445,7 @@ discard block |
||
| 445 | 445 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 446 | 446 | |
| 447 | 447 | // if this row has a NULL value for the root result id then make it a null result. |
| 448 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
| 448 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 449 | 449 | if ($this->rsm->isMixed) { |
| 450 | 450 | $result[] = [$entityKey => null]; |
| 451 | 451 | } else { |
@@ -457,7 +457,7 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | // check for existing result from the iterations before |
| 460 | - if (! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) { |
|
| 460 | + if ( ! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) { |
|
| 461 | 461 | $element = $this->getEntity($data, $dqlAlias); |
| 462 | 462 | |
| 463 | 463 | if ($this->rsm->isMixed) { |
@@ -500,13 +500,13 @@ discard block |
||
| 500 | 500 | } |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | - if (! isset($resultKey)) { |
|
| 503 | + if ( ! isset($resultKey)) { |
|
| 504 | 504 | $this->resultCounter++; |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | // Append scalar values to mixed result sets |
| 508 | 508 | if (isset($rowData['scalars'])) { |
| 509 | - if (! isset($resultKey)) { |
|
| 509 | + if ( ! isset($resultKey)) { |
|
| 510 | 510 | $resultKey = (isset($this->rsm->indexByMap['scalars'])) |
| 511 | 511 | ? $row[$this->rsm->indexByMap['scalars']] |
| 512 | 512 | : $this->resultCounter - 1; |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | |
| 520 | 520 | // Append new object to mixed result sets |
| 521 | 521 | if (isset($rowData['newObjects'])) { |
| 522 | - if (! isset($resultKey)) { |
|
| 522 | + if ( ! isset($resultKey)) { |
|
| 523 | 523 | $resultKey = $this->resultCounter - 1; |
| 524 | 524 | } |
| 525 | 525 | |
@@ -77,6 +77,6 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public function valid() |
| 79 | 79 | { |
| 80 | - return $this->current!==false; |
|
| 80 | + return $this->current !== false; |
|
| 81 | 81 | } |
| 82 | 82 | } |