@@ -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; |
| 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\Repository; |
| 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; |
| 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\Repository; |
| 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\Persisters\Entity; |
| 6 | 6 | |
@@ -301,14 +301,14 @@ discard block |
||
| 301 | 301 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 302 | 302 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 303 | 303 | $identifier = array_map( |
| 304 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 304 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 305 | 305 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 306 | 306 | ); |
| 307 | 307 | |
| 308 | 308 | // FIXME: Order with composite keys might not be correct |
| 309 | - $sql = 'SELECT ' . $columnName |
|
| 310 | - . ' FROM ' . $tableName |
|
| 311 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 309 | + $sql = 'SELECT '.$columnName |
|
| 310 | + . ' FROM '.$tableName |
|
| 311 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 312 | 312 | |
| 313 | 313 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 314 | 314 | $versionType = $versionProperty->getType(); |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | if (($value = $identifier[$field]) !== null) { |
| 396 | 396 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 397 | - if (! is_array($value)) { |
|
| 397 | + if ( ! is_array($value)) { |
|
| 398 | 398 | $value = [$targetClass->identifier[0] => $value]; |
| 399 | 399 | } |
| 400 | 400 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 408 | 408 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 409 | 409 | |
| 410 | - if (! $joinColumn->getType()) { |
|
| 410 | + if ( ! $joinColumn->getType()) { |
|
| 411 | 411 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 412 | 412 | } |
| 413 | 413 | |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 476 | 476 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 477 | 477 | |
| 478 | - if (! $joinColumn->getType()) { |
|
| 478 | + if ( ! $joinColumn->getType()) { |
|
| 479 | 479 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 480 | 480 | } |
| 481 | 481 | |
@@ -502,18 +502,18 @@ discard block |
||
| 502 | 502 | case Type::SMALLINT: |
| 503 | 503 | case Type::INTEGER: |
| 504 | 504 | case Type::BIGINT: |
| 505 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 505 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 506 | 506 | break; |
| 507 | 507 | |
| 508 | 508 | case Type::DATETIME: |
| 509 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 509 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 510 | 510 | break; |
| 511 | 511 | } |
| 512 | 512 | } |
| 513 | 513 | |
| 514 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 515 | - . ' SET ' . implode(', ', $set) |
|
| 516 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 514 | + $sql = 'UPDATE '.$quotedTableName |
|
| 515 | + . ' SET '.implode(', ', $set) |
|
| 516 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 517 | 517 | |
| 518 | 518 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 519 | 519 | |
@@ -532,7 +532,7 @@ discard block |
||
| 532 | 532 | protected function deleteJoinTableRecords($identifier) |
| 533 | 533 | { |
| 534 | 534 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 535 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 535 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 536 | 536 | continue; |
| 537 | 537 | } |
| 538 | 538 | |
@@ -545,7 +545,7 @@ discard block |
||
| 545 | 545 | $keys = []; |
| 546 | 546 | |
| 547 | 547 | if ( ! $owningAssociation->isOwningSide()) { |
| 548 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 548 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 549 | 549 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 550 | 550 | } |
| 551 | 551 | |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | // Only owning side of x-1 associations can have a FK column. |
| 660 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 660 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 661 | 661 | continue; |
| 662 | 662 | } |
| 663 | 663 | |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | /** @var JoinColumnMetadata $joinColumn */ |
| 678 | 678 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 679 | 679 | |
| 680 | - if (! $joinColumn->getType()) { |
|
| 680 | + if ( ! $joinColumn->getType()) { |
|
| 681 | 681 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 682 | 682 | } |
| 683 | 683 | |
@@ -706,7 +706,7 @@ discard block |
||
| 706 | 706 | $propertyName = $this->class->fieldNames[$columnName]; |
| 707 | 707 | $property = $this->class->getProperty($propertyName); |
| 708 | 708 | |
| 709 | - if (! $property) { |
|
| 709 | + if ( ! $property) { |
|
| 710 | 710 | return null; |
| 711 | 711 | } |
| 712 | 712 | |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | /** @var JoinColumnMetadata $joinColumn */ |
| 726 | 726 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 727 | 727 | |
| 728 | - if (! $joinColumn->getType()) { |
|
| 728 | + if ( ! $joinColumn->getType()) { |
|
| 729 | 729 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 730 | 730 | } |
| 731 | 731 | |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | // unset the old value and set the new sql aliased value here. By definition |
| 843 | 843 | // unset($identifier[$targetKeyColumn] works here with how UnitOfWork::createEntity() calls this method. |
| 844 | 844 | // @todo guilhermeblanco In master we have: $identifier[$targetClass->getFieldForColumn($targetKeyColumn)] = |
| 845 | - $identifier[$targetTableAlias . "." . $targetKeyColumn] = $value; |
|
| 845 | + $identifier[$targetTableAlias.".".$targetKeyColumn] = $value; |
|
| 846 | 846 | |
| 847 | 847 | unset($identifier[$targetKeyColumn]); |
| 848 | 848 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | $criteria = []; |
| 1063 | 1063 | $parameters = []; |
| 1064 | 1064 | |
| 1065 | - if (! $association->isOwningSide()) { |
|
| 1065 | + if ( ! $association->isOwningSide()) { |
|
| 1066 | 1066 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1067 | 1067 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1068 | 1068 | } |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | $value = $value[$targetClass->identifier[0]]; |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1093 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1094 | 1094 | $parameters[] = [ |
| 1095 | 1095 | 'value' => $value, |
| 1096 | 1096 | 'field' => $fieldName, |
@@ -1141,11 +1141,11 @@ discard block |
||
| 1141 | 1141 | |
| 1142 | 1142 | switch ($lockMode) { |
| 1143 | 1143 | case LockMode::PESSIMISTIC_READ: |
| 1144 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1144 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1145 | 1145 | break; |
| 1146 | 1146 | |
| 1147 | 1147 | case LockMode::PESSIMISTIC_WRITE: |
| 1148 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1148 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1149 | 1149 | break; |
| 1150 | 1150 | } |
| 1151 | 1151 | |
@@ -1156,14 +1156,14 @@ discard block |
||
| 1156 | 1156 | |
| 1157 | 1157 | if ('' !== $filterSql) { |
| 1158 | 1158 | $conditionSql = $conditionSql |
| 1159 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1159 | + ? $conditionSql.' AND '.$filterSql |
|
| 1160 | 1160 | : $filterSql; |
| 1161 | 1161 | } |
| 1162 | 1162 | |
| 1163 | - $select = 'SELECT ' . $columnList; |
|
| 1164 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
| 1165 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1166 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1163 | + $select = 'SELECT '.$columnList; |
|
| 1164 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1165 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1166 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1167 | 1167 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1168 | 1168 | $query = $select |
| 1169 | 1169 | . $lock |
@@ -1171,7 +1171,7 @@ discard block |
||
| 1171 | 1171 | . $where |
| 1172 | 1172 | . $orderBySql; |
| 1173 | 1173 | |
| 1174 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1174 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1175 | 1175 | } |
| 1176 | 1176 | |
| 1177 | 1177 | /** |
@@ -1190,13 +1190,13 @@ discard block |
||
| 1190 | 1190 | |
| 1191 | 1191 | if ('' !== $filterSql) { |
| 1192 | 1192 | $conditionSql = $conditionSql |
| 1193 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1193 | + ? $conditionSql.' AND '.$filterSql |
|
| 1194 | 1194 | : $filterSql; |
| 1195 | 1195 | } |
| 1196 | 1196 | |
| 1197 | 1197 | $sql = 'SELECT COUNT(*) ' |
| 1198 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1199 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1198 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1199 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1200 | 1200 | |
| 1201 | 1201 | return $sql; |
| 1202 | 1202 | } |
@@ -1213,7 +1213,7 @@ discard block |
||
| 1213 | 1213 | */ |
| 1214 | 1214 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1215 | 1215 | { |
| 1216 | - if (! $orderBy) { |
|
| 1216 | + if ( ! $orderBy) { |
|
| 1217 | 1217 | return ''; |
| 1218 | 1218 | } |
| 1219 | 1219 | |
@@ -1222,7 +1222,7 @@ discard block |
||
| 1222 | 1222 | foreach ($orderBy as $fieldName => $orientation) { |
| 1223 | 1223 | $orientation = strtoupper(trim($orientation)); |
| 1224 | 1224 | |
| 1225 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1225 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1226 | 1226 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
| 1227 | 1227 | } |
| 1228 | 1228 | |
@@ -1232,11 +1232,11 @@ discard block |
||
| 1232 | 1232 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1233 | 1233 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1234 | 1234 | |
| 1235 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1235 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1236 | 1236 | |
| 1237 | 1237 | continue; |
| 1238 | 1238 | } else if ($property instanceof AssociationMetadata) { |
| 1239 | - if (! $property->isOwningSide()) { |
|
| 1239 | + if ( ! $property->isOwningSide()) { |
|
| 1240 | 1240 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1241 | 1241 | $this->class->getClassName(), |
| 1242 | 1242 | $fieldName |
@@ -1252,7 +1252,7 @@ discard block |
||
| 1252 | 1252 | /* @var JoinColumnMetadata $joinColumn */ |
| 1253 | 1253 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1254 | 1254 | |
| 1255 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1255 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1256 | 1256 | } |
| 1257 | 1257 | |
| 1258 | 1258 | continue; |
@@ -1261,7 +1261,7 @@ discard block |
||
| 1261 | 1261 | throw ORMException::unrecognizedField($fieldName); |
| 1262 | 1262 | } |
| 1263 | 1263 | |
| 1264 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1264 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1265 | 1265 | } |
| 1266 | 1266 | |
| 1267 | 1267 | /** |
@@ -1283,7 +1283,7 @@ discard block |
||
| 1283 | 1283 | |
| 1284 | 1284 | |
| 1285 | 1285 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
| 1286 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1286 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1287 | 1287 | |
| 1288 | 1288 | $eagerAliasCounter = 0; |
| 1289 | 1289 | $columnList = []; |
@@ -1319,7 +1319,7 @@ discard block |
||
| 1319 | 1319 | break; // now this is why you shouldn't use inheritance |
| 1320 | 1320 | } |
| 1321 | 1321 | |
| 1322 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1322 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1323 | 1323 | |
| 1324 | 1324 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1325 | 1325 | |
@@ -1344,14 +1344,14 @@ discard block |
||
| 1344 | 1344 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1345 | 1345 | } |
| 1346 | 1346 | |
| 1347 | - if (! $property->isOwningSide()) { |
|
| 1347 | + if ( ! $property->isOwningSide()) { |
|
| 1348 | 1348 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1349 | 1349 | } |
| 1350 | 1350 | |
| 1351 | 1351 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1352 | 1352 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1353 | 1353 | |
| 1354 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1354 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1355 | 1355 | |
| 1356 | 1356 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1357 | 1357 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1373,7 +1373,7 @@ discard block |
||
| 1373 | 1373 | $joinCondition[] = $filterSql; |
| 1374 | 1374 | } |
| 1375 | 1375 | |
| 1376 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1376 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1377 | 1377 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1378 | 1378 | |
| 1379 | 1379 | break; |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | */ |
| 1398 | 1398 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1399 | 1399 | { |
| 1400 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1400 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1401 | 1401 | return ''; |
| 1402 | 1402 | } |
| 1403 | 1403 | |
@@ -1412,7 +1412,7 @@ discard block |
||
| 1412 | 1412 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1413 | 1413 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1414 | 1414 | |
| 1415 | - if (! $joinColumn->getType()) { |
|
| 1415 | + if ( ! $joinColumn->getType()) { |
|
| 1416 | 1416 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1417 | 1417 | } |
| 1418 | 1418 | |
@@ -1444,7 +1444,7 @@ discard block |
||
| 1444 | 1444 | $owningAssociation = $association; |
| 1445 | 1445 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1446 | 1446 | |
| 1447 | - if (! $association->isOwningSide()) { |
|
| 1447 | + if ( ! $association->isOwningSide()) { |
|
| 1448 | 1448 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1449 | 1449 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1450 | 1450 | } |
@@ -1466,7 +1466,7 @@ discard block |
||
| 1466 | 1466 | ); |
| 1467 | 1467 | } |
| 1468 | 1468 | |
| 1469 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1469 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1470 | 1470 | } |
| 1471 | 1471 | |
| 1472 | 1472 | /** |
@@ -1561,7 +1561,7 @@ discard block |
||
| 1561 | 1561 | $columnName = $joinColumn->getColumnName(); |
| 1562 | 1562 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1563 | 1563 | |
| 1564 | - if (! $joinColumn->getType()) { |
|
| 1564 | + if ( ! $joinColumn->getType()) { |
|
| 1565 | 1565 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1566 | 1566 | } |
| 1567 | 1567 | |
@@ -1600,7 +1600,7 @@ discard block |
||
| 1600 | 1600 | |
| 1601 | 1601 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1602 | 1602 | |
| 1603 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1603 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1604 | 1604 | } |
| 1605 | 1605 | |
| 1606 | 1606 | /** |
@@ -1614,14 +1614,14 @@ discard block |
||
| 1614 | 1614 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1615 | 1615 | { |
| 1616 | 1616 | if ($tableName) { |
| 1617 | - $tableName .= '#' . $assocName; |
|
| 1617 | + $tableName .= '#'.$assocName; |
|
| 1618 | 1618 | } |
| 1619 | 1619 | |
| 1620 | 1620 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1621 | 1621 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1622 | 1622 | } |
| 1623 | 1623 | |
| 1624 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1624 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1625 | 1625 | |
| 1626 | 1626 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1627 | 1627 | |
@@ -1648,7 +1648,7 @@ discard block |
||
| 1648 | 1648 | } |
| 1649 | 1649 | |
| 1650 | 1650 | $lock = $this->getLockTablesSql($lockMode); |
| 1651 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1651 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1652 | 1652 | $sql = 'SELECT 1 ' |
| 1653 | 1653 | . $lock |
| 1654 | 1654 | . $where |
@@ -1671,7 +1671,7 @@ discard block |
||
| 1671 | 1671 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1672 | 1672 | |
| 1673 | 1673 | return $this->platform->appendLockHint( |
| 1674 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1674 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1675 | 1675 | $lockMode |
| 1676 | 1676 | ); |
| 1677 | 1677 | } |
@@ -1724,19 +1724,19 @@ discard block |
||
| 1724 | 1724 | |
| 1725 | 1725 | if (null !== $comparison) { |
| 1726 | 1726 | // special case null value handling |
| 1727 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
| 1728 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1727 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
| 1728 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1729 | 1729 | |
| 1730 | 1730 | continue; |
| 1731 | 1731 | } |
| 1732 | 1732 | |
| 1733 | 1733 | if ($comparison === Comparison::NEQ && null === $value) { |
| 1734 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1734 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1735 | 1735 | |
| 1736 | 1736 | continue; |
| 1737 | 1737 | } |
| 1738 | 1738 | |
| 1739 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1739 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1740 | 1740 | |
| 1741 | 1741 | continue; |
| 1742 | 1742 | } |
@@ -1785,7 +1785,7 @@ discard block |
||
| 1785 | 1785 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1786 | 1786 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1787 | 1787 | |
| 1788 | - return [$tableAlias . '.' . $columnName]; |
|
| 1788 | + return [$tableAlias.'.'.$columnName]; |
|
| 1789 | 1789 | } |
| 1790 | 1790 | |
| 1791 | 1791 | if ($property instanceof AssociationMetadata) { |
@@ -1794,7 +1794,7 @@ discard block |
||
| 1794 | 1794 | |
| 1795 | 1795 | // Many-To-Many requires join table check for joinColumn |
| 1796 | 1796 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1797 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1797 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1798 | 1798 | $owningAssociation = $association; |
| 1799 | 1799 | } |
| 1800 | 1800 | |
@@ -1808,18 +1808,18 @@ discard block |
||
| 1808 | 1808 | foreach ($joinColumns as $joinColumn) { |
| 1809 | 1809 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1810 | 1810 | |
| 1811 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1811 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1812 | 1812 | } |
| 1813 | 1813 | |
| 1814 | 1814 | } else { |
| 1815 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1815 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1816 | 1816 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1817 | 1817 | $this->class->getClassName(), |
| 1818 | 1818 | $field |
| 1819 | 1819 | ); |
| 1820 | 1820 | } |
| 1821 | 1821 | |
| 1822 | - $class = $this->class->isInheritedProperty($field) |
|
| 1822 | + $class = $this->class->isInheritedProperty($field) |
|
| 1823 | 1823 | ? $owningAssociation->getDeclaringClass() |
| 1824 | 1824 | : $this->class |
| 1825 | 1825 | ; |
@@ -1828,7 +1828,7 @@ discard block |
||
| 1828 | 1828 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1829 | 1829 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1830 | 1830 | |
| 1831 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1831 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1832 | 1832 | } |
| 1833 | 1833 | } |
| 1834 | 1834 | |
@@ -1941,7 +1941,7 @@ discard block |
||
| 1941 | 1941 | $value = $value[$targetClass->identifier[0]]; |
| 1942 | 1942 | } |
| 1943 | 1943 | |
| 1944 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
| 1944 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
| 1945 | 1945 | $parameters[] = [ |
| 1946 | 1946 | 'value' => $value, |
| 1947 | 1947 | 'field' => $fieldName, |
@@ -2028,7 +2028,7 @@ discard block |
||
| 2028 | 2028 | case ($property instanceof AssociationMetadata): |
| 2029 | 2029 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2030 | 2030 | |
| 2031 | - if (! $property->isOwningSide()) { |
|
| 2031 | + if ( ! $property->isOwningSide()) { |
|
| 2032 | 2032 | $property = $class->getProperty($property->getMappedBy()); |
| 2033 | 2033 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2034 | 2034 | } |
@@ -2042,7 +2042,7 @@ discard block |
||
| 2042 | 2042 | /** @var JoinColumnMetadata $joinColumn */ |
| 2043 | 2043 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2044 | 2044 | |
| 2045 | - if (! $joinColumn->getType()) { |
|
| 2045 | + if ( ! $joinColumn->getType()) { |
|
| 2046 | 2046 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2047 | 2047 | } |
| 2048 | 2048 | |
@@ -2057,7 +2057,7 @@ discard block |
||
| 2057 | 2057 | } |
| 2058 | 2058 | |
| 2059 | 2059 | if (is_array($value)) { |
| 2060 | - return array_map(function ($type) { |
|
| 2060 | + return array_map(function($type) { |
|
| 2061 | 2061 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2062 | 2062 | }, $types); |
| 2063 | 2063 | } |
@@ -2136,12 +2136,12 @@ discard block |
||
| 2136 | 2136 | |
| 2137 | 2137 | $sql = 'SELECT 1 ' |
| 2138 | 2138 | . $this->getLockTablesSql(null) |
| 2139 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2139 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2140 | 2140 | |
| 2141 | 2141 | list($params, $types) = $this->expandParameters($criteria); |
| 2142 | 2142 | |
| 2143 | 2143 | if (null !== $extraConditions) { |
| 2144 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2144 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2145 | 2145 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2146 | 2146 | |
| 2147 | 2147 | $params = array_merge($params, $criteriaParams); |
@@ -2149,7 +2149,7 @@ discard block |
||
| 2149 | 2149 | } |
| 2150 | 2150 | |
| 2151 | 2151 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
| 2152 | - $sql .= ' AND ' . $filterSql; |
|
| 2152 | + $sql .= ' AND '.$filterSql; |
|
| 2153 | 2153 | } |
| 2154 | 2154 | |
| 2155 | 2155 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2164,13 +2164,13 @@ discard block |
||
| 2164 | 2164 | */ |
| 2165 | 2165 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2166 | 2166 | { |
| 2167 | - if (! $association->isOwningSide()) { |
|
| 2167 | + if ( ! $association->isOwningSide()) { |
|
| 2168 | 2168 | return 'LEFT JOIN'; |
| 2169 | 2169 | } |
| 2170 | 2170 | |
| 2171 | 2171 | // if one of the join columns is nullable, return left join |
| 2172 | 2172 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2173 | - if (! $joinColumn->isNullable()) { |
|
| 2173 | + if ( ! $joinColumn->isNullable()) { |
|
| 2174 | 2174 | continue; |
| 2175 | 2175 | } |
| 2176 | 2176 | |
@@ -2187,7 +2187,7 @@ discard block |
||
| 2187 | 2187 | */ |
| 2188 | 2188 | public function getSQLColumnAlias() |
| 2189 | 2189 | { |
| 2190 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2190 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2191 | 2191 | } |
| 2192 | 2192 | |
| 2193 | 2193 | /** |
@@ -2204,13 +2204,13 @@ discard block |
||
| 2204 | 2204 | |
| 2205 | 2205 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 2206 | 2206 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 2207 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2207 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2208 | 2208 | } |
| 2209 | 2209 | } |
| 2210 | 2210 | |
| 2211 | 2211 | $sql = implode(' AND ', $filterClauses); |
| 2212 | 2212 | |
| 2213 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2213 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2214 | 2214 | } |
| 2215 | 2215 | |
| 2216 | 2216 | /** |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Doctrine\Common\Persistence\ObjectRepository; |
| 10 | 10 | use Doctrine\Common\Util\Inflector; |
| 11 | 11 | use Doctrine\ORM\Query\ResultSetMappingBuilder; |
| 12 | -use Doctrine\ORM\Repository\InvalidFindByCall; |
|
| 13 | 12 | use Doctrine\ORM\Repository\InvalidMagicMethodCall; |
| 14 | 13 | |
| 15 | 14 | /** |
@@ -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 | |
@@ -294,8 +294,8 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | private function resolveMagicCall($method, $by, array $arguments) |
| 296 | 296 | { |
| 297 | - if (! $arguments) { |
|
| 298 | - throw InvalidMagicMethodCall::onMissingParameter($method . $by); |
|
| 297 | + if ( ! $arguments) { |
|
| 298 | + throw InvalidMagicMethodCall::onMissingParameter($method.$by); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | $fieldName = lcfirst(Inflector::classify($by)); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | throw InvalidMagicMethodCall::becauseFieldNotFoundIn( |
| 305 | 305 | $this->entityName, |
| 306 | 306 | $fieldName, |
| 307 | - $method . $by |
|
| 307 | + $method.$by |
|
| 308 | 308 | ); |
| 309 | 309 | } |
| 310 | 310 | |
@@ -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; |
| 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; |
| 6 | 6 | |