@@ -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\Mapping; |
| 6 | 6 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public function getAllMetadata() : array |
| 133 | 133 | { |
| 134 | - if (! $this->initialized) { |
|
| 134 | + if ( ! $this->initialized) { |
|
| 135 | 135 | $this->initialize(); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | |
| 173 | 173 | try { |
| 174 | 174 | if ($this->cacheDriver) { |
| 175 | - $cached = $this->cacheDriver->fetch($realClassName . $this->cacheSalt); |
|
| 175 | + $cached = $this->cacheDriver->fetch($realClassName.$this->cacheSalt); |
|
| 176 | 176 | |
| 177 | 177 | if ($cached instanceof ClassMetadata) { |
| 178 | 178 | $this->loadedMetadata[$realClassName] = $cached; |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | foreach ($this->loadMetadata($realClassName, $metadataBuildingContext) as $loadedClass) { |
| 183 | 183 | $loadedClassName = $loadedClass->getClassName(); |
| 184 | 184 | |
| 185 | - $this->cacheDriver->save($loadedClassName . $this->cacheSalt, $loadedClass, 0); |
|
| 185 | + $this->cacheDriver->save($loadedClassName.$this->cacheSalt, $loadedClass, 0); |
|
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | } else { |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | } catch (CommonMappingException $loadingException) { |
| 192 | 192 | $fallbackMetadataResponse = $this->onNotFoundMetadata($realClassName, $metadataBuildingContext); |
| 193 | 193 | |
| 194 | - if (! $fallbackMetadataResponse) { |
|
| 194 | + if ( ! $fallbackMetadataResponse) { |
|
| 195 | 195 | throw $loadingException; |
| 196 | 196 | } |
| 197 | 197 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | protected function loadMetadata(string $name, ClassMetadataBuildingContext $metadataBuildingContext) : array |
| 229 | 229 | { |
| 230 | - if (! $this->initialized) { |
|
| 230 | + if ( ! $this->initialized) { |
|
| 231 | 231 | $this->initialize(); |
| 232 | 232 | } |
| 233 | 233 | |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | */ |
| 264 | 264 | public function isTransient($className) : bool |
| 265 | 265 | { |
| 266 | - if (! $this->initialized) { |
|
| 266 | + if ( ! $this->initialized) { |
|
| 267 | 267 | $this->initialize(); |
| 268 | 268 | } |
| 269 | 269 | |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | $parentClasses = []; |
| 286 | 286 | |
| 287 | 287 | foreach (array_reverse($this->getReflectionService()->getParentClasses($name)) as $parentClass) { |
| 288 | - if (! $this->getDriver()->isTransient($parentClass)) { |
|
| 288 | + if ( ! $this->getDriver()->isTransient($parentClass)) { |
|
| 289 | 289 | $parentClasses[] = $parentClass; |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -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 | |
@@ -92,10 +92,10 @@ discard block |
||
| 92 | 92 | // It's a joined result |
| 93 | 93 | |
| 94 | 94 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
| 95 | - $path = $parent . '.' . $dqlAlias; |
|
| 95 | + $path = $parent.'.'.$dqlAlias; |
|
| 96 | 96 | |
| 97 | 97 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
| 98 | - if (! isset($nonemptyComponents[$parent])) { |
|
| 98 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
| 99 | 99 | continue; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -104,9 +104,9 @@ discard block |
||
| 104 | 104 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
| 105 | 105 | $first = reset($this->resultPointers); |
| 106 | 106 | // TODO: Exception if $key === null ? |
| 107 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
| 107 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
| 108 | 108 | } elseif (isset($this->resultPointers[$parent])) { |
| 109 | - $baseElement =& $this->resultPointers[$parent]; |
|
| 109 | + $baseElement = & $this->resultPointers[$parent]; |
|
| 110 | 110 | } else { |
| 111 | 111 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
| 112 | 112 | |
@@ -118,10 +118,10 @@ discard block |
||
| 118 | 118 | $relation = $parentClass->getProperty($relationAlias); |
| 119 | 119 | |
| 120 | 120 | // Check the type of the relation (many or single-valued) |
| 121 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
| 121 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
| 122 | 122 | $oneToOne = false; |
| 123 | 123 | |
| 124 | - if (! isset($baseElement[$relationAlias])) { |
|
| 124 | + if ( ! isset($baseElement[$relationAlias])) { |
|
| 125 | 125 | $baseElement[$relationAlias] = []; |
| 126 | 126 | } |
| 127 | 127 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | $index = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false; |
| 131 | 131 | $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false; |
| 132 | 132 | |
| 133 | - if (! $indexExists || ! $indexIsValid) { |
|
| 133 | + if ( ! $indexExists || ! $indexIsValid) { |
|
| 134 | 134 | $element = $data; |
| 135 | 135 | |
| 136 | 136 | if (isset($this->rsm->indexByMap[$dqlAlias])) { |
@@ -151,12 +151,12 @@ discard block |
||
| 151 | 151 | ( ! isset($baseElement[$relationAlias])) |
| 152 | 152 | ) { |
| 153 | 153 | $baseElement[$relationAlias] = null; |
| 154 | - } elseif (! isset($baseElement[$relationAlias])) { |
|
| 154 | + } elseif ( ! isset($baseElement[$relationAlias])) { |
|
| 155 | 155 | $baseElement[$relationAlias] = $data; |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - $coll =& $baseElement[$relationAlias]; |
|
| 159 | + $coll = & $baseElement[$relationAlias]; |
|
| 160 | 160 | |
| 161 | 161 | if (is_array($coll)) { |
| 162 | 162 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
| 169 | 169 | |
| 170 | 170 | // if this row has a NULL value for the root result id then make it a null result. |
| 171 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
| 171 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
| 172 | 172 | $result[] = $this->rsm->isMixed |
| 173 | 173 | ? [$entityKey => null] |
| 174 | 174 | : null; |
@@ -205,13 +205,13 @@ discard block |
||
| 205 | 205 | } |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - if (! isset($resultKey)) { |
|
| 208 | + if ( ! isset($resultKey)) { |
|
| 209 | 209 | $this->resultCounter++; |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | // Append scalar values to mixed result sets |
| 213 | 213 | if (isset($rowData['scalars'])) { |
| 214 | - if (! isset($resultKey)) { |
|
| 214 | + if ( ! isset($resultKey)) { |
|
| 215 | 215 | // this only ever happens when no object is fetched (scalar result only) |
| 216 | 216 | $resultKey = isset($this->rsm->indexByMap['scalars']) |
| 217 | 217 | ? $row[$this->rsm->indexByMap['scalars']] |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | // Append new object to mixed result sets |
| 227 | 227 | if (isset($rowData['newObjects'])) { |
| 228 | - if (! isset($resultKey)) { |
|
| 228 | + if ( ! isset($resultKey)) { |
|
| 229 | 229 | $resultKey = $this->resultCounter - 1; |
| 230 | 230 | } |
| 231 | 231 | |
@@ -261,23 +261,23 @@ discard block |
||
| 261 | 261 | private function updateResultPointer(array &$coll, $index, $dqlAlias, $oneToOne) |
| 262 | 262 | { |
| 263 | 263 | if ($oneToOne) { |
| 264 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
| 264 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
| 265 | 265 | |
| 266 | 266 | return; |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | if ($index !== false) { |
| 270 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
| 270 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
| 271 | 271 | |
| 272 | 272 | return; |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | - if (! $coll) { |
|
| 275 | + if ( ! $coll) { |
|
| 276 | 276 | return; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | end($coll); |
| 280 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
| 280 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
| 281 | 281 | |
| 282 | 282 | return; |
| 283 | 283 | } |
@@ -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\Persisters\Entity; |
| 6 | 6 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | foreach ($data as $columnName => $value) { |
| 108 | - if (! is_array($id) || ! isset($id[$columnName])) { |
|
| 108 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
| 109 | 109 | $type = $this->columns[$columnName]->getType(); |
| 110 | 110 | |
| 111 | 111 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | $updateData = $this->prepareUpdateData($entity); |
| 131 | 131 | |
| 132 | - if (! $updateData) { |
|
| 132 | + if ( ! $updateData) { |
|
| 133 | 133 | return; |
| 134 | 134 | } |
| 135 | 135 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | $versionedClass = $this->class->versionProperty->getDeclaringClass(); |
| 149 | 149 | $versionedTable = $versionedClass->getTableName(); |
| 150 | 150 | |
| 151 | - if (! isset($updateData[$versionedTable])) { |
|
| 151 | + if ( ! isset($updateData[$versionedTable])) { |
|
| 152 | 152 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 153 | 153 | |
| 154 | 154 | $this->updateTable($entity, $tableName, [], true); |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | if ($filterSql) { |
| 232 | 232 | $conditionSql .= $conditionSql |
| 233 | - ? ' AND ' . $filterSql |
|
| 233 | + ? ' AND '.$filterSql |
|
| 234 | 234 | : $filterSql; |
| 235 | 235 | } |
| 236 | 236 | |
@@ -238,26 +238,26 @@ discard block |
||
| 238 | 238 | |
| 239 | 239 | switch ($lockMode) { |
| 240 | 240 | case LockMode::PESSIMISTIC_READ: |
| 241 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 241 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 242 | 242 | break; |
| 243 | 243 | |
| 244 | 244 | case LockMode::PESSIMISTIC_WRITE: |
| 245 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 245 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 246 | 246 | break; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 250 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
| 251 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
| 250 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
| 251 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
| 252 | 252 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 253 | 253 | $columnList = $this->getSelectColumnsSQL(); |
| 254 | - $query = 'SELECT ' . $columnList |
|
| 254 | + $query = 'SELECT '.$columnList |
|
| 255 | 255 | . $lock |
| 256 | 256 | . $joinSql |
| 257 | 257 | . $where |
| 258 | 258 | . $orderBySql; |
| 259 | 259 | |
| 260 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 260 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /** |
@@ -279,14 +279,14 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | if ($filterSql !== '') { |
| 281 | 281 | $conditionSql = $conditionSql |
| 282 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 282 | + ? $conditionSql.' AND '.$filterSql |
|
| 283 | 283 | : $filterSql; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | $sql = 'SELECT COUNT(*) ' |
| 287 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
| 287 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
| 288 | 288 | . $joinSql |
| 289 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 289 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 290 | 290 | |
| 291 | 291 | return $sql; |
| 292 | 292 | } |
@@ -308,18 +308,18 @@ discard block |
||
| 308 | 308 | /** @var ClassMetadata $parentClass */ |
| 309 | 309 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 310 | 310 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 311 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 311 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 312 | 312 | |
| 313 | 313 | foreach ($identifierColumns as $idColumn) { |
| 314 | 314 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 315 | 315 | |
| 316 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 316 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | $joinSql .= implode(' AND ', $conditions); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
| 322 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | /** |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | continue; |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 349 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 350 | 350 | continue; |
| 351 | 351 | } |
| 352 | 352 | |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | /** @var JoinColumnMetadata $joinColumn */ |
| 357 | 357 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 358 | 358 | |
| 359 | - if (! $joinColumn->getType()) { |
|
| 359 | + if ( ! $joinColumn->getType()) { |
|
| 360 | 360 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 361 | 361 | } |
| 362 | 362 | |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
| 376 | 376 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
| 377 | 377 | |
| 378 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform); |
|
| 378 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform); |
|
| 379 | 379 | |
| 380 | 380 | // sub tables |
| 381 | 381 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | /** @var JoinColumnMetadata $joinColumn */ |
| 400 | 400 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 401 | 401 | |
| 402 | - if (! $joinColumn->getType()) { |
|
| 402 | + if ( ! $joinColumn->getType()) { |
|
| 403 | 403 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 404 | 404 | } |
| 405 | 405 | |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $columnName = $joinColumn->getColumnName(); |
| 450 | 450 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 451 | 451 | |
| 452 | - if (! $joinColumn->getType()) { |
|
| 452 | + if ( ! $joinColumn->getType()) { |
|
| 453 | 453 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 454 | 454 | } |
| 455 | 455 | |
@@ -506,12 +506,12 @@ discard block |
||
| 506 | 506 | /** @var ClassMetadata $parentClass */ |
| 507 | 507 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 508 | 508 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 509 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 509 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 510 | 510 | |
| 511 | 511 | foreach ($identifierColumns as $idColumn) { |
| 512 | 512 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 513 | 513 | |
| 514 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 514 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | $joinSql .= implode(' AND ', $conditions); |
@@ -523,12 +523,12 @@ discard block |
||
| 523 | 523 | $subClass = $this->em->getClassMetadata($subClassName); |
| 524 | 524 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 525 | 525 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
| 526 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 526 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 527 | 527 | |
| 528 | 528 | foreach ($identifierColumns as $idColumn) { |
| 529 | 529 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 530 | 530 | |
| 531 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 531 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | $joinSql .= implode(' AND ', $conditions); |
@@ -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\Mapping; |
| 6 | 6 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | string $className, |
| 81 | 81 | ClassMetadataBuildingContext $metadataBuildingContext |
| 82 | 82 | ) : ?ClassMetadata { |
| 83 | - if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 83 | + if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) { |
|
| 84 | 84 | return null; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -141,20 +141,20 @@ discard block |
||
| 141 | 141 | $classMetadata->setCache(clone $parentCache); |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | - if (! empty($parent->namedNativeQueries)) { |
|
| 144 | + if ( ! empty($parent->namedNativeQueries)) { |
|
| 145 | 145 | $this->addInheritedNamedNativeQueries($classMetadata, $parent); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - if (! empty($parent->sqlResultSetMappings)) { |
|
| 148 | + if ( ! empty($parent->sqlResultSetMappings)) { |
|
| 149 | 149 | $this->addInheritedSqlResultSetMappings($classMetadata, $parent); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if (! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 152 | + if ( ! empty($parent->entityListeners) && empty($classMetadata->entityListeners)) { |
|
| 153 | 153 | $classMetadata->entityListeners = $parent->entityListeners; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 157 | + if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) { |
|
| 158 | 158 | $this->addDefaultDiscriminatorMap($classMetadata); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | |
| 175 | 175 | protected function completeRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 176 | 176 | { |
| 177 | - if (! $parent || ! $parent->isMappedSuperclass) { |
|
| 177 | + if ( ! $parent || ! $parent->isMappedSuperclass) { |
|
| 178 | 178 | return; |
| 179 | 179 | } |
| 180 | 180 | |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | continue; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - if (! ($property instanceof ToOneAssociationMetadata)) { |
|
| 195 | + if ( ! ($property instanceof ToOneAssociationMetadata)) { |
|
| 196 | 196 | continue; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | protected function validateRuntimeMetadata(ClassMetadata $class, ?ClassMetadata $parent = null) : void |
| 213 | 213 | { |
| 214 | - if (! $class->getReflectionClass()) { |
|
| 214 | + if ( ! $class->getReflectionClass()) { |
|
| 215 | 215 | // only validate if there is a reflection class instance |
| 216 | 216 | return; |
| 217 | 217 | } |
@@ -221,13 +221,13 @@ discard block |
||
| 221 | 221 | $class->validateLifecycleCallbacks($this->getReflectionService()); |
| 222 | 222 | |
| 223 | 223 | // verify inheritance |
| 224 | - if (! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 225 | - if (! $parent) { |
|
| 226 | - if (! $class->discriminatorMap) { |
|
| 224 | + if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) { |
|
| 225 | + if ( ! $parent) { |
|
| 226 | + if ( ! $class->discriminatorMap) { |
|
| 227 | 227 | throw MappingException::missingDiscriminatorMap($class->getClassName()); |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | - if (! $class->discriminatorColumn) { |
|
| 230 | + if ( ! $class->discriminatorColumn) { |
|
| 231 | 231 | throw MappingException::missingDiscriminatorColumn($class->getClassName()); |
| 232 | 232 | } |
| 233 | 233 | } |
@@ -421,7 +421,7 @@ discard block |
||
| 421 | 421 | private function completeIdentifierGeneratorMappings(ClassMetadata $class) : void |
| 422 | 422 | { |
| 423 | 423 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 424 | - if (! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 424 | + if ( ! $property instanceof FieldMetadata /*&& ! $property instanceof AssocationMetadata*/) { |
|
| 425 | 425 | continue; |
| 426 | 426 | } |
| 427 | 427 | |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field) |
| 433 | 433 | { |
| 434 | - if (! $field->hasValueGenerator()) { |
|
| 434 | + if ( ! $field->hasValueGenerator()) { |
|
| 435 | 435 | return; |
| 436 | 436 | } |
| 437 | 437 | |
@@ -483,10 +483,10 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | case GeneratorType::CUSTOM: |
| 485 | 485 | $definition = $generator->getDefinition(); |
| 486 | - if (! isset($definition['class'])) { |
|
| 486 | + if ( ! isset($definition['class'])) { |
|
| 487 | 487 | throw new ORMException(sprintf('Cannot instantiate custom generator, no class has been defined')); |
| 488 | 488 | } |
| 489 | - if (! class_exists($definition['class'])) { |
|
| 489 | + if ( ! class_exists($definition['class'])) { |
|
| 490 | 490 | throw new ORMException(sprintf('Cannot instantiate custom generator : %s', var_export($definition, true))); //$definition['class'])); |
| 491 | 491 | } |
| 492 | 492 | |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | break; |
| 499 | 499 | |
| 500 | 500 | default: |
| 501 | - throw new ORMException('Unknown generator type: ' . $generator->getType()); |
|
| 501 | + throw new ORMException('Unknown generator type: '.$generator->getType()); |
|
| 502 | 502 | } |
| 503 | 503 | } |
| 504 | 504 | |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | |
| 521 | 521 | private function getTargetPlatform() : Platforms\AbstractPlatform |
| 522 | 522 | { |
| 523 | - if (! $this->targetPlatform) { |
|
| 523 | + if ( ! $this->targetPlatform) { |
|
| 524 | 524 | $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform(); |
| 525 | 525 | } |
| 526 | 526 | |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | $generatedProperties = []; |
| 534 | 534 | |
| 535 | 535 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 536 | - if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
| 536 | + if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) { |
|
| 537 | 537 | continue; |
| 538 | 538 | } |
| 539 | 539 | |
@@ -600,6 +600,6 @@ discard block |
||
| 600 | 600 | return new $class(); |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | - throw new \UnexpectedValueException('Platform ' . $property->getValueGenerator()->getType() . ' is not supported'); |
|
| 603 | + throw new \UnexpectedValueException('Platform '.$property->getValueGenerator()->getType().' is not supported'); |
|
| 604 | 604 | } |
| 605 | 605 | } |
@@ -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\Mapping; |
| 6 | 6 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | */ |
| 281 | 281 | public function __toString() |
| 282 | 282 | { |
| 283 | - return __CLASS__ . '@' . spl_object_id($this); |
|
| 283 | + return __CLASS__.'@'.spl_object_id($this); |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | // Restore ReflectionClass and properties |
| 376 | 376 | $this->reflectionClass = $reflectionService->getClass($this->className); |
| 377 | 377 | |
| 378 | - if (! $this->reflectionClass) { |
|
| 378 | + if ( ! $this->reflectionClass) { |
|
| 379 | 379 | return; |
| 380 | 380 | } |
| 381 | 381 | |
@@ -399,11 +399,11 @@ discard block |
||
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | // Verify & complete identifier mapping |
| 402 | - if (! $this->identifier) { |
|
| 402 | + if ( ! $this->identifier) { |
|
| 403 | 403 | throw MappingException::identifierRequired($this->className); |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
| 406 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
| 407 | 407 | return $property instanceof FieldMetadata |
| 408 | 408 | && $property->isPrimaryKey() |
| 409 | 409 | && $property->hasValueGenerator(); |
@@ -422,13 +422,13 @@ discard block |
||
| 422 | 422 | public function validateAssociations() : void |
| 423 | 423 | { |
| 424 | 424 | foreach ($this->declaredProperties as $property) { |
| 425 | - if (! ($property instanceof AssociationMetadata)) { |
|
| 425 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
| 426 | 426 | continue; |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | $targetEntity = $property->getTargetEntity(); |
| 430 | 430 | |
| 431 | - if (! class_exists($targetEntity)) { |
|
| 431 | + if ( ! class_exists($targetEntity)) { |
|
| 432 | 432 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
| 433 | 433 | } |
| 434 | 434 | } |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | foreach ($this->lifecycleCallbacks as $callbacks) { |
| 445 | 445 | /** @var array $callbacks */ |
| 446 | 446 | foreach ($callbacks as $callbackFuncName) { |
| 447 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 447 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 448 | 448 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
| 449 | 449 | } |
| 450 | 450 | } |
@@ -468,11 +468,11 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | public function isIdentifier(string $fieldName) : bool |
| 470 | 470 | { |
| 471 | - if (! $this->identifier) { |
|
| 471 | + if ( ! $this->identifier) { |
|
| 472 | 472 | return false; |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | - if (! $this->isIdentifierComposite()) { |
|
| 475 | + if ( ! $this->isIdentifierComposite()) { |
|
| 476 | 476 | return $fieldName === $this->identifier[0]; |
| 477 | 477 | } |
| 478 | 478 | |
@@ -497,7 +497,7 @@ discard block |
||
| 497 | 497 | */ |
| 498 | 498 | public function getNamedNativeQuery($queryName) : array |
| 499 | 499 | { |
| 500 | - if (! isset($this->namedNativeQueries[$queryName])) { |
|
| 500 | + if ( ! isset($this->namedNativeQueries[$queryName])) { |
|
| 501 | 501 | throw MappingException::queryNotFound($this->className, $queryName); |
| 502 | 502 | } |
| 503 | 503 | |
@@ -527,7 +527,7 @@ discard block |
||
| 527 | 527 | */ |
| 528 | 528 | public function getSqlResultSetMapping($name) |
| 529 | 529 | { |
| 530 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
| 530 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
| 531 | 531 | throw MappingException::resultMappingNotFound($this->className, $name); |
| 532 | 532 | } |
| 533 | 533 | |
@@ -560,7 +560,7 @@ discard block |
||
| 560 | 560 | $property->setColumnName($columnName); |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | - if (! $this->isMappedSuperclass) { |
|
| 563 | + if ( ! $this->isMappedSuperclass) { |
|
| 564 | 564 | $property->setTableName($this->getTableName()); |
| 565 | 565 | } |
| 566 | 566 | |
@@ -580,7 +580,7 @@ discard block |
||
| 580 | 580 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($this->className, $property); |
| 581 | 581 | } |
| 582 | 582 | |
| 583 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
| 583 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
| 584 | 584 | $this->identifier[] = $fieldName; |
| 585 | 585 | } |
| 586 | 586 | } |
@@ -630,7 +630,7 @@ discard block |
||
| 630 | 630 | $fieldName = $property->getName(); |
| 631 | 631 | $targetEntity = $property->getTargetEntity(); |
| 632 | 632 | |
| 633 | - if (! $targetEntity) { |
|
| 633 | + if ( ! $targetEntity) { |
|
| 634 | 634 | throw MappingException::missingTargetEntity($fieldName); |
| 635 | 635 | } |
| 636 | 636 | |
@@ -644,7 +644,7 @@ discard block |
||
| 644 | 644 | throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName); |
| 645 | 645 | } |
| 646 | 646 | |
| 647 | - if (! in_array($property->getName(), $this->identifier, true)) { |
|
| 647 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
| 648 | 648 | if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) { |
| 649 | 649 | throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( |
| 650 | 650 | $property->getTargetEntity(), |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | /** @var JoinColumnMetadata $joinColumn */ |
| 711 | 711 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
| 712 | 712 | if (count($property->getJoinColumns()) === 1) { |
| 713 | - if (! $property->isPrimaryKey()) { |
|
| 713 | + if ( ! $property->isPrimaryKey()) { |
|
| 714 | 714 | $joinColumn->setUnique(true); |
| 715 | 715 | } |
| 716 | 716 | } else { |
@@ -718,13 +718,13 @@ discard block |
||
| 718 | 718 | } |
| 719 | 719 | } |
| 720 | 720 | |
| 721 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 721 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 722 | 722 | |
| 723 | - if (! $joinColumn->getColumnName()) { |
|
| 723 | + if ( ! $joinColumn->getColumnName()) { |
|
| 724 | 724 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 727 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 728 | 728 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 729 | 729 | } |
| 730 | 730 | |
@@ -732,7 +732,7 @@ discard block |
||
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | if ($uniqueConstraintColumns) { |
| 735 | - if (! $this->table) { |
|
| 735 | + if ( ! $this->table) { |
|
| 736 | 736 | throw new \RuntimeException( |
| 737 | 737 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
| 738 | 738 | ); |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | if ($property->isOrphanRemoval()) { |
| 753 | 753 | $cascades = $property->getCascade(); |
| 754 | 754 | |
| 755 | - if (! in_array('remove', $cascades, true)) { |
|
| 755 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 756 | 756 | $cascades[] = 'remove'; |
| 757 | 757 | |
| 758 | 758 | $property->setCascade($cascades); |
@@ -818,14 +818,14 @@ discard block |
||
| 818 | 818 | $property->setOwningSide(false); |
| 819 | 819 | |
| 820 | 820 | // OneToMany MUST have mappedBy |
| 821 | - if (! $property->getMappedBy()) { |
|
| 821 | + if ( ! $property->getMappedBy()) { |
|
| 822 | 822 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
| 823 | 823 | } |
| 824 | 824 | |
| 825 | 825 | if ($property->isOrphanRemoval()) { |
| 826 | 826 | $cascades = $property->getCascade(); |
| 827 | 827 | |
| 828 | - if (! in_array('remove', $cascades, true)) { |
|
| 828 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 829 | 829 | $cascades[] = 'remove'; |
| 830 | 830 | |
| 831 | 831 | $property->setCascade($cascades); |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | |
| 849 | 849 | $property->setJoinTable($joinTable); |
| 850 | 850 | |
| 851 | - if (! $joinTable->getName()) { |
|
| 851 | + if ( ! $joinTable->getName()) { |
|
| 852 | 852 | $joinTableName = $this->namingStrategy->joinTableName( |
| 853 | 853 | $property->getSourceEntity(), |
| 854 | 854 | $property->getTargetEntity(), |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | |
| 861 | 861 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
| 862 | 862 | |
| 863 | - if (! $joinTable->getJoinColumns()) { |
|
| 863 | + if ( ! $joinTable->getJoinColumns()) { |
|
| 864 | 864 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 865 | 865 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
| 866 | 866 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -873,7 +873,7 @@ discard block |
||
| 873 | 873 | $joinTable->addJoinColumn($joinColumn); |
| 874 | 874 | } |
| 875 | 875 | |
| 876 | - if (! $joinTable->getInverseJoinColumns()) { |
|
| 876 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
| 877 | 877 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 878 | 878 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
| 879 | 879 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -888,13 +888,13 @@ discard block |
||
| 888 | 888 | |
| 889 | 889 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 890 | 890 | /** @var JoinColumnMetadata $joinColumn */ |
| 891 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 891 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 892 | 892 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 896 | 896 | |
| 897 | - if (! $joinColumn->getColumnName()) { |
|
| 897 | + if ( ! $joinColumn->getColumnName()) { |
|
| 898 | 898 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 899 | 899 | $property->getSourceEntity(), |
| 900 | 900 | $referencedColumnName |
@@ -906,13 +906,13 @@ discard block |
||
| 906 | 906 | |
| 907 | 907 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
| 908 | 908 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
| 909 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 909 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 910 | 910 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 911 | 911 | } |
| 912 | 912 | |
| 913 | 913 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
| 914 | 914 | |
| 915 | - if (! $inverseJoinColumn->getColumnName()) { |
|
| 915 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
| 916 | 916 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 917 | 917 | $property->getTargetEntity(), |
| 918 | 918 | $referencedColumnName |
@@ -946,7 +946,7 @@ discard block |
||
| 946 | 946 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
| 947 | 947 | } |
| 948 | 948 | |
| 949 | - if (! isset($this->identifier[0])) { |
|
| 949 | + if ( ! isset($this->identifier[0])) { |
|
| 950 | 950 | throw MappingException::noIdDefined($this->className); |
| 951 | 951 | } |
| 952 | 952 | |
@@ -1005,7 +1005,7 @@ discard block |
||
| 1005 | 1005 | // Association defined as Id field |
| 1006 | 1006 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1007 | 1007 | |
| 1008 | - if (! $property->isOwningSide()) { |
|
| 1008 | + if ( ! $property->isOwningSide()) { |
|
| 1009 | 1009 | $property = $targetClass->getProperty($property->getMappedBy()); |
| 1010 | 1010 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1011 | 1011 | } |
@@ -1020,7 +1020,7 @@ discard block |
||
| 1020 | 1020 | $columnName = $joinColumn->getColumnName(); |
| 1021 | 1021 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1022 | 1022 | |
| 1023 | - if (! $joinColumn->getType()) { |
|
| 1023 | + if ( ! $joinColumn->getType()) { |
|
| 1024 | 1024 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
| 1025 | 1025 | } |
| 1026 | 1026 | |
@@ -1054,11 +1054,11 @@ discard block |
||
| 1054 | 1054 | { |
| 1055 | 1055 | $schema = $this->getSchemaName() === null |
| 1056 | 1056 | ? '' |
| 1057 | - : $this->getSchemaName() . '_' |
|
| 1057 | + : $this->getSchemaName().'_' |
|
| 1058 | 1058 | ; |
| 1059 | 1059 | |
| 1060 | 1060 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 1061 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
| 1061 | + return $schema.$this->getTableName().'_id_tmp'; |
|
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | 1064 | /** |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | */ |
| 1093 | 1093 | public function setInheritanceType($type) : void |
| 1094 | 1094 | { |
| 1095 | - if (! $this->isInheritanceType($type)) { |
|
| 1095 | + if ( ! $this->isInheritanceType($type)) { |
|
| 1096 | 1096 | throw MappingException::invalidInheritanceType($this->className, $type); |
| 1097 | 1097 | } |
| 1098 | 1098 | |
@@ -1110,7 +1110,7 @@ discard block |
||
| 1110 | 1110 | { |
| 1111 | 1111 | $fieldName = $property->getName(); |
| 1112 | 1112 | |
| 1113 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
| 1113 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
| 1114 | 1114 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
| 1115 | 1115 | } |
| 1116 | 1116 | |
@@ -1310,7 +1310,7 @@ discard block |
||
| 1310 | 1310 | assert($declaringClass instanceof ClassMetadata); |
| 1311 | 1311 | |
| 1312 | 1312 | if ($inheritedProperty instanceof FieldMetadata) { |
| 1313 | - if (! $declaringClass->isMappedSuperclass) { |
|
| 1313 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
| 1314 | 1314 | $inheritedProperty->setTableName($property->getTableName()); |
| 1315 | 1315 | } |
| 1316 | 1316 | |
@@ -1354,7 +1354,7 @@ discard block |
||
| 1354 | 1354 | throw MappingException::duplicateQueryMapping($this->className, $name); |
| 1355 | 1355 | } |
| 1356 | 1356 | |
| 1357 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1357 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1358 | 1358 | throw MappingException::missingQueryMapping($this->className, $name); |
| 1359 | 1359 | } |
| 1360 | 1360 | |
@@ -1371,7 +1371,7 @@ discard block |
||
| 1371 | 1371 | */ |
| 1372 | 1372 | public function addSqlResultSetMapping(array $resultMapping) |
| 1373 | 1373 | { |
| 1374 | - if (! isset($resultMapping['name'])) { |
|
| 1374 | + if ( ! isset($resultMapping['name'])) { |
|
| 1375 | 1375 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
| 1376 | 1376 | } |
| 1377 | 1377 | |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | |
| 1382 | 1382 | if (isset($resultMapping['entities'])) { |
| 1383 | 1383 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
| 1384 | - if (! isset($entityResult['entityClass'])) { |
|
| 1384 | + if ( ! isset($entityResult['entityClass'])) { |
|
| 1385 | 1385 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
| 1386 | 1386 | } |
| 1387 | 1387 | |
@@ -1390,11 +1390,11 @@ discard block |
||
| 1390 | 1390 | |
| 1391 | 1391 | if (isset($entityResult['fields'])) { |
| 1392 | 1392 | foreach ($entityResult['fields'] as $k => $field) { |
| 1393 | - if (! isset($field['name'])) { |
|
| 1393 | + if ( ! isset($field['name'])) { |
|
| 1394 | 1394 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
| 1395 | 1395 | } |
| 1396 | 1396 | |
| 1397 | - if (! isset($field['column'])) { |
|
| 1397 | + if ( ! isset($field['column'])) { |
|
| 1398 | 1398 | $fieldName = $field['name']; |
| 1399 | 1399 | |
| 1400 | 1400 | if (strpos($fieldName, '.')) { |
@@ -1492,11 +1492,11 @@ discard block |
||
| 1492 | 1492 | 'method' => $method, |
| 1493 | 1493 | ]; |
| 1494 | 1494 | |
| 1495 | - if (! class_exists($class)) { |
|
| 1495 | + if ( ! class_exists($class)) { |
|
| 1496 | 1496 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
| 1497 | 1497 | } |
| 1498 | 1498 | |
| 1499 | - if (! method_exists($class, $method)) { |
|
| 1499 | + if ( ! method_exists($class, $method)) { |
|
| 1500 | 1500 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
| 1501 | 1501 | } |
| 1502 | 1502 | |
@@ -1563,7 +1563,7 @@ discard block |
||
| 1563 | 1563 | return; |
| 1564 | 1564 | } |
| 1565 | 1565 | |
| 1566 | - if (! (class_exists($className) || interface_exists($className))) { |
|
| 1566 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
| 1567 | 1567 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
| 1568 | 1568 | } |
| 1569 | 1569 | |
@@ -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\Mapping\Driver; |
| 6 | 6 | |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | return $this->classNames; |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if (! $this->paths) { |
|
| 181 | + if ( ! $this->paths) { |
|
| 182 | 182 | throw Mapping\MappingException::pathRequired(); |
| 183 | 183 | } |
| 184 | 184 | |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $includedFiles = []; |
| 187 | 187 | |
| 188 | 188 | foreach ($this->paths as $path) { |
| 189 | - if (! is_dir($path)) { |
|
| 189 | + if ( ! is_dir($path)) { |
|
| 190 | 190 | throw Mapping\MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 191 | 191 | } |
| 192 | 192 | |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 196 | 196 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 197 | 197 | ), |
| 198 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 198 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 199 | 199 | \RecursiveRegexIterator::GET_MATCH |
| 200 | 200 | ); |
| 201 | 201 | |
| 202 | 202 | foreach ($iterator as $file) { |
| 203 | 203 | $sourceFile = $file[0]; |
| 204 | 204 | |
| 205 | - if (! preg_match('(^phar:)i', $sourceFile)) { |
|
| 205 | + if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 206 | 206 | $sourceFile = realpath($sourceFile); |
| 207 | 207 | } |
| 208 | 208 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | ) : Mapping\ClassMetadata { |
| 247 | 247 | $reflectionClass = $metadata->getReflectionClass(); |
| 248 | 248 | |
| 249 | - if (! $reflectionClass) { |
|
| 249 | + if ( ! $reflectionClass) { |
|
| 250 | 250 | // this happens when running annotation driver in combination with |
| 251 | 251 | // static reflection services. This is not the nicest fix |
| 252 | 252 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -282,7 +282,7 @@ discard block |
||
| 282 | 282 | $classMetadata |
| 283 | 283 | ); |
| 284 | 284 | |
| 285 | - if (! $property) { |
|
| 285 | + if ( ! $property) { |
|
| 286 | 286 | continue; |
| 287 | 287 | } |
| 288 | 288 | |
@@ -577,11 +577,11 @@ discard block |
||
| 577 | 577 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
| 578 | 578 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
| 579 | 579 | |
| 580 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
| 580 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
| 581 | 581 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
| 584 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
| 585 | 585 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
| 586 | 586 | } |
| 587 | 587 | |
@@ -638,7 +638,7 @@ discard block |
||
| 638 | 638 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
| 639 | 639 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
| 640 | 640 | |
| 641 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
| 641 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
| 642 | 642 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
| 643 | 643 | } |
| 644 | 644 | |
@@ -696,11 +696,11 @@ discard block |
||
| 696 | 696 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
| 697 | 697 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
| 698 | 698 | |
| 699 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
| 699 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
| 700 | 700 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
| 703 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
| 704 | 704 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
| 705 | 705 | } |
| 706 | 706 | |
@@ -742,15 +742,15 @@ discard block |
||
| 742 | 742 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
| 743 | 743 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
| 744 | 744 | |
| 745 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
| 745 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
| 746 | 746 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
| 749 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
| 750 | 750 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
| 751 | 751 | } |
| 752 | 752 | |
| 753 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
| 753 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
| 754 | 754 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
| 755 | 755 | } |
| 756 | 756 | |
@@ -794,15 +794,15 @@ discard block |
||
| 794 | 794 | |
| 795 | 795 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
| 796 | 796 | |
| 797 | - if (! empty($columnAnnot->name)) { |
|
| 797 | + if ( ! empty($columnAnnot->name)) { |
|
| 798 | 798 | $fieldMetadata->setColumnName($columnAnnot->name); |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | - if (! empty($columnAnnot->columnDefinition)) { |
|
| 801 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
| 802 | 802 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
| 803 | 803 | } |
| 804 | 804 | |
| 805 | - if (! empty($columnAnnot->length)) { |
|
| 805 | + if ( ! empty($columnAnnot->length)) { |
|
| 806 | 806 | $fieldMetadata->setLength($columnAnnot->length); |
| 807 | 807 | } |
| 808 | 808 | |
@@ -825,11 +825,11 @@ discard block |
||
| 825 | 825 | Annotation\Table $tableAnnot, |
| 826 | 826 | Mapping\TableMetadata $tableMetadata |
| 827 | 827 | ) : void { |
| 828 | - if (! empty($tableAnnot->name)) { |
|
| 828 | + if ( ! empty($tableAnnot->name)) { |
|
| 829 | 829 | $tableMetadata->setName($tableAnnot->name); |
| 830 | 830 | } |
| 831 | 831 | |
| 832 | - if (! empty($tableAnnot->schema)) { |
|
| 832 | + if ( ! empty($tableAnnot->schema)) { |
|
| 833 | 833 | $tableMetadata->setSchema($tableAnnot->schema); |
| 834 | 834 | } |
| 835 | 835 | |
@@ -865,11 +865,11 @@ discard block |
||
| 865 | 865 | ) : Mapping\JoinTableMetadata { |
| 866 | 866 | $joinTable = new Mapping\JoinTableMetadata(); |
| 867 | 867 | |
| 868 | - if (! empty($joinTableAnnot->name)) { |
|
| 868 | + if ( ! empty($joinTableAnnot->name)) { |
|
| 869 | 869 | $joinTable->setName($joinTableAnnot->name); |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | - if (! empty($joinTableAnnot->schema)) { |
|
| 872 | + if ( ! empty($joinTableAnnot->schema)) { |
|
| 873 | 873 | $joinTable->setSchema($joinTableAnnot->schema); |
| 874 | 874 | } |
| 875 | 875 | |
@@ -897,22 +897,22 @@ discard block |
||
| 897 | 897 | $joinColumn = new Mapping\JoinColumnMetadata(); |
| 898 | 898 | |
| 899 | 899 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
| 900 | - if (! empty($joinColumnAnnot->name)) { |
|
| 900 | + if ( ! empty($joinColumnAnnot->name)) { |
|
| 901 | 901 | $joinColumn->setColumnName($joinColumnAnnot->name); |
| 902 | 902 | } |
| 903 | 903 | |
| 904 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 904 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
| 905 | 905 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
| 906 | 906 | } |
| 907 | 907 | |
| 908 | 908 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
| 909 | 909 | $joinColumn->setUnique($joinColumnAnnot->unique); |
| 910 | 910 | |
| 911 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
| 911 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
| 912 | 912 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
| 915 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
| 916 | 916 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
| 917 | 917 | } |
| 918 | 918 | |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | $fieldName = null |
| 935 | 935 | ) : Mapping\CacheMetadata { |
| 936 | 936 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
| 937 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
| 937 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
| 938 | 938 | |
| 939 | 939 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
| 940 | 940 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | do { |
| 1000 | 1000 | assert($parent instanceof Mapping\ClassMetadata); |
| 1001 | 1001 | |
| 1002 | - if (! $parent->isMappedSuperclass) { |
|
| 1002 | + if ( ! $parent->isMappedSuperclass) { |
|
| 1003 | 1003 | $metadata->setTable($parent->table); |
| 1004 | 1004 | |
| 1005 | 1005 | break; |
@@ -1054,11 +1054,11 @@ discard block |
||
| 1054 | 1054 | $discriminatorColumn->setType(Type::getType($typeName)); |
| 1055 | 1055 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
| 1056 | 1056 | |
| 1057 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1057 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
| 1058 | 1058 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
| 1059 | 1059 | } |
| 1060 | 1060 | |
| 1061 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
| 1061 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
| 1062 | 1062 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
| 1063 | 1063 | } |
| 1064 | 1064 | } |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | $entityListenersAnnot = $classAnnotations[Annotation\EntityListeners::class]; |
| 1147 | 1147 | |
| 1148 | 1148 | foreach ($entityListenersAnnot->value as $listenerClassName) { |
| 1149 | - if (! class_exists($listenerClassName)) { |
|
| 1149 | + if ( ! class_exists($listenerClassName)) { |
|
| 1150 | 1150 | throw Mapping\MappingException::entityListenerClassNotFound( |
| 1151 | 1151 | $listenerClassName, |
| 1152 | 1152 | $metadata->getClassName() |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | $fieldName = $associationOverride->name; |
| 1184 | 1184 | $property = $metadata->getProperty($fieldName); |
| 1185 | 1185 | |
| 1186 | - if (! $property) { |
|
| 1186 | + if ( ! $property) { |
|
| 1187 | 1187 | throw Mapping\MappingException::invalidOverrideFieldName($metadata->getClassName(), $fieldName); |
| 1188 | 1188 | } |
| 1189 | 1189 | |
@@ -1217,7 +1217,7 @@ discard block |
||
| 1217 | 1217 | // Check for fetch |
| 1218 | 1218 | if ($associationOverride->fetch) { |
| 1219 | 1219 | $override->setFetchMode( |
| 1220 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
| 1220 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
| 1221 | 1221 | ); |
| 1222 | 1222 | } |
| 1223 | 1223 | |
@@ -1306,7 +1306,7 @@ discard block |
||
| 1306 | 1306 | { |
| 1307 | 1307 | $fetchModeConstant = sprintf('%s::%s', Mapping\FetchMode::class, $fetchMode); |
| 1308 | 1308 | |
| 1309 | - if (! defined($fetchModeConstant)) { |
|
| 1309 | + if ( ! defined($fetchModeConstant)) { |
|
| 1310 | 1310 | throw Mapping\MappingException::invalidFetchMode($className, $fetchMode); |
| 1311 | 1311 | } |
| 1312 | 1312 | |
@@ -1352,7 +1352,7 @@ discard block |
||
| 1352 | 1352 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
| 1353 | 1353 | |
| 1354 | 1354 | foreach ($classAnnotations as $key => $annot) { |
| 1355 | - if (! is_numeric($key)) { |
|
| 1355 | + if ( ! is_numeric($key)) { |
|
| 1356 | 1356 | continue; |
| 1357 | 1357 | } |
| 1358 | 1358 | |
@@ -1370,7 +1370,7 @@ discard block |
||
| 1370 | 1370 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
| 1371 | 1371 | |
| 1372 | 1372 | foreach ($propertyAnnotations as $key => $annot) { |
| 1373 | - if (! is_numeric($key)) { |
|
| 1373 | + if ( ! is_numeric($key)) { |
|
| 1374 | 1374 | continue; |
| 1375 | 1375 | } |
| 1376 | 1376 | |
@@ -1388,7 +1388,7 @@ discard block |
||
| 1388 | 1388 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
| 1389 | 1389 | |
| 1390 | 1390 | foreach ($methodAnnotations as $key => $annot) { |
| 1391 | - if (! is_numeric($key)) { |
|
| 1391 | + if ( ! is_numeric($key)) { |
|
| 1392 | 1392 | continue; |
| 1393 | 1393 | } |
| 1394 | 1394 | |