@@ -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,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Configuration; |
7 | 7 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Configuration; |
7 | 7 |
@@ -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\Configuration; |
6 | 6 | |
@@ -10,6 +10,6 @@ discard block |
||
10 | 10 | { |
11 | 11 | public static function fromName(string $queryName) : self |
12 | 12 | { |
13 | - return new self('Could not find a named native query by the name "' . $queryName . '"'); |
|
13 | + return new self('Could not find a named native query by the name "'.$queryName.'"'); |
|
14 | 14 | } |
15 | 15 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Configuration; |
7 | 7 |
@@ -12,7 +12,6 @@ |
||
12 | 12 | use Doctrine\ORM\Mapping\ClassMetadataFactory; |
13 | 13 | use Doctrine\ORM\Mapping\Driver\MappingDriver; |
14 | 14 | use Doctrine\ORM\NativeQuery; |
15 | -use Doctrine\ORM\ORMException; |
|
16 | 15 | use Doctrine\ORM\ORMInvalidArgumentException; |
17 | 16 | use Doctrine\ORM\Proxy\Factory\ProxyFactory; |
18 | 17 | use Doctrine\ORM\Query; |
@@ -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 |
@@ -3,10 +3,8 @@ |
||
3 | 3 | declare(strict_types=1); |
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
6 | -use Doctrine\Common\Util\Debug; |
|
7 | 6 | use Doctrine\ORM\EntityManager\MissingIdentifierField; |
8 | 7 | use Doctrine\ORM\EntityManager\UnrecognizedIdentifierFields; |
9 | -use Doctrine\ORM\ORMException; |
|
10 | 8 | use Doctrine\ORM\Query\QueryException; |
11 | 9 | use Doctrine\Tests\Models\Navigation\NavCountry; |
12 | 10 | use Doctrine\Tests\Models\Navigation\NavPhotos; |
@@ -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 | |
@@ -302,14 +302,14 @@ discard block |
||
302 | 302 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
303 | 303 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
304 | 304 | $identifier = array_map( |
305 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
305 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
306 | 306 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
307 | 307 | ); |
308 | 308 | |
309 | 309 | // FIXME: Order with composite keys might not be correct |
310 | - $sql = 'SELECT ' . $columnName |
|
311 | - . ' FROM ' . $tableName |
|
312 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
310 | + $sql = 'SELECT '.$columnName |
|
311 | + . ' FROM '.$tableName |
|
312 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
313 | 313 | |
314 | 314 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
315 | 315 | $versionType = $versionProperty->getType(); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | if (($value = $identifier[$field]) !== null) { |
397 | 397 | // @todo guilhermeblanco Make sure we do not have flat association values. |
398 | - if (! is_array($value)) { |
|
398 | + if ( ! is_array($value)) { |
|
399 | 399 | $value = [$targetClass->identifier[0] => $value]; |
400 | 400 | } |
401 | 401 | |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
409 | 409 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
410 | 410 | |
411 | - if (! $joinColumn->getType()) { |
|
411 | + if ( ! $joinColumn->getType()) { |
|
412 | 412 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
413 | 413 | } |
414 | 414 | |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
477 | 477 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
478 | 478 | |
479 | - if (! $joinColumn->getType()) { |
|
479 | + if ( ! $joinColumn->getType()) { |
|
480 | 480 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
481 | 481 | } |
482 | 482 | |
@@ -503,18 +503,18 @@ discard block |
||
503 | 503 | case Type::SMALLINT: |
504 | 504 | case Type::INTEGER: |
505 | 505 | case Type::BIGINT: |
506 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
506 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
507 | 507 | break; |
508 | 508 | |
509 | 509 | case Type::DATETIME: |
510 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
510 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
511 | 511 | break; |
512 | 512 | } |
513 | 513 | } |
514 | 514 | |
515 | - $sql = 'UPDATE ' . $quotedTableName |
|
516 | - . ' SET ' . implode(', ', $set) |
|
517 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
515 | + $sql = 'UPDATE '.$quotedTableName |
|
516 | + . ' SET '.implode(', ', $set) |
|
517 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
518 | 518 | |
519 | 519 | $result = $this->conn->executeUpdate($sql, $params, $types); |
520 | 520 | |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | protected function deleteJoinTableRecords($identifier) |
534 | 534 | { |
535 | 535 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
536 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
536 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
537 | 537 | continue; |
538 | 538 | } |
539 | 539 | |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | $keys = []; |
547 | 547 | |
548 | 548 | if ( ! $owningAssociation->isOwningSide()) { |
549 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
549 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
550 | 550 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
551 | 551 | } |
552 | 552 | |
@@ -658,7 +658,7 @@ discard block |
||
658 | 658 | } |
659 | 659 | |
660 | 660 | // Only owning side of x-1 associations can have a FK column. |
661 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
661 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
662 | 662 | continue; |
663 | 663 | } |
664 | 664 | |
@@ -678,7 +678,7 @@ discard block |
||
678 | 678 | /** @var JoinColumnMetadata $joinColumn */ |
679 | 679 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
680 | 680 | |
681 | - if (! $joinColumn->getType()) { |
|
681 | + if ( ! $joinColumn->getType()) { |
|
682 | 682 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
683 | 683 | } |
684 | 684 | |
@@ -707,7 +707,7 @@ discard block |
||
707 | 707 | $propertyName = $this->class->fieldNames[$columnName]; |
708 | 708 | $property = $this->class->getProperty($propertyName); |
709 | 709 | |
710 | - if (! $property) { |
|
710 | + if ( ! $property) { |
|
711 | 711 | return null; |
712 | 712 | } |
713 | 713 | |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | /** @var JoinColumnMetadata $joinColumn */ |
727 | 727 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
728 | 728 | |
729 | - if (! $joinColumn->getType()) { |
|
729 | + if ( ! $joinColumn->getType()) { |
|
730 | 730 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
731 | 731 | } |
732 | 732 | |
@@ -1063,7 +1063,7 @@ discard block |
||
1063 | 1063 | $criteria = []; |
1064 | 1064 | $parameters = []; |
1065 | 1065 | |
1066 | - if (! $association->isOwningSide()) { |
|
1066 | + if ( ! $association->isOwningSide()) { |
|
1067 | 1067 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1068 | 1068 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1069 | 1069 | } |
@@ -1091,7 +1091,7 @@ discard block |
||
1091 | 1091 | $value = $value[$targetClass->identifier[0]]; |
1092 | 1092 | } |
1093 | 1093 | |
1094 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1094 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1095 | 1095 | $parameters[] = [ |
1096 | 1096 | 'value' => $value, |
1097 | 1097 | 'field' => $fieldName, |
@@ -1142,11 +1142,11 @@ discard block |
||
1142 | 1142 | |
1143 | 1143 | switch ($lockMode) { |
1144 | 1144 | case LockMode::PESSIMISTIC_READ: |
1145 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1145 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1146 | 1146 | break; |
1147 | 1147 | |
1148 | 1148 | case LockMode::PESSIMISTIC_WRITE: |
1149 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1149 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1150 | 1150 | break; |
1151 | 1151 | } |
1152 | 1152 | |
@@ -1157,14 +1157,14 @@ discard block |
||
1157 | 1157 | |
1158 | 1158 | if ('' !== $filterSql) { |
1159 | 1159 | $conditionSql = $conditionSql |
1160 | - ? $conditionSql . ' AND ' . $filterSql |
|
1160 | + ? $conditionSql.' AND '.$filterSql |
|
1161 | 1161 | : $filterSql; |
1162 | 1162 | } |
1163 | 1163 | |
1164 | - $select = 'SELECT ' . $columnList; |
|
1165 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1166 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1167 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1164 | + $select = 'SELECT '.$columnList; |
|
1165 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1166 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1167 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1168 | 1168 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1169 | 1169 | $query = $select |
1170 | 1170 | . $lock |
@@ -1172,7 +1172,7 @@ discard block |
||
1172 | 1172 | . $where |
1173 | 1173 | . $orderBySql; |
1174 | 1174 | |
1175 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1175 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1176 | 1176 | } |
1177 | 1177 | |
1178 | 1178 | /** |
@@ -1191,13 +1191,13 @@ discard block |
||
1191 | 1191 | |
1192 | 1192 | if ('' !== $filterSql) { |
1193 | 1193 | $conditionSql = $conditionSql |
1194 | - ? $conditionSql . ' AND ' . $filterSql |
|
1194 | + ? $conditionSql.' AND '.$filterSql |
|
1195 | 1195 | : $filterSql; |
1196 | 1196 | } |
1197 | 1197 | |
1198 | 1198 | $sql = 'SELECT COUNT(*) ' |
1199 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1200 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1199 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1200 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1201 | 1201 | |
1202 | 1202 | return $sql; |
1203 | 1203 | } |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | */ |
1215 | 1215 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
1216 | 1216 | { |
1217 | - if (! $orderBy) { |
|
1217 | + if ( ! $orderBy) { |
|
1218 | 1218 | return ''; |
1219 | 1219 | } |
1220 | 1220 | |
@@ -1223,7 +1223,7 @@ discard block |
||
1223 | 1223 | foreach ($orderBy as $fieldName => $orientation) { |
1224 | 1224 | $orientation = strtoupper(trim($orientation)); |
1225 | 1225 | |
1226 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
1226 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
1227 | 1227 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
1228 | 1228 | } |
1229 | 1229 | |
@@ -1233,11 +1233,11 @@ discard block |
||
1233 | 1233 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1234 | 1234 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1235 | 1235 | |
1236 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1236 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1237 | 1237 | |
1238 | 1238 | continue; |
1239 | 1239 | } else if ($property instanceof AssociationMetadata) { |
1240 | - if (! $property->isOwningSide()) { |
|
1240 | + if ( ! $property->isOwningSide()) { |
|
1241 | 1241 | throw InvalidFindByCall::fromInverseSideUsage( |
1242 | 1242 | $this->class->getClassName(), |
1243 | 1243 | $fieldName |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | /* @var JoinColumnMetadata $joinColumn */ |
1254 | 1254 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1255 | 1255 | |
1256 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1256 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | continue; |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | throw ORMException::unrecognizedField($fieldName); |
1263 | 1263 | } |
1264 | 1264 | |
1265 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1265 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 | /** |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | |
1285 | 1285 | |
1286 | 1286 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
1287 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1287 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1288 | 1288 | |
1289 | 1289 | $eagerAliasCounter = 0; |
1290 | 1290 | $columnList = []; |
@@ -1320,7 +1320,7 @@ discard block |
||
1320 | 1320 | break; // now this is why you shouldn't use inheritance |
1321 | 1321 | } |
1322 | 1322 | |
1323 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1323 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1324 | 1324 | |
1325 | 1325 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1326 | 1326 | |
@@ -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 | |
@@ -1413,7 +1413,7 @@ discard block |
||
1413 | 1413 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1414 | 1414 | $resultColumnName = $this->getSQLColumnAlias(); |
1415 | 1415 | |
1416 | - if (! $joinColumn->getType()) { |
|
1416 | + if ( ! $joinColumn->getType()) { |
|
1417 | 1417 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1418 | 1418 | } |
1419 | 1419 | |
@@ -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 | /** |
@@ -1562,7 +1562,7 @@ discard block |
||
1562 | 1562 | $columnName = $joinColumn->getColumnName(); |
1563 | 1563 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1564 | 1564 | |
1565 | - if (! $joinColumn->getType()) { |
|
1565 | + if ( ! $joinColumn->getType()) { |
|
1566 | 1566 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1567 | 1567 | } |
1568 | 1568 | |
@@ -1601,7 +1601,7 @@ discard block |
||
1601 | 1601 | |
1602 | 1602 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1603 | 1603 | |
1604 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1604 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1605 | 1605 | } |
1606 | 1606 | |
1607 | 1607 | /** |
@@ -1615,14 +1615,14 @@ discard block |
||
1615 | 1615 | protected function getSQLTableAlias($tableName, $assocName = '') |
1616 | 1616 | { |
1617 | 1617 | if ($tableName) { |
1618 | - $tableName .= '#' . $assocName; |
|
1618 | + $tableName .= '#'.$assocName; |
|
1619 | 1619 | } |
1620 | 1620 | |
1621 | 1621 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1622 | 1622 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1623 | 1623 | } |
1624 | 1624 | |
1625 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1625 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1626 | 1626 | |
1627 | 1627 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1628 | 1628 | |
@@ -1649,7 +1649,7 @@ discard block |
||
1649 | 1649 | } |
1650 | 1650 | |
1651 | 1651 | $lock = $this->getLockTablesSql($lockMode); |
1652 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1652 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1653 | 1653 | $sql = 'SELECT 1 ' |
1654 | 1654 | . $lock |
1655 | 1655 | . $where |
@@ -1672,7 +1672,7 @@ discard block |
||
1672 | 1672 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1673 | 1673 | |
1674 | 1674 | return $this->platform->appendLockHint( |
1675 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1675 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1676 | 1676 | $lockMode |
1677 | 1677 | ); |
1678 | 1678 | } |
@@ -1725,19 +1725,19 @@ discard block |
||
1725 | 1725 | |
1726 | 1726 | if (null !== $comparison) { |
1727 | 1727 | // special case null value handling |
1728 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1729 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1728 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1729 | + $selectedColumns[] = $column.' IS NULL'; |
|
1730 | 1730 | |
1731 | 1731 | continue; |
1732 | 1732 | } |
1733 | 1733 | |
1734 | 1734 | if ($comparison === Comparison::NEQ && null === $value) { |
1735 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1735 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1736 | 1736 | |
1737 | 1737 | continue; |
1738 | 1738 | } |
1739 | 1739 | |
1740 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1740 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1741 | 1741 | |
1742 | 1742 | continue; |
1743 | 1743 | } |
@@ -1786,7 +1786,7 @@ discard block |
||
1786 | 1786 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1787 | 1787 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1788 | 1788 | |
1789 | - return [$tableAlias . '.' . $columnName]; |
|
1789 | + return [$tableAlias.'.'.$columnName]; |
|
1790 | 1790 | } |
1791 | 1791 | |
1792 | 1792 | if ($property instanceof AssociationMetadata) { |
@@ -1795,7 +1795,7 @@ discard block |
||
1795 | 1795 | |
1796 | 1796 | // Many-To-Many requires join table check for joinColumn |
1797 | 1797 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1798 | - if (! $owningAssociation->isOwningSide()) { |
|
1798 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1799 | 1799 | $owningAssociation = $association; |
1800 | 1800 | } |
1801 | 1801 | |
@@ -1809,18 +1809,18 @@ discard block |
||
1809 | 1809 | foreach ($joinColumns as $joinColumn) { |
1810 | 1810 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1811 | 1811 | |
1812 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1812 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1813 | 1813 | } |
1814 | 1814 | |
1815 | 1815 | } else { |
1816 | - if (! $owningAssociation->isOwningSide()) { |
|
1816 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1817 | 1817 | throw InvalidFindByCall::fromInverseSideUsage( |
1818 | 1818 | $this->class->getClassName(), |
1819 | 1819 | $field |
1820 | 1820 | ); |
1821 | 1821 | } |
1822 | 1822 | |
1823 | - $class = $this->class->isInheritedProperty($field) |
|
1823 | + $class = $this->class->isInheritedProperty($field) |
|
1824 | 1824 | ? $owningAssociation->getDeclaringClass() |
1825 | 1825 | : $this->class |
1826 | 1826 | ; |
@@ -1829,7 +1829,7 @@ discard block |
||
1829 | 1829 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1830 | 1830 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1831 | 1831 | |
1832 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1832 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1833 | 1833 | } |
1834 | 1834 | } |
1835 | 1835 | |
@@ -1942,7 +1942,7 @@ discard block |
||
1942 | 1942 | $value = $value[$targetClass->identifier[0]]; |
1943 | 1943 | } |
1944 | 1944 | |
1945 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
1945 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
1946 | 1946 | $parameters[] = [ |
1947 | 1947 | 'value' => $value, |
1948 | 1948 | 'field' => $fieldName, |
@@ -2029,7 +2029,7 @@ discard block |
||
2029 | 2029 | case ($property instanceof AssociationMetadata): |
2030 | 2030 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2031 | 2031 | |
2032 | - if (! $property->isOwningSide()) { |
|
2032 | + if ( ! $property->isOwningSide()) { |
|
2033 | 2033 | $property = $class->getProperty($property->getMappedBy()); |
2034 | 2034 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2035 | 2035 | } |
@@ -2043,7 +2043,7 @@ discard block |
||
2043 | 2043 | /** @var JoinColumnMetadata $joinColumn */ |
2044 | 2044 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2045 | 2045 | |
2046 | - if (! $joinColumn->getType()) { |
|
2046 | + if ( ! $joinColumn->getType()) { |
|
2047 | 2047 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2048 | 2048 | } |
2049 | 2049 | |
@@ -2058,7 +2058,7 @@ discard block |
||
2058 | 2058 | } |
2059 | 2059 | |
2060 | 2060 | if (is_array($value)) { |
2061 | - return array_map(function ($type) { |
|
2061 | + return array_map(function($type) { |
|
2062 | 2062 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2063 | 2063 | }, $types); |
2064 | 2064 | } |
@@ -2137,12 +2137,12 @@ discard block |
||
2137 | 2137 | |
2138 | 2138 | $sql = 'SELECT 1 ' |
2139 | 2139 | . $this->getLockTablesSql(null) |
2140 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2140 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2141 | 2141 | |
2142 | 2142 | list($params, $types) = $this->expandParameters($criteria); |
2143 | 2143 | |
2144 | 2144 | if (null !== $extraConditions) { |
2145 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2145 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2146 | 2146 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2147 | 2147 | |
2148 | 2148 | $params = array_merge($params, $criteriaParams); |
@@ -2150,7 +2150,7 @@ discard block |
||
2150 | 2150 | } |
2151 | 2151 | |
2152 | 2152 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2153 | - $sql .= ' AND ' . $filterSql; |
|
2153 | + $sql .= ' AND '.$filterSql; |
|
2154 | 2154 | } |
2155 | 2155 | |
2156 | 2156 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2165,13 +2165,13 @@ discard block |
||
2165 | 2165 | */ |
2166 | 2166 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2167 | 2167 | { |
2168 | - if (! $association->isOwningSide()) { |
|
2168 | + if ( ! $association->isOwningSide()) { |
|
2169 | 2169 | return 'LEFT JOIN'; |
2170 | 2170 | } |
2171 | 2171 | |
2172 | 2172 | // if one of the join columns is nullable, return left join |
2173 | 2173 | foreach ($association->getJoinColumns() as $joinColumn) { |
2174 | - if (! $joinColumn->isNullable()) { |
|
2174 | + if ( ! $joinColumn->isNullable()) { |
|
2175 | 2175 | continue; |
2176 | 2176 | } |
2177 | 2177 | |
@@ -2188,7 +2188,7 @@ discard block |
||
2188 | 2188 | */ |
2189 | 2189 | public function getSQLColumnAlias() |
2190 | 2190 | { |
2191 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2191 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2192 | 2192 | } |
2193 | 2193 | |
2194 | 2194 | /** |
@@ -2205,13 +2205,13 @@ discard block |
||
2205 | 2205 | |
2206 | 2206 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2207 | 2207 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2208 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2208 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2209 | 2209 | } |
2210 | 2210 | } |
2211 | 2211 | |
2212 | 2212 | $sql = implode(' AND ', $filterClauses); |
2213 | 2213 | |
2214 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2214 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2215 | 2215 | } |
2216 | 2216 | |
2217 | 2217 | /** |