@@ -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 | |
@@ -300,14 +300,14 @@ discard block |
||
| 300 | 300 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 301 | 301 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 302 | 302 | $identifier = array_map( |
| 303 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 303 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
| 304 | 304 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 305 | 305 | ); |
| 306 | 306 | |
| 307 | 307 | // FIXME: Order with composite keys might not be correct |
| 308 | - $sql = 'SELECT ' . $columnName |
|
| 309 | - . ' FROM ' . $tableName |
|
| 310 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 308 | + $sql = 'SELECT '.$columnName |
|
| 309 | + . ' FROM '.$tableName |
|
| 310 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 311 | 311 | |
| 312 | 312 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 313 | 313 | $versionType = $versionProperty->getType(); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | |
| 394 | 394 | if (($value = $identifier[$field]) !== null) { |
| 395 | 395 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 396 | - if (! is_array($value)) { |
|
| 396 | + if ( ! is_array($value)) { |
|
| 397 | 397 | $value = [$targetClass->identifier[0] => $value]; |
| 398 | 398 | } |
| 399 | 399 | |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | $quotedJoinColumnName = $this->platform->quoteIdentifier($joinColumnName); |
| 407 | 407 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 408 | 408 | |
| 409 | - if (! $joinColumn->getType()) { |
|
| 409 | + if ( ! $joinColumn->getType()) { |
|
| 410 | 410 | $joinColumn->setType( |
| 411 | 411 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
| 412 | 412 | ); |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | $type = $column->getType(); |
| 449 | 449 | $placeholder = $type->convertToDatabaseValueSQL('?', $this->platform); |
| 450 | 450 | |
| 451 | - $set[] = $quotedColumnName . ' = ' . $placeholder; |
|
| 451 | + $set[] = $quotedColumnName.' = '.$placeholder; |
|
| 452 | 452 | $params[] = $value; |
| 453 | 453 | $types[] = $type; |
| 454 | 454 | } |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | /** @var JoinColumnMetadata $joinColumn */ |
| 476 | 476 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 477 | 477 | |
| 478 | - if (! $joinColumn->getType()) { |
|
| 478 | + if ( ! $joinColumn->getType()) { |
|
| 479 | 479 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 480 | 480 | |
| 481 | 481 | $joinColumn->setType( |
@@ -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->getProperties() 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 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 684 | 684 | |
| 685 | 685 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | $propertyName = $this->class->fieldNames[$columnName]; |
| 711 | 711 | $property = $this->class->getProperty($propertyName); |
| 712 | 712 | |
| 713 | - if (! $property) { |
|
| 713 | + if ( ! $property) { |
|
| 714 | 714 | return null; |
| 715 | 715 | } |
| 716 | 716 | |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | /** @var JoinColumnMetadata $joinColumn */ |
| 729 | 729 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 730 | 730 | |
| 731 | - if (! $joinColumn->getType()) { |
|
| 731 | + if ( ! $joinColumn->getType()) { |
|
| 732 | 732 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 733 | 733 | |
| 734 | 734 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | // unset the old value and set the new sql aliased value here. By definition |
| 848 | 848 | // unset($identifier[$targetKeyColumn] works here with how UnitOfWork::createEntity() calls this method. |
| 849 | 849 | // @todo guilhermeblanco In master we have: $identifier[$targetClass->getFieldForColumn($targetKeyColumn)] = |
| 850 | - $identifier[$targetTableAlias . "." . $targetKeyColumn] = $value; |
|
| 850 | + $identifier[$targetTableAlias.".".$targetKeyColumn] = $value; |
|
| 851 | 851 | |
| 852 | 852 | unset($identifier[$targetKeyColumn]); |
| 853 | 853 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | $criteria = []; |
| 1068 | 1068 | $parameters = []; |
| 1069 | 1069 | |
| 1070 | - if (! $association->isOwningSide()) { |
|
| 1070 | + if ( ! $association->isOwningSide()) { |
|
| 1071 | 1071 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1072 | 1072 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1073 | 1073 | } |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | $value = $value[$targetClass->identifier[0]]; |
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1098 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1099 | 1099 | $parameters[] = [ |
| 1100 | 1100 | 'value' => $value, |
| 1101 | 1101 | 'field' => $fieldName, |
@@ -1146,11 +1146,11 @@ discard block |
||
| 1146 | 1146 | |
| 1147 | 1147 | switch ($lockMode) { |
| 1148 | 1148 | case LockMode::PESSIMISTIC_READ: |
| 1149 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1149 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1150 | 1150 | break; |
| 1151 | 1151 | |
| 1152 | 1152 | case LockMode::PESSIMISTIC_WRITE: |
| 1153 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1153 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1154 | 1154 | break; |
| 1155 | 1155 | } |
| 1156 | 1156 | |
@@ -1161,14 +1161,14 @@ discard block |
||
| 1161 | 1161 | |
| 1162 | 1162 | if ('' !== $filterSql) { |
| 1163 | 1163 | $conditionSql = $conditionSql |
| 1164 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1164 | + ? $conditionSql.' AND '.$filterSql |
|
| 1165 | 1165 | : $filterSql; |
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | - $select = 'SELECT ' . $columnList; |
|
| 1169 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
| 1170 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1171 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1168 | + $select = 'SELECT '.$columnList; |
|
| 1169 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1170 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1171 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1172 | 1172 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1173 | 1173 | $query = $select |
| 1174 | 1174 | . $lock |
@@ -1176,7 +1176,7 @@ discard block |
||
| 1176 | 1176 | . $where |
| 1177 | 1177 | . $orderBySql; |
| 1178 | 1178 | |
| 1179 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1179 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | 1182 | /** |
@@ -1195,13 +1195,13 @@ discard block |
||
| 1195 | 1195 | |
| 1196 | 1196 | if ('' !== $filterSql) { |
| 1197 | 1197 | $conditionSql = $conditionSql |
| 1198 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1198 | + ? $conditionSql.' AND '.$filterSql |
|
| 1199 | 1199 | : $filterSql; |
| 1200 | 1200 | } |
| 1201 | 1201 | |
| 1202 | 1202 | $sql = 'SELECT COUNT(*) ' |
| 1203 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1204 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1203 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1204 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1205 | 1205 | |
| 1206 | 1206 | return $sql; |
| 1207 | 1207 | } |
@@ -1218,7 +1218,7 @@ discard block |
||
| 1218 | 1218 | */ |
| 1219 | 1219 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1220 | 1220 | { |
| 1221 | - if (! $orderBy) { |
|
| 1221 | + if ( ! $orderBy) { |
|
| 1222 | 1222 | return ''; |
| 1223 | 1223 | } |
| 1224 | 1224 | |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | foreach ($orderBy as $fieldName => $orientation) { |
| 1228 | 1228 | $orientation = strtoupper(trim($orientation)); |
| 1229 | 1229 | |
| 1230 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1230 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1231 | 1231 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
| 1232 | 1232 | } |
| 1233 | 1233 | |
@@ -1237,11 +1237,11 @@ discard block |
||
| 1237 | 1237 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1238 | 1238 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1239 | 1239 | |
| 1240 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1240 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1241 | 1241 | |
| 1242 | 1242 | continue; |
| 1243 | 1243 | } else if ($property instanceof AssociationMetadata) { |
| 1244 | - if (! $property->isOwningSide()) { |
|
| 1244 | + if ( ! $property->isOwningSide()) { |
|
| 1245 | 1245 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName); |
| 1246 | 1246 | } |
| 1247 | 1247 | |
@@ -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 | |
@@ -1345,14 +1345,14 @@ discard block |
||
| 1345 | 1345 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | - if (! $property->isOwningSide()) { |
|
| 1348 | + if ( ! $property->isOwningSide()) { |
|
| 1349 | 1349 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | 1352 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1353 | 1353 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1354 | 1354 | |
| 1355 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1355 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1356 | 1356 | |
| 1357 | 1357 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1358 | 1358 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | $joinCondition[] = $filterSql; |
| 1375 | 1375 | } |
| 1376 | 1376 | |
| 1377 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1377 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1378 | 1378 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1379 | 1379 | |
| 1380 | 1380 | break; |
@@ -1398,7 +1398,7 @@ discard block |
||
| 1398 | 1398 | */ |
| 1399 | 1399 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1400 | 1400 | { |
| 1401 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1401 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1402 | 1402 | return ''; |
| 1403 | 1403 | } |
| 1404 | 1404 | |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | $quotedColumnName = $this->platform->quoteIdentifier($columnName); |
| 1412 | 1412 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1413 | 1413 | |
| 1414 | - if (! $joinColumn->getType()) { |
|
| 1414 | + if ( ! $joinColumn->getType()) { |
|
| 1415 | 1415 | $joinColumn->setType( |
| 1416 | 1416 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
| 1417 | 1417 | ); |
@@ -1445,7 +1445,7 @@ discard block |
||
| 1445 | 1445 | $owningAssociation = $association; |
| 1446 | 1446 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1447 | 1447 | |
| 1448 | - if (! $association->isOwningSide()) { |
|
| 1448 | + if ( ! $association->isOwningSide()) { |
|
| 1449 | 1449 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1450 | 1450 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1451 | 1451 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
| 1467 | 1467 | ); |
| 1468 | 1468 | } |
| 1469 | 1469 | |
| 1470 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1470 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1471 | 1471 | } |
| 1472 | 1472 | |
| 1473 | 1473 | /** |
@@ -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( |
| 1566 | 1566 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
| 1567 | 1567 | ); |
@@ -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,15 +1810,15 @@ 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 ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field); |
| 1819 | 1819 | } |
| 1820 | 1820 | |
| 1821 | - $class = $this->class->isInheritedProperty($field) |
|
| 1821 | + $class = $this->class->isInheritedProperty($field) |
|
| 1822 | 1822 | ? $owningAssociation->getDeclaringClass() |
| 1823 | 1823 | : $this->class |
| 1824 | 1824 | ; |
@@ -1827,7 +1827,7 @@ discard block |
||
| 1827 | 1827 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1828 | 1828 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1829 | 1829 | |
| 1830 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1830 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1831 | 1831 | } |
| 1832 | 1832 | } |
| 1833 | 1833 | |
@@ -1940,7 +1940,7 @@ discard block |
||
| 1940 | 1940 | $value = $value[$targetClass->identifier[0]]; |
| 1941 | 1941 | } |
| 1942 | 1942 | |
| 1943 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
| 1943 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
| 1944 | 1944 | $parameters[] = [ |
| 1945 | 1945 | 'value' => $value, |
| 1946 | 1946 | 'field' => $fieldName, |
@@ -2027,7 +2027,7 @@ discard block |
||
| 2027 | 2027 | case ($property instanceof AssociationMetadata): |
| 2028 | 2028 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2029 | 2029 | |
| 2030 | - if (! $property->isOwningSide()) { |
|
| 2030 | + if ( ! $property->isOwningSide()) { |
|
| 2031 | 2031 | $property = $class->getProperty($property->getMappedBy()); |
| 2032 | 2032 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2033 | 2033 | } |
@@ -2038,7 +2038,7 @@ discard block |
||
| 2038 | 2038 | ; |
| 2039 | 2039 | |
| 2040 | 2040 | foreach ($joinColumns as $joinColumn) { |
| 2041 | - if (! $joinColumn->getType()) { |
|
| 2041 | + if ( ! $joinColumn->getType()) { |
|
| 2042 | 2042 | $joinColumn->setType( |
| 2043 | 2043 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $class, $this->em) |
| 2044 | 2044 | ); |
@@ -2055,7 +2055,7 @@ discard block |
||
| 2055 | 2055 | } |
| 2056 | 2056 | |
| 2057 | 2057 | if (is_array($value)) { |
| 2058 | - return array_map(function ($type) { |
|
| 2058 | + return array_map(function($type) { |
|
| 2059 | 2059 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2060 | 2060 | }, $types); |
| 2061 | 2061 | } |
@@ -2134,12 +2134,12 @@ discard block |
||
| 2134 | 2134 | |
| 2135 | 2135 | $sql = 'SELECT 1 ' |
| 2136 | 2136 | . $this->getLockTablesSql(null) |
| 2137 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2137 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2138 | 2138 | |
| 2139 | 2139 | list($params, $types) = $this->expandParameters($criteria); |
| 2140 | 2140 | |
| 2141 | 2141 | if (null !== $extraConditions) { |
| 2142 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2142 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2143 | 2143 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2144 | 2144 | |
| 2145 | 2145 | $params = array_merge($params, $criteriaParams); |
@@ -2147,7 +2147,7 @@ discard block |
||
| 2147 | 2147 | } |
| 2148 | 2148 | |
| 2149 | 2149 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
| 2150 | - $sql .= ' AND ' . $filterSql; |
|
| 2150 | + $sql .= ' AND '.$filterSql; |
|
| 2151 | 2151 | } |
| 2152 | 2152 | |
| 2153 | 2153 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2162,13 +2162,13 @@ discard block |
||
| 2162 | 2162 | */ |
| 2163 | 2163 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2164 | 2164 | { |
| 2165 | - if (! $association->isOwningSide()) { |
|
| 2165 | + if ( ! $association->isOwningSide()) { |
|
| 2166 | 2166 | return 'LEFT JOIN'; |
| 2167 | 2167 | } |
| 2168 | 2168 | |
| 2169 | 2169 | // if one of the join columns is nullable, return left join |
| 2170 | 2170 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2171 | - if (! $joinColumn->isNullable()) { |
|
| 2171 | + if ( ! $joinColumn->isNullable()) { |
|
| 2172 | 2172 | continue; |
| 2173 | 2173 | } |
| 2174 | 2174 | |
@@ -2185,7 +2185,7 @@ discard block |
||
| 2185 | 2185 | */ |
| 2186 | 2186 | public function getSQLColumnAlias() |
| 2187 | 2187 | { |
| 2188 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2188 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2189 | 2189 | } |
| 2190 | 2190 | |
| 2191 | 2191 | /** |
@@ -2202,13 +2202,13 @@ discard block |
||
| 2202 | 2202 | |
| 2203 | 2203 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 2204 | 2204 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 2205 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2205 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2206 | 2206 | } |
| 2207 | 2207 | } |
| 2208 | 2208 | |
| 2209 | 2209 | $sql = implode(' AND ', $filterClauses); |
| 2210 | 2210 | |
| 2211 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2211 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2212 | 2212 | } |
| 2213 | 2213 | |
| 2214 | 2214 | /** |
@@ -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 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | foreach ($data as $columnName => $value) { |
| 114 | - if (!is_array($id) || !isset($id[$columnName])) { |
|
| 114 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
| 115 | 115 | $type = $this->columns[$columnName]->getType(); |
| 116 | 116 | |
| 117 | 117 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | if ($filterSql = $this->generateFilterConditionSQL($rootClass, $tableAlias)) { |
| 237 | 237 | $conditionSql .= $conditionSql |
| 238 | - ? ' AND ' . $filterSql |
|
| 238 | + ? ' AND '.$filterSql |
|
| 239 | 239 | : $filterSql; |
| 240 | 240 | } |
| 241 | 241 | |
@@ -243,26 +243,26 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | switch ($lockMode) { |
| 245 | 245 | case LockMode::PESSIMISTIC_READ: |
| 246 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 246 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 247 | 247 | break; |
| 248 | 248 | |
| 249 | 249 | case LockMode::PESSIMISTIC_WRITE: |
| 250 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 250 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 251 | 251 | break; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 255 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
| 256 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
| 255 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
| 256 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
| 257 | 257 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 258 | 258 | $columnList = $this->getSelectColumnsSQL(); |
| 259 | - $query = 'SELECT ' . $columnList |
|
| 259 | + $query = 'SELECT '.$columnList |
|
| 260 | 260 | . $lock |
| 261 | 261 | . $joinSql |
| 262 | 262 | . $where |
| 263 | 263 | . $orderBySql; |
| 264 | 264 | |
| 265 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 265 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -284,14 +284,14 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | if ('' !== $filterSql) { |
| 286 | 286 | $conditionSql = $conditionSql |
| 287 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 287 | + ? $conditionSql.' AND '.$filterSql |
|
| 288 | 288 | : $filterSql; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | $sql = 'SELECT COUNT(*) ' |
| 292 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
| 292 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
| 293 | 293 | . $joinSql |
| 294 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 294 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 295 | 295 | |
| 296 | 296 | return $sql; |
| 297 | 297 | } |
@@ -311,18 +311,18 @@ discard block |
||
| 311 | 311 | $parentClass = $this->em->getClassMetadata($parentClassName); |
| 312 | 312 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 313 | 313 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 314 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 314 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 315 | 315 | |
| 316 | 316 | foreach ($identifierColumns as $idColumn) { |
| 317 | 317 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 318 | 318 | |
| 319 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 319 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | $joinSql .= implode(' AND ', $conditions); |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
| 325 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /** |
@@ -349,14 +349,14 @@ discard block |
||
| 349 | 349 | continue; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 352 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 353 | 353 | continue; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 357 | 357 | |
| 358 | 358 | foreach ($property->getJoinColumns() as $joinColumn) { |
| 359 | - if (! $joinColumn->getType()) { |
|
| 359 | + if ( ! $joinColumn->getType()) { |
|
| 360 | 360 | $joinColumn->setType( |
| 361 | 361 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
| 362 | 362 | ); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
| 377 | 377 | |
| 378 | 378 | $columnList[] = $discrColumnType->convertToDatabaseValueSQL( |
| 379 | - $this->getSQLTableAlias($discrColumn->getTableName()) . '.' . $discrColumnName, |
|
| 379 | + $this->getSQLTableAlias($discrColumn->getTableName()).'.'.$discrColumnName, |
|
| 380 | 380 | $this->platform |
| 381 | 381 | ); |
| 382 | 382 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 404 | 404 | |
| 405 | 405 | foreach ($property->getJoinColumns() as $joinColumn) { |
| 406 | - if (! $joinColumn->getType()) { |
|
| 406 | + if ( ! $joinColumn->getType()) { |
|
| 407 | 407 | $joinColumn->setType( |
| 408 | 408 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
| 409 | 409 | ); |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | $columnName = $joinColumn->getColumnName(); |
| 452 | 452 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 453 | 453 | |
| 454 | - if (! $joinColumn->getType()) { |
|
| 454 | + if ( ! $joinColumn->getType()) { |
|
| 455 | 455 | $joinColumn->setType( |
| 456 | 456 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
| 457 | 457 | ); |
@@ -509,12 +509,12 @@ discard block |
||
| 509 | 509 | $parentClass = $this->em->getClassMetadata($parentClassName); |
| 510 | 510 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 511 | 511 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 512 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 512 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 513 | 513 | |
| 514 | 514 | foreach ($identifierColumns as $idColumn) { |
| 515 | 515 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 516 | 516 | |
| 517 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 517 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | $joinSql .= implode(' AND ', $conditions); |
@@ -526,12 +526,12 @@ discard block |
||
| 526 | 526 | $subClass = $this->em->getClassMetadata($subClassName); |
| 527 | 527 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 528 | 528 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
| 529 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 529 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 530 | 530 | |
| 531 | 531 | foreach ($identifierColumns as $idColumn) { |
| 532 | 532 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 533 | 533 | |
| 534 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 534 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | $joinSql .= implode(' AND ', $conditions); |
@@ -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\Persisters\Entity; |
| 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; |
| 6 | 6 | |
@@ -82,15 +82,15 @@ discard block |
||
| 82 | 82 | $expressionList[] = $this->dispatch($child); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | - switch($expr->getType()) { |
|
| 85 | + switch ($expr->getType()) { |
|
| 86 | 86 | case CompositeExpression::TYPE_AND: |
| 87 | - return '(' . implode(' AND ', $expressionList) . ')'; |
|
| 87 | + return '('.implode(' AND ', $expressionList).')'; |
|
| 88 | 88 | |
| 89 | 89 | case CompositeExpression::TYPE_OR: |
| 90 | - return '(' . implode(' OR ', $expressionList) . ')'; |
|
| 90 | + return '('.implode(' OR ', $expressionList).')'; |
|
| 91 | 91 | |
| 92 | 92 | default: |
| 93 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
| 93 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | |
@@ -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\Utility; |
| 6 | 6 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | // ? $this->unitOfWork->getEntityIdentifier($id[$field]) |
| 75 | 75 | // : $targetClassPersister->getIdentifier($id[$field]) |
| 76 | 76 | // ; |
| 77 | - $identifiers = $targetClassPersister->getIdentifier($id[$field]); |
|
| 77 | + $identifiers = $targetClassPersister->getIdentifier($id[$field]); |
|
| 78 | 78 | |
| 79 | 79 | $associatedId = $this->flattenIdentifier($targetClassMetadata, $identifiers); |
| 80 | 80 | |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Utility; |
| 7 | 7 | |
@@ -62,14 +62,14 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | // iterate over association mappings |
| 64 | 64 | foreach ($class->getProperties() as $association) { |
| 65 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 65 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 66 | 66 | continue; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // resolve join columns over to-one or to-many |
| 70 | 70 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
| 71 | 71 | |
| 72 | - if (! $association->isOwningSide()) { |
|
| 72 | + if ( ! $association->isOwningSide()) { |
|
| 73 | 73 | $association = $targetClass->getProperty($association->getMappedBy()); |
| 74 | 74 | $targetClass = $em->getClassMetadata($association->getTargetEntity()); |
| 75 | 75 | } |
@@ -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 | |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | */ |
| 397 | 397 | public function containsKey($key) |
| 398 | 398 | { |
| 399 | - if (! $this->initialized && |
|
| 399 | + if ( ! $this->initialized && |
|
| 400 | 400 | $this->association !== null && |
| 401 | 401 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
| 402 | 402 | $this->association->getIndexedBy()) { |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | */ |
| 414 | 414 | public function contains($element) |
| 415 | 415 | { |
| 416 | - if (! $this->initialized && |
|
| 416 | + if ( ! $this->initialized && |
|
| 417 | 417 | $this->association !== null && |
| 418 | 418 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
| 419 | 419 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -429,11 +429,11 @@ discard block |
||
| 429 | 429 | */ |
| 430 | 430 | public function get($key) |
| 431 | 431 | { |
| 432 | - if (! $this->initialized && |
|
| 432 | + if ( ! $this->initialized && |
|
| 433 | 433 | $this->association !== null && |
| 434 | 434 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY && |
| 435 | 435 | $this->association->getIndexedBy()) { |
| 436 | - if (!$this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
| 436 | + if ( ! $this->typeClass->isIdentifierComposite() && $this->typeClass->isIdentifier($this->association->getIndexedBy())) { |
|
| 437 | 437 | return $this->em->find($this->typeClass->getClassName(), $key); |
| 438 | 438 | } |
| 439 | 439 | |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | public function count() |
| 450 | 450 | { |
| 451 | - if (! $this->initialized && |
|
| 451 | + if ( ! $this->initialized && |
|
| 452 | 452 | $this->association !== null && |
| 453 | 453 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
| 454 | 454 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | */ |
| 603 | 603 | public function slice($offset, $length = null) |
| 604 | 604 | { |
| 605 | - if (! $this->initialized && |
|
| 605 | + if ( ! $this->initialized && |
|
| 606 | 606 | ! $this->isDirty && |
| 607 | 607 | $this->association !== null && |
| 608 | 608 | $this->association->getFetchMode() === FetchMode::EXTRA_LAZY) { |
@@ -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\Query; |
| 6 | 6 | |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
| 274 | 274 | { |
| 275 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
| 275 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
| 276 | 276 | |
| 277 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
| 278 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
| 277 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
| 278 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | return $this->tableAliasMap[$tableName]; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
| 295 | 295 | { |
| 296 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
| 296 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
| 297 | 297 | |
| 298 | 298 | $this->tableAliasMap[$tableName] = $alias; |
| 299 | 299 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | public function getSQLColumnAlias() |
| 309 | 309 | { |
| 310 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
| 310 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
| 311 | 311 | |
| 312 | 312 | } |
| 313 | 313 | |
@@ -334,14 +334,14 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | // If this is a joined association we must use left joins to preserve the correct result. |
| 336 | 336 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
| 337 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 337 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 338 | 338 | |
| 339 | 339 | $sqlParts = []; |
| 340 | 340 | |
| 341 | 341 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 342 | 342 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 343 | 343 | |
| 344 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 344 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | // Add filters on the root class |
@@ -363,14 +363,14 @@ discard block |
||
| 363 | 363 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 364 | 364 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
| 365 | 365 | |
| 366 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 366 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 367 | 367 | |
| 368 | 368 | $sqlParts = []; |
| 369 | 369 | |
| 370 | 370 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
| 371 | 371 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 372 | 372 | |
| 373 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 373 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | $sql .= implode(' AND ', $sqlParts); |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $qComp = $this->queryComponents[$dqlAlias]; |
| 392 | 392 | $association = $qComp['relation']; |
| 393 | 393 | |
| 394 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 394 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 395 | 395 | continue; |
| 396 | 396 | } |
| 397 | 397 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | $property = $qComp['metadata']->getProperty($fieldName); |
| 400 | 400 | $tableName = $property->getTableName(); |
| 401 | 401 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 402 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
| 402 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
| 403 | 403 | |
| 404 | 404 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
| 405 | 405 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
| 410 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
| 410 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
@@ -447,19 +447,19 @@ discard block |
||
| 447 | 447 | $discrColumnType = $discrColumn->getType(); |
| 448 | 448 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 449 | 449 | $sqlTableAlias = ($this->useSqlTableAliases) |
| 450 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 450 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 451 | 451 | : ''; |
| 452 | 452 | |
| 453 | 453 | $sqlParts[] = sprintf( |
| 454 | 454 | '%s IN (%s)', |
| 455 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 455 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 456 | 456 | implode(', ', $values) |
| 457 | 457 | ); |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | $sql = implode(' AND ', $sqlParts); |
| 461 | 461 | |
| 462 | - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
| 462 | + return (count($sqlParts) > 1) ? '('.$sql.')' : $sql; |
|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | /** |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | */ |
| 473 | 473 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
| 474 | 474 | { |
| 475 | - if (! $this->em->hasFilters()) { |
|
| 475 | + if ( ! $this->em->hasFilters()) { |
|
| 476 | 476 | return ''; |
| 477 | 477 | } |
| 478 | 478 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | |
| 504 | 504 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 505 | 505 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 506 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 506 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | if ( ! $AST->orderByClause && ($orderBySql = $this->generateOrderedCollectionOrderByItems())) { |
| 538 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
| 538 | + $sql .= ' ORDER BY '.$orderBySql; |
|
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | if ($limit !== null || $offset !== null) { |
@@ -547,11 +547,11 @@ discard block |
||
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
| 550 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
| 550 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
| 554 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
| 554 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 609 | 609 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 610 | 610 | |
| 611 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
| 611 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | return implode(', ', $sqlParts); |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | { |
| 627 | 627 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
| 628 | 628 | |
| 629 | - if (!$fieldName) { |
|
| 629 | + if ( ! $fieldName) { |
|
| 630 | 630 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
| 631 | 631 | } |
| 632 | 632 | |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | $property = $class->getProperty($fieldName); |
| 656 | 656 | |
| 657 | 657 | if ($this->useSqlTableAliases) { |
| 658 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
| 658 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | if ($property instanceof AssociationMetadata) { |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
| 674 | 674 | $association = $class->getProperty($fieldName); |
| 675 | 675 | |
| 676 | - if (! $association->isOwningSide()) { |
|
| 676 | + if ( ! $association->isOwningSide()) { |
|
| 677 | 677 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
| 678 | 678 | } |
| 679 | 679 | |
@@ -687,7 +687,7 @@ discard block |
||
| 687 | 687 | $joinColumn = reset($joinColumns); |
| 688 | 688 | |
| 689 | 689 | if ($this->useSqlTableAliases) { |
| 690 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
| 690 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | */ |
| 706 | 706 | public function walkSelectClause($selectClause) |
| 707 | 707 | { |
| 708 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 708 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 709 | 709 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
| 710 | 710 | |
| 711 | 711 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | |
| 747 | 747 | $sqlSelectExpressions[] = sprintf( |
| 748 | 748 | '%s AS %s', |
| 749 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
| 749 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
| 750 | 750 | $sqlColumnAlias |
| 751 | 751 | ); |
| 752 | 752 | |
@@ -756,13 +756,13 @@ discard block |
||
| 756 | 756 | |
| 757 | 757 | // Add foreign key columns of class and also parent classes |
| 758 | 758 | foreach ($class->getProperties() as $association) { |
| 759 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 759 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 760 | 760 | continue; |
| 761 | - } else if (! $addMetaColumns && ! $association->isPrimaryKey()) { |
|
| 761 | + } else if ( ! $addMetaColumns && ! $association->isPrimaryKey()) { |
|
| 762 | 762 | continue; |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | - $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 765 | + $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 766 | 766 | |
| 767 | 767 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 768 | 768 | $columnName = $joinColumn->getColumnName(); |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | continue; |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 801 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 802 | 802 | continue; |
| 803 | 803 | } |
| 804 | 804 | |
@@ -840,7 +840,7 @@ discard block |
||
| 840 | 840 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 843 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 844 | 844 | } |
| 845 | 845 | |
| 846 | 846 | /** |
@@ -907,7 +907,7 @@ discard block |
||
| 907 | 907 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 908 | 908 | |
| 909 | 909 | $sql = $this->platform->appendLockHint( |
| 910 | - $tableName . ' ' . $tableAlias, |
|
| 910 | + $tableName.' '.$tableAlias, |
|
| 911 | 911 | $this->query->getHint(Query::HINT_LOCK_MODE) |
| 912 | 912 | ); |
| 913 | 913 | |
@@ -952,7 +952,7 @@ discard block |
||
| 952 | 952 | ; |
| 953 | 953 | |
| 954 | 954 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && |
| 955 | - (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 955 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 956 | 956 | if ($association instanceof ToManyAssociationMetadata) { |
| 957 | 957 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
| 958 | 958 | } |
@@ -1006,7 +1006,7 @@ discard block |
||
| 1006 | 1006 | } |
| 1007 | 1007 | |
| 1008 | 1008 | $targetTableJoin = [ |
| 1009 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1009 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1010 | 1010 | 'condition' => implode(' AND ', $conditions), |
| 1011 | 1011 | ]; |
| 1012 | 1012 | } else if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1034,7 +1034,7 @@ discard block |
||
| 1034 | 1034 | ); |
| 1035 | 1035 | } |
| 1036 | 1036 | |
| 1037 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
| 1037 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
| 1038 | 1038 | |
| 1039 | 1039 | // Join target table |
| 1040 | 1040 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1073,7 +1073,7 @@ discard block |
||
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | $targetTableJoin = [ |
| 1076 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1076 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1077 | 1077 | 'condition' => implode(' AND ', $conditions), |
| 1078 | 1078 | ]; |
| 1079 | 1079 | } else { |
@@ -1081,23 +1081,23 @@ discard block |
||
| 1081 | 1081 | } |
| 1082 | 1082 | |
| 1083 | 1083 | // Handle WITH clause |
| 1084 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
| 1084 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
| 1085 | 1085 | |
| 1086 | 1086 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
| 1087 | 1087 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
| 1088 | 1088 | |
| 1089 | 1089 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
| 1090 | 1090 | if ($withCondition) { |
| 1091 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
| 1091 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
| 1092 | 1092 | } else { |
| 1093 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
| 1093 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
| 1094 | 1094 | } |
| 1095 | 1095 | } else { |
| 1096 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
| 1096 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
| 1097 | 1097 | } |
| 1098 | 1098 | |
| 1099 | 1099 | if ($withCondition) { |
| 1100 | - $sql .= ' AND ' . $withCondition; |
|
| 1100 | + $sql .= ' AND '.$withCondition; |
|
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | 1103 | // Apply the indexes |
@@ -1130,7 +1130,7 @@ discard block |
||
| 1130 | 1130 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
| 1131 | 1131 | } |
| 1132 | 1132 | |
| 1133 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
| 1133 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
| 1134 | 1134 | } |
| 1135 | 1135 | |
| 1136 | 1136 | /** |
@@ -1147,10 +1147,10 @@ discard block |
||
| 1147 | 1147 | $this->orderedColumnsMap[$sql] = $type; |
| 1148 | 1148 | |
| 1149 | 1149 | if ($expr instanceof AST\Subselect) { |
| 1150 | - return '(' . $sql . ') ' . $type; |
|
| 1150 | + return '('.$sql.') '.$type; |
|
| 1151 | 1151 | } |
| 1152 | 1152 | |
| 1153 | - return $sql . ' ' . $type; |
|
| 1153 | + return $sql.' '.$type; |
|
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | 1156 | /** |
@@ -1158,7 +1158,7 @@ discard block |
||
| 1158 | 1158 | */ |
| 1159 | 1159 | public function walkHavingClause($havingClause) |
| 1160 | 1160 | { |
| 1161 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1161 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | 1164 | /** |
@@ -1181,7 +1181,7 @@ discard block |
||
| 1181 | 1181 | $conditions = []; |
| 1182 | 1182 | |
| 1183 | 1183 | if ($join->conditionalExpression) { |
| 1184 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
| 1184 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
| 1185 | 1185 | } |
| 1186 | 1186 | |
| 1187 | 1187 | $condExprConjunction = ($class->inheritanceType === InheritanceType::JOINED && $joinType !== AST\Join::JOIN_TYPE_LEFT && $joinType !== AST\Join::JOIN_TYPE_LEFTOUTER) |
@@ -1205,7 +1205,7 @@ discard block |
||
| 1205 | 1205 | } |
| 1206 | 1206 | |
| 1207 | 1207 | if ($conditions) { |
| 1208 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
| 1208 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
| 1209 | 1209 | } |
| 1210 | 1210 | |
| 1211 | 1211 | break; |
@@ -1235,7 +1235,7 @@ discard block |
||
| 1235 | 1235 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
| 1236 | 1236 | } |
| 1237 | 1237 | |
| 1238 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
| 1238 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
| 1239 | 1239 | |
| 1240 | 1240 | return $sql; |
| 1241 | 1241 | } |
@@ -1257,7 +1257,7 @@ discard block |
||
| 1257 | 1257 | ? $this->conn->quote($nullIfExpression->secondExpression) |
| 1258 | 1258 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
| 1259 | 1259 | |
| 1260 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
| 1260 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | 1263 | /** |
@@ -1272,11 +1272,11 @@ discard block |
||
| 1272 | 1272 | $sql = 'CASE'; |
| 1273 | 1273 | |
| 1274 | 1274 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
| 1275 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1276 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1275 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1276 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1277 | 1277 | } |
| 1278 | 1278 | |
| 1279 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
| 1279 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
| 1280 | 1280 | |
| 1281 | 1281 | return $sql; |
| 1282 | 1282 | } |
@@ -1290,14 +1290,14 @@ discard block |
||
| 1290 | 1290 | */ |
| 1291 | 1291 | public function walkSimpleCaseExpression($simpleCaseExpression) |
| 1292 | 1292 | { |
| 1293 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1293 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1294 | 1294 | |
| 1295 | 1295 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
| 1296 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1297 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1296 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1297 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1298 | 1298 | } |
| 1299 | 1299 | |
| 1300 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
| 1300 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
| 1301 | 1301 | |
| 1302 | 1302 | return $sql; |
| 1303 | 1303 | } |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | $columnAlias = $this->getSQLColumnAlias(); |
| 1360 | 1360 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1361 | 1361 | |
| 1362 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1362 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1363 | 1363 | |
| 1364 | 1364 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1365 | 1365 | |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | $columnAlias = $this->getSQLColumnAlias(); |
| 1375 | 1375 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1376 | 1376 | |
| 1377 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1377 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1378 | 1378 | |
| 1379 | 1379 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1380 | 1380 | |
@@ -1385,7 +1385,7 @@ discard block |
||
| 1385 | 1385 | break; |
| 1386 | 1386 | |
| 1387 | 1387 | case ($expr instanceof AST\NewObjectExpression): |
| 1388 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
| 1388 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
| 1389 | 1389 | break; |
| 1390 | 1390 | |
| 1391 | 1391 | default: |
@@ -1414,7 +1414,7 @@ discard block |
||
| 1414 | 1414 | |
| 1415 | 1415 | // Select all fields from the queried class |
| 1416 | 1416 | foreach ($class->getProperties() as $fieldName => $property) { |
| 1417 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1417 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1418 | 1418 | continue; |
| 1419 | 1419 | } |
| 1420 | 1420 | |
@@ -1449,11 +1449,11 @@ discard block |
||
| 1449 | 1449 | $subClass = $this->em->getClassMetadata($subClassName); |
| 1450 | 1450 | |
| 1451 | 1451 | foreach ($subClass->getProperties() as $fieldName => $property) { |
| 1452 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1452 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1453 | 1453 | continue; |
| 1454 | 1454 | } |
| 1455 | 1455 | |
| 1456 | - if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
| 1456 | + if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
| 1457 | 1457 | continue; |
| 1458 | 1458 | } |
| 1459 | 1459 | |
@@ -1488,7 +1488,7 @@ discard block |
||
| 1488 | 1488 | */ |
| 1489 | 1489 | public function walkQuantifiedExpression($qExpr) |
| 1490 | 1490 | { |
| 1491 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
| 1491 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
| 1492 | 1492 | } |
| 1493 | 1493 | |
| 1494 | 1494 | /** |
@@ -1528,7 +1528,7 @@ discard block |
||
| 1528 | 1528 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 1531 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 1532 | 1532 | } |
| 1533 | 1533 | |
| 1534 | 1534 | /** |
@@ -1536,7 +1536,7 @@ discard block |
||
| 1536 | 1536 | */ |
| 1537 | 1537 | public function walkSimpleSelectClause($simpleSelectClause) |
| 1538 | 1538 | { |
| 1539 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1539 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1540 | 1540 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
| 1541 | 1541 | } |
| 1542 | 1542 | |
@@ -1555,10 +1555,10 @@ discard block |
||
| 1555 | 1555 | * @param null|string $newObjectResultAlias |
| 1556 | 1556 | * @return string The SQL. |
| 1557 | 1557 | */ |
| 1558 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
| 1558 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
| 1559 | 1559 | { |
| 1560 | 1560 | $sqlSelectExpressions = []; |
| 1561 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
| 1561 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
| 1562 | 1562 | |
| 1563 | 1563 | foreach ($newObjectExpression->args as $argIndex => $e) { |
| 1564 | 1564 | $resultAlias = $this->scalarResultCounter++; |
@@ -1571,7 +1571,7 @@ discard block |
||
| 1571 | 1571 | break; |
| 1572 | 1572 | |
| 1573 | 1573 | case ($e instanceof AST\Subselect): |
| 1574 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
| 1574 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
| 1575 | 1575 | break; |
| 1576 | 1576 | |
| 1577 | 1577 | case ($e instanceof AST\PathExpression): |
@@ -1580,7 +1580,7 @@ discard block |
||
| 1580 | 1580 | $class = $qComp['metadata']; |
| 1581 | 1581 | $fieldType = $class->getProperty($e->field)->getType(); |
| 1582 | 1582 | |
| 1583 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1583 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1584 | 1584 | break; |
| 1585 | 1585 | |
| 1586 | 1586 | case ($e instanceof AST\Literal): |
@@ -1594,11 +1594,11 @@ discard block |
||
| 1594 | 1594 | break; |
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1597 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1598 | 1598 | break; |
| 1599 | 1599 | |
| 1600 | 1600 | default: |
| 1601 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1601 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1602 | 1602 | break; |
| 1603 | 1603 | } |
| 1604 | 1604 | |
@@ -1631,10 +1631,10 @@ discard block |
||
| 1631 | 1631 | case ($expr instanceof AST\Subselect): |
| 1632 | 1632 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1633 | 1633 | |
| 1634 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
| 1634 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
| 1635 | 1635 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1636 | 1636 | |
| 1637 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1637 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1638 | 1638 | break; |
| 1639 | 1639 | |
| 1640 | 1640 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1651,7 +1651,7 @@ discard block |
||
| 1651 | 1651 | $columnAlias = $this->getSQLColumnAlias(); |
| 1652 | 1652 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1653 | 1653 | |
| 1654 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1654 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1655 | 1655 | break; |
| 1656 | 1656 | |
| 1657 | 1657 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1671,8 +1671,8 @@ discard block |
||
| 1671 | 1671 | */ |
| 1672 | 1672 | public function walkAggregateExpression($aggExpression) |
| 1673 | 1673 | { |
| 1674 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1675 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
| 1674 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1675 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
| 1676 | 1676 | } |
| 1677 | 1677 | |
| 1678 | 1678 | /** |
@@ -1686,7 +1686,7 @@ discard block |
||
| 1686 | 1686 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
| 1687 | 1687 | } |
| 1688 | 1688 | |
| 1689 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
| 1689 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
| 1690 | 1690 | } |
| 1691 | 1691 | |
| 1692 | 1692 | /** |
@@ -1740,7 +1740,7 @@ discard block |
||
| 1740 | 1740 | { |
| 1741 | 1741 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
| 1742 | 1742 | $tableName = $class->getTableName(); |
| 1743 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1743 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1744 | 1744 | |
| 1745 | 1745 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
| 1746 | 1746 | |
@@ -1756,12 +1756,12 @@ discard block |
||
| 1756 | 1756 | { |
| 1757 | 1757 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
| 1758 | 1758 | $tableName = $class->getTableName(); |
| 1759 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1759 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1760 | 1760 | |
| 1761 | 1761 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
| 1762 | 1762 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
| 1763 | 1763 | |
| 1764 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1764 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1765 | 1765 | |
| 1766 | 1766 | return $sql; |
| 1767 | 1767 | } |
@@ -1774,7 +1774,7 @@ discard block |
||
| 1774 | 1774 | $useTableAliasesBefore = $this->useSqlTableAliases; |
| 1775 | 1775 | $this->useSqlTableAliases = false; |
| 1776 | 1776 | |
| 1777 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
| 1777 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
| 1778 | 1778 | $newValue = $updateItem->newValue; |
| 1779 | 1779 | |
| 1780 | 1780 | switch (true) { |
@@ -1817,7 +1817,7 @@ discard block |
||
| 1817 | 1817 | |
| 1818 | 1818 | if (count($filterClauses)) { |
| 1819 | 1819 | if ($condSql) { |
| 1820 | - $condSql = '(' . $condSql . ') AND '; |
|
| 1820 | + $condSql = '('.$condSql.') AND '; |
|
| 1821 | 1821 | } |
| 1822 | 1822 | |
| 1823 | 1823 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1825,11 +1825,11 @@ discard block |
||
| 1825 | 1825 | } |
| 1826 | 1826 | |
| 1827 | 1827 | if ($condSql) { |
| 1828 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
| 1828 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
| 1829 | 1829 | } |
| 1830 | 1830 | |
| 1831 | 1831 | if ($discrSql) { |
| 1832 | - return ' WHERE ' . $discrSql; |
|
| 1832 | + return ' WHERE '.$discrSql; |
|
| 1833 | 1833 | } |
| 1834 | 1834 | |
| 1835 | 1835 | return ''; |
@@ -1872,7 +1872,7 @@ discard block |
||
| 1872 | 1872 | // if only one ConditionalPrimary is defined |
| 1873 | 1873 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
| 1874 | 1874 | ? $this->walkConditionalPrimary($factor) |
| 1875 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1875 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1876 | 1876 | } |
| 1877 | 1877 | |
| 1878 | 1878 | /** |
@@ -1887,7 +1887,7 @@ discard block |
||
| 1887 | 1887 | if ($primary->isConditionalExpression()) { |
| 1888 | 1888 | $condExpr = $primary->conditionalExpression; |
| 1889 | 1889 | |
| 1890 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
| 1890 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
| 1891 | 1891 | } |
| 1892 | 1892 | } |
| 1893 | 1893 | |
@@ -1898,7 +1898,7 @@ discard block |
||
| 1898 | 1898 | { |
| 1899 | 1899 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
| 1900 | 1900 | |
| 1901 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
| 1901 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
| 1902 | 1902 | |
| 1903 | 1903 | return $sql; |
| 1904 | 1904 | } |
@@ -1947,7 +1947,7 @@ discard block |
||
| 1947 | 1947 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
| 1948 | 1948 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1949 | 1949 | |
| 1950 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
| 1950 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
| 1951 | 1951 | |
| 1952 | 1952 | $sqlParts = []; |
| 1953 | 1953 | |
@@ -1968,7 +1968,7 @@ discard block |
||
| 1968 | 1968 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 1969 | 1969 | } |
| 1970 | 1970 | |
| 1971 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 1971 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 1972 | 1972 | } |
| 1973 | 1973 | |
| 1974 | 1974 | $sql .= implode(' AND ', $sqlParts); |
@@ -1982,7 +1982,7 @@ discard block |
||
| 1982 | 1982 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1983 | 1983 | |
| 1984 | 1984 | // join to target table |
| 1985 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
| 1985 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
| 1986 | 1986 | |
| 1987 | 1987 | // join conditions |
| 1988 | 1988 | $joinSqlParts = []; |
@@ -2033,13 +2033,13 @@ discard block |
||
| 2033 | 2033 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 2034 | 2034 | } |
| 2035 | 2035 | |
| 2036 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 2036 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2037 | 2037 | } |
| 2038 | 2038 | |
| 2039 | 2039 | $sql .= implode(' AND ', $sqlParts); |
| 2040 | 2040 | } |
| 2041 | 2041 | |
| 2042 | - return $sql . ')'; |
|
| 2042 | + return $sql.')'; |
|
| 2043 | 2043 | } |
| 2044 | 2044 | |
| 2045 | 2045 | /** |
@@ -2050,7 +2050,7 @@ discard block |
||
| 2050 | 2050 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
| 2051 | 2051 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
| 2052 | 2052 | |
| 2053 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2053 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2054 | 2054 | } |
| 2055 | 2055 | |
| 2056 | 2056 | /** |
@@ -2059,19 +2059,19 @@ discard block |
||
| 2059 | 2059 | public function walkNullComparisonExpression($nullCompExpr) |
| 2060 | 2060 | { |
| 2061 | 2061 | $expression = $nullCompExpr->expression; |
| 2062 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
| 2062 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
| 2063 | 2063 | |
| 2064 | 2064 | // Handle ResultVariable |
| 2065 | 2065 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
| 2066 | - return $this->walkResultVariable($expression) . $comparison; |
|
| 2066 | + return $this->walkResultVariable($expression).$comparison; |
|
| 2067 | 2067 | } |
| 2068 | 2068 | |
| 2069 | 2069 | // Handle InputParameter mapping inclusion to ParserResult |
| 2070 | 2070 | if ($expression instanceof AST\InputParameter) { |
| 2071 | - return $this->walkInputParameter($expression) . $comparison; |
|
| 2071 | + return $this->walkInputParameter($expression).$comparison; |
|
| 2072 | 2072 | } |
| 2073 | 2073 | |
| 2074 | - return $expression->dispatch($this) . $comparison; |
|
| 2074 | + return $expression->dispatch($this).$comparison; |
|
| 2075 | 2075 | } |
| 2076 | 2076 | |
| 2077 | 2077 | /** |
@@ -2079,7 +2079,7 @@ discard block |
||
| 2079 | 2079 | */ |
| 2080 | 2080 | public function walkInExpression($inExpr) |
| 2081 | 2081 | { |
| 2082 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
| 2082 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
| 2083 | 2083 | |
| 2084 | 2084 | $sql .= ($inExpr->subselect) |
| 2085 | 2085 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2102,7 +2102,7 @@ discard block |
||
| 2102 | 2102 | $discrColumnType = $discrColumn->getType(); |
| 2103 | 2103 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 2104 | 2104 | $sqlTableAlias = $this->useSqlTableAliases |
| 2105 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 2105 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 2106 | 2106 | : ''; |
| 2107 | 2107 | |
| 2108 | 2108 | $sqlParameterList = []; |
@@ -2132,7 +2132,7 @@ discard block |
||
| 2132 | 2132 | |
| 2133 | 2133 | return sprintf( |
| 2134 | 2134 | '%s %sIN (%s)', |
| 2135 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 2135 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 2136 | 2136 | ($instanceOfExpr->not ? 'NOT ' : ''), |
| 2137 | 2137 | implode(', ', $sqlParameterList) |
| 2138 | 2138 | ); |
@@ -2179,8 +2179,8 @@ discard block |
||
| 2179 | 2179 | $sql .= ' NOT'; |
| 2180 | 2180 | } |
| 2181 | 2181 | |
| 2182 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2183 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2182 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2183 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2184 | 2184 | |
| 2185 | 2185 | return $sql; |
| 2186 | 2186 | } |
@@ -2195,7 +2195,7 @@ discard block |
||
| 2195 | 2195 | ? $this->walkResultVariable($stringExpr) |
| 2196 | 2196 | : $stringExpr->dispatch($this); |
| 2197 | 2197 | |
| 2198 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
| 2198 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
| 2199 | 2199 | |
| 2200 | 2200 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
| 2201 | 2201 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2208,7 +2208,7 @@ discard block |
||
| 2208 | 2208 | } |
| 2209 | 2209 | |
| 2210 | 2210 | if ($likeExpr->escapeChar) { |
| 2211 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
| 2211 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
| 2212 | 2212 | } |
| 2213 | 2213 | |
| 2214 | 2214 | return $sql; |
@@ -2235,7 +2235,7 @@ discard block |
||
| 2235 | 2235 | ? $leftExpr->dispatch($this) |
| 2236 | 2236 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
| 2237 | 2237 | |
| 2238 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
| 2238 | + $sql .= ' '.$compExpr->operator.' '; |
|
| 2239 | 2239 | |
| 2240 | 2240 | $sql .= ($rightExpr instanceof AST\Node) |
| 2241 | 2241 | ? $rightExpr->dispatch($this) |
@@ -2267,7 +2267,7 @@ discard block |
||
| 2267 | 2267 | { |
| 2268 | 2268 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
| 2269 | 2269 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
| 2270 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
| 2270 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
| 2271 | 2271 | } |
| 2272 | 2272 | |
| 2273 | 2273 | /** |
@@ -2321,7 +2321,7 @@ discard block |
||
| 2321 | 2321 | |
| 2322 | 2322 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
| 2323 | 2323 | |
| 2324 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2324 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2325 | 2325 | } |
| 2326 | 2326 | |
| 2327 | 2327 | /** |
@@ -2334,7 +2334,7 @@ discard block |
||
| 2334 | 2334 | public function walkArithmeticPrimary($primary) |
| 2335 | 2335 | { |
| 2336 | 2336 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
| 2337 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
| 2337 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
| 2338 | 2338 | } |
| 2339 | 2339 | |
| 2340 | 2340 | if ($primary instanceof AST\Node) { |
@@ -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\Query; |
| 6 | 6 | use Doctrine\ORM\Mapping\AssociationMetadata; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public static function syntaxError($message, $previous = null) |
| 39 | 39 | { |
| 40 | - return new self('[Syntax Error] ' . $message, 0, $previous); |
|
| 40 | + return new self('[Syntax Error] '.$message, 0, $previous); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public static function semanticalError($message, $previous = null) |
| 50 | 50 | { |
| 51 | - return new self('[Semantical Error] ' . $message, 0, $previous); |
|
| 51 | + return new self('[Semantical Error] '.$message, 0, $previous); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | */ |
| 68 | 68 | public static function invalidParameterType($expected, $received) |
| 69 | 69 | { |
| 70 | - return new self('Invalid parameter type, ' . $received . ' given, but ' . $expected . ' expected.'); |
|
| 70 | + return new self('Invalid parameter type, '.$received.' given, but '.$expected.' expected.'); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | */ |
| 78 | 78 | public static function invalidParameterPosition($pos) |
| 79 | 79 | { |
| 80 | - return new self('Invalid parameter position: ' . $pos); |
|
| 80 | + return new self('Invalid parameter position: '.$pos); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public static function tooManyParameters($expected, $received) |
| 90 | 90 | { |
| 91 | - return new self('Too many parameters: the query defines ' . $expected . ' parameters and you bound ' . $received); |
|
| 91 | + return new self('Too many parameters: the query defines '.$expected.' parameters and you bound '.$received); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | */ |
| 100 | 100 | public static function tooFewParameters($expected, $received) |
| 101 | 101 | { |
| 102 | - return new self('Too few parameters: the query defines ' . $expected . ' parameters but you only bound ' . $received); |
|
| 102 | + return new self('Too few parameters: the query defines '.$expected.' parameters but you only bound '.$received); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | public static function invalidPathExpression($pathExpr) |
| 139 | 139 | { |
| 140 | 140 | return new self( |
| 141 | - "Invalid PathExpression '" . $pathExpr->identificationVariable . "." . $pathExpr->field . "'." |
|
| 141 | + "Invalid PathExpression '".$pathExpr->identificationVariable.".".$pathExpr->field."'." |
|
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | public static function partialObjectsAreDangerous() |
| 172 | 172 | { |
| 173 | 173 | return new self( |
| 174 | - "Loading partial objects is dangerous. Fetch full objects or consider " . |
|
| 175 | - "using a different fetch mode. If you really want partial objects, " . |
|
| 174 | + "Loading partial objects is dangerous. Fetch full objects or consider ". |
|
| 175 | + "using a different fetch mode. If you really want partial objects, ". |
|
| 176 | 176 | "set the doctrine.forcePartialLoad query hint to TRUE." |
| 177 | 177 | ); |
| 178 | 178 | } |
@@ -199,8 +199,8 @@ discard block |
||
| 199 | 199 | public static function associationPathInverseSideNotSupported(PathExpression $pathExpr) |
| 200 | 200 | { |
| 201 | 201 | return new self( |
| 202 | - 'A single-valued association path expression to an inverse side is not supported in DQL queries. ' . |
|
| 203 | - 'Instead of "' . $pathExpr->identificationVariable . '.' . $pathExpr->field . '" use an explicit join.' |
|
| 202 | + 'A single-valued association path expression to an inverse side is not supported in DQL queries. '. |
|
| 203 | + 'Instead of "'.$pathExpr->identificationVariable.'.'.$pathExpr->field.'" use an explicit join.' |
|
| 204 | 204 | ); |
| 205 | 205 | } |
| 206 | 206 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | */ |
| 241 | 241 | public static function instanceOfUnrelatedClass($className, $rootClass) |
| 242 | 242 | { |
| 243 | - return new self("Cannot check if a child of '" . $rootClass . "' is instanceof '" . $className . "', " . |
|
| 243 | + return new self("Cannot check if a child of '".$rootClass."' is instanceof '".$className."', ". |
|
| 244 | 244 | "inheritance hierarchy does not exists between these two classes."); |
| 245 | 245 | } |
| 246 | 246 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | public static function invalidQueryComponent($dqlAlias) |
| 253 | 253 | { |
| 254 | 254 | return new self( |
| 255 | - "Invalid query component given for DQL alias '" . $dqlAlias . "', ". |
|
| 255 | + "Invalid query component given for DQL alias '".$dqlAlias."', ". |
|
| 256 | 256 | "requires 'metadata', 'parent', 'relation', 'map', 'nestingLevel' and 'token' keys." |
| 257 | 257 | ); |
| 258 | 258 | } |