@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\EntityManager; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\EntityManager; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\EntityManager; |
| 6 | 6 | |
@@ -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\EntityManager; |
| 6 | 6 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | public static function fromClassAndFieldNames(string $className, array $fieldNames) : self |
| 12 | 12 | { |
| 13 | 13 | return new self( |
| 14 | - "Unrecognized identifier fields: '" . implode("', '", $fieldNames) . "' " . |
|
| 14 | + "Unrecognized identifier fields: '".implode("', '", $fieldNames)."' ". |
|
| 15 | 15 | "are not present on class '$className'." |
| 16 | 16 | ); |
| 17 | 17 | } |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Persisters; |
| 6 | 6 | |
| 7 | -use Doctrine\ORM\ORMException; |
|
| 8 | 7 | use Doctrine\ORM\PersisterException; |
| 9 | 8 | |
| 10 | 9 | class InvalidOrientation extends \Exception implements PersisterException |
@@ -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; |
| 6 | 6 | |
@@ -11,6 +11,6 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | public static function fromClassNameAndField(string $className, string $field): self |
| 13 | 13 | { |
| 14 | - return new self("Invalid order by orientation specified for " . $className . "#" . $field); |
|
| 14 | + return new self("Invalid order by orientation specified for ".$className."#".$field); |
|
| 15 | 15 | } |
| 16 | 16 | } |
@@ -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 | |
@@ -303,14 +303,14 @@ discard block |
||
| 303 | 303 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 304 | 304 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 305 | 305 | $identifier = array_map( |
| 306 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 306 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 307 | 307 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 308 | 308 | ); |
| 309 | 309 | |
| 310 | 310 | // FIXME: Order with composite keys might not be correct |
| 311 | - $sql = 'SELECT ' . $columnName |
|
| 312 | - . ' FROM ' . $tableName |
|
| 313 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 311 | + $sql = 'SELECT '.$columnName |
|
| 312 | + . ' FROM '.$tableName |
|
| 313 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 314 | 314 | |
| 315 | 315 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 316 | 316 | $versionType = $versionProperty->getType(); |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | |
| 397 | 397 | if (($value = $identifier[$field]) !== null) { |
| 398 | 398 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 399 | - if (! is_array($value)) { |
|
| 399 | + if ( ! is_array($value)) { |
|
| 400 | 400 | $value = [$targetClass->identifier[0] => $value]; |
| 401 | 401 | } |
| 402 | 402 | |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 410 | 410 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 411 | 411 | |
| 412 | - if (! $joinColumn->getType()) { |
|
| 412 | + if ( ! $joinColumn->getType()) { |
|
| 413 | 413 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 414 | 414 | } |
| 415 | 415 | |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 478 | 478 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 479 | 479 | |
| 480 | - if (! $joinColumn->getType()) { |
|
| 480 | + if ( ! $joinColumn->getType()) { |
|
| 481 | 481 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 482 | 482 | } |
| 483 | 483 | |
@@ -504,18 +504,18 @@ discard block |
||
| 504 | 504 | case Type::SMALLINT: |
| 505 | 505 | case Type::INTEGER: |
| 506 | 506 | case Type::BIGINT: |
| 507 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 507 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 508 | 508 | break; |
| 509 | 509 | |
| 510 | 510 | case Type::DATETIME: |
| 511 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 511 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 512 | 512 | break; |
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 517 | - . ' SET ' . implode(', ', $set) |
|
| 518 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 516 | + $sql = 'UPDATE '.$quotedTableName |
|
| 517 | + . ' SET '.implode(', ', $set) |
|
| 518 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 519 | 519 | |
| 520 | 520 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 521 | 521 | |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | protected function deleteJoinTableRecords($identifier) |
| 535 | 535 | { |
| 536 | 536 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 537 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 537 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 538 | 538 | continue; |
| 539 | 539 | } |
| 540 | 540 | |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $keys = []; |
| 548 | 548 | |
| 549 | 549 | if ( ! $owningAssociation->isOwningSide()) { |
| 550 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 550 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 551 | 551 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 552 | 552 | } |
| 553 | 553 | |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | // Only owning side of x-1 associations can have a FK column. |
| 662 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 662 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 663 | 663 | continue; |
| 664 | 664 | } |
| 665 | 665 | |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | /** @var JoinColumnMetadata $joinColumn */ |
| 680 | 680 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 681 | 681 | |
| 682 | - if (! $joinColumn->getType()) { |
|
| 682 | + if ( ! $joinColumn->getType()) { |
|
| 683 | 683 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 684 | 684 | } |
| 685 | 685 | |
@@ -708,7 +708,7 @@ discard block |
||
| 708 | 708 | $propertyName = $this->class->fieldNames[$columnName]; |
| 709 | 709 | $property = $this->class->getProperty($propertyName); |
| 710 | 710 | |
| 711 | - if (! $property) { |
|
| 711 | + if ( ! $property) { |
|
| 712 | 712 | return null; |
| 713 | 713 | } |
| 714 | 714 | |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | /** @var JoinColumnMetadata $joinColumn */ |
| 728 | 728 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 729 | 729 | |
| 730 | - if (! $joinColumn->getType()) { |
|
| 730 | + if ( ! $joinColumn->getType()) { |
|
| 731 | 731 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 732 | 732 | } |
| 733 | 733 | |
@@ -1064,7 +1064,7 @@ discard block |
||
| 1064 | 1064 | $criteria = []; |
| 1065 | 1065 | $parameters = []; |
| 1066 | 1066 | |
| 1067 | - if (! $association->isOwningSide()) { |
|
| 1067 | + if ( ! $association->isOwningSide()) { |
|
| 1068 | 1068 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1069 | 1069 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1070 | 1070 | } |
@@ -1092,7 +1092,7 @@ discard block |
||
| 1092 | 1092 | $value = $value[$targetClass->identifier[0]]; |
| 1093 | 1093 | } |
| 1094 | 1094 | |
| 1095 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1095 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1096 | 1096 | $parameters[] = [ |
| 1097 | 1097 | 'value' => $value, |
| 1098 | 1098 | 'field' => $fieldName, |
@@ -1143,11 +1143,11 @@ discard block |
||
| 1143 | 1143 | |
| 1144 | 1144 | switch ($lockMode) { |
| 1145 | 1145 | case LockMode::PESSIMISTIC_READ: |
| 1146 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1146 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1147 | 1147 | break; |
| 1148 | 1148 | |
| 1149 | 1149 | case LockMode::PESSIMISTIC_WRITE: |
| 1150 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1150 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1151 | 1151 | break; |
| 1152 | 1152 | } |
| 1153 | 1153 | |
@@ -1158,14 +1158,14 @@ discard block |
||
| 1158 | 1158 | |
| 1159 | 1159 | if ('' !== $filterSql) { |
| 1160 | 1160 | $conditionSql = $conditionSql |
| 1161 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1161 | + ? $conditionSql.' AND '.$filterSql |
|
| 1162 | 1162 | : $filterSql; |
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | - $select = 'SELECT ' . $columnList; |
|
| 1166 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
| 1167 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1168 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1165 | + $select = 'SELECT '.$columnList; |
|
| 1166 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1167 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1168 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1169 | 1169 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1170 | 1170 | $query = $select |
| 1171 | 1171 | . $lock |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | . $where |
| 1174 | 1174 | . $orderBySql; |
| 1175 | 1175 | |
| 1176 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1176 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1177 | 1177 | } |
| 1178 | 1178 | |
| 1179 | 1179 | /** |
@@ -1192,13 +1192,13 @@ discard block |
||
| 1192 | 1192 | |
| 1193 | 1193 | if ('' !== $filterSql) { |
| 1194 | 1194 | $conditionSql = $conditionSql |
| 1195 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1195 | + ? $conditionSql.' AND '.$filterSql |
|
| 1196 | 1196 | : $filterSql; |
| 1197 | 1197 | } |
| 1198 | 1198 | |
| 1199 | 1199 | $sql = 'SELECT COUNT(*) ' |
| 1200 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1201 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1200 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1201 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1202 | 1202 | |
| 1203 | 1203 | return $sql; |
| 1204 | 1204 | } |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | */ |
| 1216 | 1216 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1217 | 1217 | { |
| 1218 | - if (! $orderBy) { |
|
| 1218 | + if ( ! $orderBy) { |
|
| 1219 | 1219 | return ''; |
| 1220 | 1220 | } |
| 1221 | 1221 | |
@@ -1224,7 +1224,7 @@ discard block |
||
| 1224 | 1224 | foreach ($orderBy as $fieldName => $orientation) { |
| 1225 | 1225 | $orientation = strtoupper(trim($orientation)); |
| 1226 | 1226 | |
| 1227 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1227 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1228 | 1228 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
| 1229 | 1229 | } |
| 1230 | 1230 | |
@@ -1234,11 +1234,11 @@ discard block |
||
| 1234 | 1234 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1235 | 1235 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1236 | 1236 | |
| 1237 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1237 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1238 | 1238 | |
| 1239 | 1239 | continue; |
| 1240 | 1240 | } else if ($property instanceof AssociationMetadata) { |
| 1241 | - if (! $property->isOwningSide()) { |
|
| 1241 | + if ( ! $property->isOwningSide()) { |
|
| 1242 | 1242 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1243 | 1243 | $this->class->getClassName(), |
| 1244 | 1244 | $fieldName |
@@ -1254,7 +1254,7 @@ discard block |
||
| 1254 | 1254 | /* @var JoinColumnMetadata $joinColumn */ |
| 1255 | 1255 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1256 | 1256 | |
| 1257 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1257 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | 1260 | continue; |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | throw ORMException::unrecognizedField($fieldName); |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1266 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1267 | 1267 | } |
| 1268 | 1268 | |
| 1269 | 1269 | /** |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | |
| 1286 | 1286 | |
| 1287 | 1287 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
| 1288 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1288 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1289 | 1289 | |
| 1290 | 1290 | $eagerAliasCounter = 0; |
| 1291 | 1291 | $columnList = []; |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | break; // now this is why you shouldn't use inheritance |
| 1322 | 1322 | } |
| 1323 | 1323 | |
| 1324 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1324 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1325 | 1325 | |
| 1326 | 1326 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1327 | 1327 | |
@@ -1346,14 +1346,14 @@ discard block |
||
| 1346 | 1346 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1347 | 1347 | } |
| 1348 | 1348 | |
| 1349 | - if (! $property->isOwningSide()) { |
|
| 1349 | + if ( ! $property->isOwningSide()) { |
|
| 1350 | 1350 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1351 | 1351 | } |
| 1352 | 1352 | |
| 1353 | 1353 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1354 | 1354 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1355 | 1355 | |
| 1356 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1356 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1357 | 1357 | |
| 1358 | 1358 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1359 | 1359 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | $joinCondition[] = $filterSql; |
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1378 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1379 | 1379 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1380 | 1380 | |
| 1381 | 1381 | break; |
@@ -1399,7 +1399,7 @@ discard block |
||
| 1399 | 1399 | */ |
| 1400 | 1400 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1401 | 1401 | { |
| 1402 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1402 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1403 | 1403 | return ''; |
| 1404 | 1404 | } |
| 1405 | 1405 | |
@@ -1414,7 +1414,7 @@ discard block |
||
| 1414 | 1414 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1415 | 1415 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1416 | 1416 | |
| 1417 | - if (! $joinColumn->getType()) { |
|
| 1417 | + if ( ! $joinColumn->getType()) { |
|
| 1418 | 1418 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1419 | 1419 | } |
| 1420 | 1420 | |
@@ -1446,7 +1446,7 @@ discard block |
||
| 1446 | 1446 | $owningAssociation = $association; |
| 1447 | 1447 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1448 | 1448 | |
| 1449 | - if (! $association->isOwningSide()) { |
|
| 1449 | + if ( ! $association->isOwningSide()) { |
|
| 1450 | 1450 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1451 | 1451 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1452 | 1452 | } |
@@ -1468,7 +1468,7 @@ discard block |
||
| 1468 | 1468 | ); |
| 1469 | 1469 | } |
| 1470 | 1470 | |
| 1471 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1471 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1472 | 1472 | } |
| 1473 | 1473 | |
| 1474 | 1474 | /** |
@@ -1563,7 +1563,7 @@ discard block |
||
| 1563 | 1563 | $columnName = $joinColumn->getColumnName(); |
| 1564 | 1564 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1565 | 1565 | |
| 1566 | - if (! $joinColumn->getType()) { |
|
| 1566 | + if ( ! $joinColumn->getType()) { |
|
| 1567 | 1567 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1568 | 1568 | } |
| 1569 | 1569 | |
@@ -1602,7 +1602,7 @@ discard block |
||
| 1602 | 1602 | |
| 1603 | 1603 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1604 | 1604 | |
| 1605 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1605 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1606 | 1606 | } |
| 1607 | 1607 | |
| 1608 | 1608 | /** |
@@ -1616,14 +1616,14 @@ discard block |
||
| 1616 | 1616 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1617 | 1617 | { |
| 1618 | 1618 | if ($tableName) { |
| 1619 | - $tableName .= '#' . $assocName; |
|
| 1619 | + $tableName .= '#'.$assocName; |
|
| 1620 | 1620 | } |
| 1621 | 1621 | |
| 1622 | 1622 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1623 | 1623 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1626 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1627 | 1627 | |
| 1628 | 1628 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1629 | 1629 | |
@@ -1650,7 +1650,7 @@ discard block |
||
| 1650 | 1650 | } |
| 1651 | 1651 | |
| 1652 | 1652 | $lock = $this->getLockTablesSql($lockMode); |
| 1653 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1653 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1654 | 1654 | $sql = 'SELECT 1 ' |
| 1655 | 1655 | . $lock |
| 1656 | 1656 | . $where |
@@ -1673,7 +1673,7 @@ discard block |
||
| 1673 | 1673 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1674 | 1674 | |
| 1675 | 1675 | return $this->platform->appendLockHint( |
| 1676 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1676 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1677 | 1677 | $lockMode |
| 1678 | 1678 | ); |
| 1679 | 1679 | } |
@@ -1726,19 +1726,19 @@ discard block |
||
| 1726 | 1726 | |
| 1727 | 1727 | if (null !== $comparison) { |
| 1728 | 1728 | // special case null value handling |
| 1729 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
| 1730 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1729 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
| 1730 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1731 | 1731 | |
| 1732 | 1732 | continue; |
| 1733 | 1733 | } |
| 1734 | 1734 | |
| 1735 | 1735 | if ($comparison === Comparison::NEQ && null === $value) { |
| 1736 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1736 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1737 | 1737 | |
| 1738 | 1738 | continue; |
| 1739 | 1739 | } |
| 1740 | 1740 | |
| 1741 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1741 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1742 | 1742 | |
| 1743 | 1743 | continue; |
| 1744 | 1744 | } |
@@ -1787,7 +1787,7 @@ discard block |
||
| 1787 | 1787 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1788 | 1788 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1789 | 1789 | |
| 1790 | - return [$tableAlias . '.' . $columnName]; |
|
| 1790 | + return [$tableAlias.'.'.$columnName]; |
|
| 1791 | 1791 | } |
| 1792 | 1792 | |
| 1793 | 1793 | if ($property instanceof AssociationMetadata) { |
@@ -1796,7 +1796,7 @@ discard block |
||
| 1796 | 1796 | |
| 1797 | 1797 | // Many-To-Many requires join table check for joinColumn |
| 1798 | 1798 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1799 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1799 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1800 | 1800 | $owningAssociation = $association; |
| 1801 | 1801 | } |
| 1802 | 1802 | |
@@ -1810,18 +1810,18 @@ discard block |
||
| 1810 | 1810 | foreach ($joinColumns as $joinColumn) { |
| 1811 | 1811 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1812 | 1812 | |
| 1813 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1813 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1814 | 1814 | } |
| 1815 | 1815 | |
| 1816 | 1816 | } else { |
| 1817 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1817 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1818 | 1818 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1819 | 1819 | $this->class->getClassName(), |
| 1820 | 1820 | $field |
| 1821 | 1821 | ); |
| 1822 | 1822 | } |
| 1823 | 1823 | |
| 1824 | - $class = $this->class->isInheritedProperty($field) |
|
| 1824 | + $class = $this->class->isInheritedProperty($field) |
|
| 1825 | 1825 | ? $owningAssociation->getDeclaringClass() |
| 1826 | 1826 | : $this->class |
| 1827 | 1827 | ; |
@@ -1830,7 +1830,7 @@ discard block |
||
| 1830 | 1830 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1831 | 1831 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1832 | 1832 | |
| 1833 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1833 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1834 | 1834 | } |
| 1835 | 1835 | } |
| 1836 | 1836 | |
@@ -1943,7 +1943,7 @@ discard block |
||
| 1943 | 1943 | $value = $value[$targetClass->identifier[0]]; |
| 1944 | 1944 | } |
| 1945 | 1945 | |
| 1946 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
| 1946 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
| 1947 | 1947 | $parameters[] = [ |
| 1948 | 1948 | 'value' => $value, |
| 1949 | 1949 | 'field' => $fieldName, |
@@ -2030,7 +2030,7 @@ discard block |
||
| 2030 | 2030 | case ($property instanceof AssociationMetadata): |
| 2031 | 2031 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2032 | 2032 | |
| 2033 | - if (! $property->isOwningSide()) { |
|
| 2033 | + if ( ! $property->isOwningSide()) { |
|
| 2034 | 2034 | $property = $class->getProperty($property->getMappedBy()); |
| 2035 | 2035 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2036 | 2036 | } |
@@ -2044,7 +2044,7 @@ discard block |
||
| 2044 | 2044 | /** @var JoinColumnMetadata $joinColumn */ |
| 2045 | 2045 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2046 | 2046 | |
| 2047 | - if (! $joinColumn->getType()) { |
|
| 2047 | + if ( ! $joinColumn->getType()) { |
|
| 2048 | 2048 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2049 | 2049 | } |
| 2050 | 2050 | |
@@ -2059,7 +2059,7 @@ discard block |
||
| 2059 | 2059 | } |
| 2060 | 2060 | |
| 2061 | 2061 | if (is_array($value)) { |
| 2062 | - return array_map(function ($type) { |
|
| 2062 | + return array_map(function($type) { |
|
| 2063 | 2063 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2064 | 2064 | }, $types); |
| 2065 | 2065 | } |
@@ -2138,12 +2138,12 @@ discard block |
||
| 2138 | 2138 | |
| 2139 | 2139 | $sql = 'SELECT 1 ' |
| 2140 | 2140 | . $this->getLockTablesSql(null) |
| 2141 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2141 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2142 | 2142 | |
| 2143 | 2143 | list($params, $types) = $this->expandParameters($criteria); |
| 2144 | 2144 | |
| 2145 | 2145 | if (null !== $extraConditions) { |
| 2146 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2146 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2147 | 2147 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2148 | 2148 | |
| 2149 | 2149 | $params = array_merge($params, $criteriaParams); |
@@ -2151,7 +2151,7 @@ discard block |
||
| 2151 | 2151 | } |
| 2152 | 2152 | |
| 2153 | 2153 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
| 2154 | - $sql .= ' AND ' . $filterSql; |
|
| 2154 | + $sql .= ' AND '.$filterSql; |
|
| 2155 | 2155 | } |
| 2156 | 2156 | |
| 2157 | 2157 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2166,13 +2166,13 @@ discard block |
||
| 2166 | 2166 | */ |
| 2167 | 2167 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2168 | 2168 | { |
| 2169 | - if (! $association->isOwningSide()) { |
|
| 2169 | + if ( ! $association->isOwningSide()) { |
|
| 2170 | 2170 | return 'LEFT JOIN'; |
| 2171 | 2171 | } |
| 2172 | 2172 | |
| 2173 | 2173 | // if one of the join columns is nullable, return left join |
| 2174 | 2174 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2175 | - if (! $joinColumn->isNullable()) { |
|
| 2175 | + if ( ! $joinColumn->isNullable()) { |
|
| 2176 | 2176 | continue; |
| 2177 | 2177 | } |
| 2178 | 2178 | |
@@ -2189,7 +2189,7 @@ discard block |
||
| 2189 | 2189 | */ |
| 2190 | 2190 | public function getSQLColumnAlias() |
| 2191 | 2191 | { |
| 2192 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2192 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2193 | 2193 | } |
| 2194 | 2194 | |
| 2195 | 2195 | /** |
@@ -2206,13 +2206,13 @@ discard block |
||
| 2206 | 2206 | |
| 2207 | 2207 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 2208 | 2208 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 2209 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2209 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2210 | 2210 | } |
| 2211 | 2211 | } |
| 2212 | 2212 | |
| 2213 | 2213 | $sql = implode(' AND ', $filterClauses); |
| 2214 | 2214 | |
| 2215 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2215 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2216 | 2216 | } |
| 2217 | 2217 | |
| 2218 | 2218 | /** |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM; |
| 6 | 6 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public static function queryCacheUsesNonPersistentCache(CacheDriver $cache) |
| 80 | 80 | { |
| 81 | - return new self('Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'); |
|
| 81 | + return new self('Query Cache uses a non-persistent cache driver, '.get_class($cache).'.'); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /** |
@@ -88,6 +88,6 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public static function metadataCacheUsesNonPersistentCache(CacheDriver $cache) |
| 90 | 90 | { |
| 91 | - return new self('Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.'); |
|
| 91 | + return new self('Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.'); |
|
| 92 | 92 | } |
| 93 | 93 | } |