@@ -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\Tests\Mocks; |
| 6 | 6 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | if ($config === null) { |
| 82 | 82 | $config = new Configuration(); |
| 83 | 83 | |
| 84 | - $config->setProxyDir(__DIR__ . '/../Proxies'); |
|
| 84 | + $config->setProxyDir(__DIR__.'/../Proxies'); |
|
| 85 | 85 | $config->setProxyNamespace('Doctrine\Tests\Proxies'); |
| 86 | 86 | $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver()); |
| 87 | 87 | } |
@@ -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 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 407 | 407 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 408 | 408 | |
| 409 | - if (! $joinColumn->getType()) { |
|
| 409 | + if ( ! $joinColumn->getType()) { |
|
| 410 | 410 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 411 | 411 | } |
| 412 | 412 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 475 | 475 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 476 | 476 | |
| 477 | - if (! $joinColumn->getType()) { |
|
| 477 | + if ( ! $joinColumn->getType()) { |
|
| 478 | 478 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 479 | 479 | } |
| 480 | 480 | |
@@ -501,18 +501,18 @@ discard block |
||
| 501 | 501 | case Type::SMALLINT: |
| 502 | 502 | case Type::INTEGER: |
| 503 | 503 | case Type::BIGINT: |
| 504 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 504 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 505 | 505 | break; |
| 506 | 506 | |
| 507 | 507 | case Type::DATETIME: |
| 508 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 508 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 509 | 509 | break; |
| 510 | 510 | } |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 514 | - . ' SET ' . implode(', ', $set) |
|
| 515 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 513 | + $sql = 'UPDATE '.$quotedTableName |
|
| 514 | + . ' SET '.implode(', ', $set) |
|
| 515 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 516 | 516 | |
| 517 | 517 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 518 | 518 | |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | protected function deleteJoinTableRecords($identifier) |
| 532 | 532 | { |
| 533 | 533 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 534 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 534 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 535 | 535 | continue; |
| 536 | 536 | } |
| 537 | 537 | |
@@ -544,7 +544,7 @@ discard block |
||
| 544 | 544 | $keys = []; |
| 545 | 545 | |
| 546 | 546 | if ( ! $owningAssociation->isOwningSide()) { |
| 547 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 547 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 548 | 548 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 549 | 549 | } |
| 550 | 550 | |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | // Only owning side of x-1 associations can have a FK column. |
| 659 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 659 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 660 | 660 | continue; |
| 661 | 661 | } |
| 662 | 662 | |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | /** @var JoinColumnMetadata $joinColumn */ |
| 677 | 677 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 678 | 678 | |
| 679 | - if (! $joinColumn->getType()) { |
|
| 679 | + if ( ! $joinColumn->getType()) { |
|
| 680 | 680 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 681 | 681 | } |
| 682 | 682 | |
@@ -705,7 +705,7 @@ discard block |
||
| 705 | 705 | $propertyName = $this->class->fieldNames[$columnName]; |
| 706 | 706 | $property = $this->class->getProperty($propertyName); |
| 707 | 707 | |
| 708 | - if (! $property) { |
|
| 708 | + if ( ! $property) { |
|
| 709 | 709 | return null; |
| 710 | 710 | } |
| 711 | 711 | |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | /** @var JoinColumnMetadata $joinColumn */ |
| 725 | 725 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 726 | 726 | |
| 727 | - if (! $joinColumn->getType()) { |
|
| 727 | + if ( ! $joinColumn->getType()) { |
|
| 728 | 728 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 729 | 729 | } |
| 730 | 730 | |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | $criteria = []; |
| 1062 | 1062 | $parameters = []; |
| 1063 | 1063 | |
| 1064 | - if (! $association->isOwningSide()) { |
|
| 1064 | + if ( ! $association->isOwningSide()) { |
|
| 1065 | 1065 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1066 | 1066 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1067 | 1067 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
| 1089 | 1089 | $value = $value[$targetClass->identifier[0]]; |
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1092 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1093 | 1093 | $parameters[] = [ |
| 1094 | 1094 | 'value' => $value, |
| 1095 | 1095 | 'field' => $fieldName, |
@@ -1140,11 +1140,11 @@ discard block |
||
| 1140 | 1140 | |
| 1141 | 1141 | switch ($lockMode) { |
| 1142 | 1142 | case LockMode::PESSIMISTIC_READ: |
| 1143 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1143 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1144 | 1144 | break; |
| 1145 | 1145 | |
| 1146 | 1146 | case LockMode::PESSIMISTIC_WRITE: |
| 1147 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1147 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1148 | 1148 | break; |
| 1149 | 1149 | } |
| 1150 | 1150 | |
@@ -1155,14 +1155,14 @@ discard block |
||
| 1155 | 1155 | |
| 1156 | 1156 | if ($filterSql !== '') { |
| 1157 | 1157 | $conditionSql = $conditionSql |
| 1158 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1158 | + ? $conditionSql.' AND '.$filterSql |
|
| 1159 | 1159 | : $filterSql; |
| 1160 | 1160 | } |
| 1161 | 1161 | |
| 1162 | - $select = 'SELECT ' . $columnList; |
|
| 1163 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
| 1164 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1165 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1162 | + $select = 'SELECT '.$columnList; |
|
| 1163 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1164 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1165 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1166 | 1166 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1167 | 1167 | $query = $select |
| 1168 | 1168 | . $lock |
@@ -1170,7 +1170,7 @@ discard block |
||
| 1170 | 1170 | . $where |
| 1171 | 1171 | . $orderBySql; |
| 1172 | 1172 | |
| 1173 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1173 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | 1176 | /** |
@@ -1189,13 +1189,13 @@ discard block |
||
| 1189 | 1189 | |
| 1190 | 1190 | if ($filterSql !== '') { |
| 1191 | 1191 | $conditionSql = $conditionSql |
| 1192 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1192 | + ? $conditionSql.' AND '.$filterSql |
|
| 1193 | 1193 | : $filterSql; |
| 1194 | 1194 | } |
| 1195 | 1195 | |
| 1196 | 1196 | $sql = 'SELECT COUNT(*) ' |
| 1197 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1198 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1197 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1198 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1199 | 1199 | |
| 1200 | 1200 | return $sql; |
| 1201 | 1201 | } |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | */ |
| 1213 | 1213 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1214 | 1214 | { |
| 1215 | - if (! $orderBy) { |
|
| 1215 | + if ( ! $orderBy) { |
|
| 1216 | 1216 | return ''; |
| 1217 | 1217 | } |
| 1218 | 1218 | |
@@ -1221,7 +1221,7 @@ discard block |
||
| 1221 | 1221 | foreach ($orderBy as $fieldName => $orientation) { |
| 1222 | 1222 | $orientation = strtoupper(trim($orientation)); |
| 1223 | 1223 | |
| 1224 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1224 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1225 | 1225 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
| 1226 | 1226 | } |
| 1227 | 1227 | |
@@ -1231,11 +1231,11 @@ discard block |
||
| 1231 | 1231 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1232 | 1232 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1233 | 1233 | |
| 1234 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1234 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1235 | 1235 | |
| 1236 | 1236 | continue; |
| 1237 | 1237 | } else if ($property instanceof AssociationMetadata) { |
| 1238 | - if (! $property->isOwningSide()) { |
|
| 1238 | + if ( ! $property->isOwningSide()) { |
|
| 1239 | 1239 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName); |
| 1240 | 1240 | } |
| 1241 | 1241 | |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | /* @var JoinColumnMetadata $joinColumn */ |
| 1249 | 1249 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1250 | 1250 | |
| 1251 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1251 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1252 | 1252 | } |
| 1253 | 1253 | |
| 1254 | 1254 | continue; |
@@ -1257,7 +1257,7 @@ discard block |
||
| 1257 | 1257 | throw ORMException::unrecognizedField($fieldName); |
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1260 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | 1263 | /** |
@@ -1279,7 +1279,7 @@ discard block |
||
| 1279 | 1279 | |
| 1280 | 1280 | |
| 1281 | 1281 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
| 1282 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1282 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1283 | 1283 | |
| 1284 | 1284 | $eagerAliasCounter = 0; |
| 1285 | 1285 | $columnList = []; |
@@ -1315,7 +1315,7 @@ discard block |
||
| 1315 | 1315 | break; // now this is why you shouldn't use inheritance |
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1318 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1319 | 1319 | |
| 1320 | 1320 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1321 | 1321 | |
@@ -1340,14 +1340,14 @@ discard block |
||
| 1340 | 1340 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | - if (! $property->isOwningSide()) { |
|
| 1343 | + if ( ! $property->isOwningSide()) { |
|
| 1344 | 1344 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1345 | 1345 | } |
| 1346 | 1346 | |
| 1347 | 1347 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1348 | 1348 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1349 | 1349 | |
| 1350 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1350 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1351 | 1351 | |
| 1352 | 1352 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1353 | 1353 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1369,7 +1369,7 @@ discard block |
||
| 1369 | 1369 | $joinCondition[] = $filterSql; |
| 1370 | 1370 | } |
| 1371 | 1371 | |
| 1372 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1372 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1373 | 1373 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1374 | 1374 | |
| 1375 | 1375 | break; |
@@ -1393,7 +1393,7 @@ discard block |
||
| 1393 | 1393 | */ |
| 1394 | 1394 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1395 | 1395 | { |
| 1396 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1396 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1397 | 1397 | return ''; |
| 1398 | 1398 | } |
| 1399 | 1399 | |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1409 | 1409 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1410 | 1410 | |
| 1411 | - if (! $joinColumn->getType()) { |
|
| 1411 | + if ( ! $joinColumn->getType()) { |
|
| 1412 | 1412 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1413 | 1413 | } |
| 1414 | 1414 | |
@@ -1440,7 +1440,7 @@ discard block |
||
| 1440 | 1440 | $owningAssociation = $association; |
| 1441 | 1441 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1442 | 1442 | |
| 1443 | - if (! $association->isOwningSide()) { |
|
| 1443 | + if ( ! $association->isOwningSide()) { |
|
| 1444 | 1444 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1445 | 1445 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1446 | 1446 | } |
@@ -1462,7 +1462,7 @@ discard block |
||
| 1462 | 1462 | ); |
| 1463 | 1463 | } |
| 1464 | 1464 | |
| 1465 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1465 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | 1468 | /** |
@@ -1557,7 +1557,7 @@ discard block |
||
| 1557 | 1557 | $columnName = $joinColumn->getColumnName(); |
| 1558 | 1558 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1559 | 1559 | |
| 1560 | - if (! $joinColumn->getType()) { |
|
| 1560 | + if ( ! $joinColumn->getType()) { |
|
| 1561 | 1561 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1562 | 1562 | } |
| 1563 | 1563 | |
@@ -1596,7 +1596,7 @@ discard block |
||
| 1596 | 1596 | |
| 1597 | 1597 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1598 | 1598 | |
| 1599 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1599 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1600 | 1600 | } |
| 1601 | 1601 | |
| 1602 | 1602 | /** |
@@ -1610,14 +1610,14 @@ discard block |
||
| 1610 | 1610 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1611 | 1611 | { |
| 1612 | 1612 | if ($tableName) { |
| 1613 | - $tableName .= '#' . $assocName; |
|
| 1613 | + $tableName .= '#'.$assocName; |
|
| 1614 | 1614 | } |
| 1615 | 1615 | |
| 1616 | 1616 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1617 | 1617 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1618 | 1618 | } |
| 1619 | 1619 | |
| 1620 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1620 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1621 | 1621 | |
| 1622 | 1622 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1623 | 1623 | |
@@ -1644,7 +1644,7 @@ discard block |
||
| 1644 | 1644 | } |
| 1645 | 1645 | |
| 1646 | 1646 | $lock = $this->getLockTablesSql($lockMode); |
| 1647 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1647 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1648 | 1648 | $sql = 'SELECT 1 ' |
| 1649 | 1649 | . $lock |
| 1650 | 1650 | . $where |
@@ -1667,7 +1667,7 @@ discard block |
||
| 1667 | 1667 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1668 | 1668 | |
| 1669 | 1669 | return $this->platform->appendLockHint( |
| 1670 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1670 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1671 | 1671 | $lockMode |
| 1672 | 1672 | ); |
| 1673 | 1673 | } |
@@ -1720,19 +1720,19 @@ discard block |
||
| 1720 | 1720 | |
| 1721 | 1721 | if ($comparison !== null) { |
| 1722 | 1722 | // special case null value handling |
| 1723 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
| 1724 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1723 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
| 1724 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1725 | 1725 | |
| 1726 | 1726 | continue; |
| 1727 | 1727 | } |
| 1728 | 1728 | |
| 1729 | 1729 | if ($comparison === Comparison::NEQ && $value === null) { |
| 1730 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1730 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1731 | 1731 | |
| 1732 | 1732 | continue; |
| 1733 | 1733 | } |
| 1734 | 1734 | |
| 1735 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1735 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1736 | 1736 | |
| 1737 | 1737 | continue; |
| 1738 | 1738 | } |
@@ -1781,7 +1781,7 @@ discard block |
||
| 1781 | 1781 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1782 | 1782 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1783 | 1783 | |
| 1784 | - return [$tableAlias . '.' . $columnName]; |
|
| 1784 | + return [$tableAlias.'.'.$columnName]; |
|
| 1785 | 1785 | } |
| 1786 | 1786 | |
| 1787 | 1787 | if ($property instanceof AssociationMetadata) { |
@@ -1790,7 +1790,7 @@ discard block |
||
| 1790 | 1790 | |
| 1791 | 1791 | // Many-To-Many requires join table check for joinColumn |
| 1792 | 1792 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1793 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1793 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1794 | 1794 | $owningAssociation = $association; |
| 1795 | 1795 | } |
| 1796 | 1796 | |
@@ -1804,15 +1804,15 @@ discard block |
||
| 1804 | 1804 | foreach ($joinColumns as $joinColumn) { |
| 1805 | 1805 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1806 | 1806 | |
| 1807 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1807 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1808 | 1808 | } |
| 1809 | 1809 | |
| 1810 | 1810 | } else { |
| 1811 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1811 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1812 | 1812 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field); |
| 1813 | 1813 | } |
| 1814 | 1814 | |
| 1815 | - $class = $this->class->isInheritedProperty($field) |
|
| 1815 | + $class = $this->class->isInheritedProperty($field) |
|
| 1816 | 1816 | ? $owningAssociation->getDeclaringClass() |
| 1817 | 1817 | : $this->class |
| 1818 | 1818 | ; |
@@ -1821,7 +1821,7 @@ discard block |
||
| 1821 | 1821 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1822 | 1822 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1823 | 1823 | |
| 1824 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1824 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1825 | 1825 | } |
| 1826 | 1826 | } |
| 1827 | 1827 | |
@@ -1934,7 +1934,7 @@ discard block |
||
| 1934 | 1934 | $value = $value[$targetClass->identifier[0]]; |
| 1935 | 1935 | } |
| 1936 | 1936 | |
| 1937 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
| 1937 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
| 1938 | 1938 | $parameters[] = [ |
| 1939 | 1939 | 'value' => $value, |
| 1940 | 1940 | 'field' => $fieldName, |
@@ -2021,7 +2021,7 @@ discard block |
||
| 2021 | 2021 | case ($property instanceof AssociationMetadata): |
| 2022 | 2022 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2023 | 2023 | |
| 2024 | - if (! $property->isOwningSide()) { |
|
| 2024 | + if ( ! $property->isOwningSide()) { |
|
| 2025 | 2025 | $property = $class->getProperty($property->getMappedBy()); |
| 2026 | 2026 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2027 | 2027 | } |
@@ -2035,7 +2035,7 @@ discard block |
||
| 2035 | 2035 | /** @var JoinColumnMetadata $joinColumn */ |
| 2036 | 2036 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2037 | 2037 | |
| 2038 | - if (! $joinColumn->getType()) { |
|
| 2038 | + if ( ! $joinColumn->getType()) { |
|
| 2039 | 2039 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2040 | 2040 | } |
| 2041 | 2041 | |
@@ -2050,7 +2050,7 @@ discard block |
||
| 2050 | 2050 | } |
| 2051 | 2051 | |
| 2052 | 2052 | if (is_array($value)) { |
| 2053 | - return array_map(function ($type) { |
|
| 2053 | + return array_map(function($type) { |
|
| 2054 | 2054 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2055 | 2055 | }, $types); |
| 2056 | 2056 | } |
@@ -2129,12 +2129,12 @@ discard block |
||
| 2129 | 2129 | |
| 2130 | 2130 | $sql = 'SELECT 1 ' |
| 2131 | 2131 | . $this->getLockTablesSql(null) |
| 2132 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2132 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2133 | 2133 | |
| 2134 | 2134 | list($params, $types) = $this->expandParameters($criteria); |
| 2135 | 2135 | |
| 2136 | 2136 | if ($extraConditions !== null) { |
| 2137 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2137 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2138 | 2138 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2139 | 2139 | |
| 2140 | 2140 | $params = array_merge($params, $criteriaParams); |
@@ -2142,7 +2142,7 @@ discard block |
||
| 2142 | 2142 | } |
| 2143 | 2143 | |
| 2144 | 2144 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
| 2145 | - $sql .= ' AND ' . $filterSql; |
|
| 2145 | + $sql .= ' AND '.$filterSql; |
|
| 2146 | 2146 | } |
| 2147 | 2147 | |
| 2148 | 2148 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2157,13 +2157,13 @@ discard block |
||
| 2157 | 2157 | */ |
| 2158 | 2158 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2159 | 2159 | { |
| 2160 | - if (! $association->isOwningSide()) { |
|
| 2160 | + if ( ! $association->isOwningSide()) { |
|
| 2161 | 2161 | return 'LEFT JOIN'; |
| 2162 | 2162 | } |
| 2163 | 2163 | |
| 2164 | 2164 | // if one of the join columns is nullable, return left join |
| 2165 | 2165 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2166 | - if (! $joinColumn->isNullable()) { |
|
| 2166 | + if ( ! $joinColumn->isNullable()) { |
|
| 2167 | 2167 | continue; |
| 2168 | 2168 | } |
| 2169 | 2169 | |
@@ -2180,7 +2180,7 @@ discard block |
||
| 2180 | 2180 | */ |
| 2181 | 2181 | public function getSQLColumnAlias() |
| 2182 | 2182 | { |
| 2183 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2183 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2184 | 2184 | } |
| 2185 | 2185 | |
| 2186 | 2186 | /** |
@@ -2198,13 +2198,13 @@ discard block |
||
| 2198 | 2198 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 2199 | 2199 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 2200 | 2200 | if ($filterExpr !== '') { |
| 2201 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2201 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2202 | 2202 | } |
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | 2205 | $sql = implode(' AND ', $filterClauses); |
| 2206 | 2206 | |
| 2207 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2207 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2208 | 2208 | } |
| 2209 | 2209 | |
| 2210 | 2210 | /** |
@@ -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); |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | |
| 235 | 235 | if ($filterSql = $this->generateFilterConditionSQL($rootClass, $tableAlias)) { |
| 236 | 236 | $conditionSql .= $conditionSql |
| 237 | - ? ' AND ' . $filterSql |
|
| 237 | + ? ' AND '.$filterSql |
|
| 238 | 238 | : $filterSql; |
| 239 | 239 | } |
| 240 | 240 | |
@@ -242,26 +242,26 @@ discard block |
||
| 242 | 242 | |
| 243 | 243 | switch ($lockMode) { |
| 244 | 244 | case LockMode::PESSIMISTIC_READ: |
| 245 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 245 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 246 | 246 | break; |
| 247 | 247 | |
| 248 | 248 | case LockMode::PESSIMISTIC_WRITE: |
| 249 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 249 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 250 | 250 | break; |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 254 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
| 255 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
| 254 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
| 255 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
| 256 | 256 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 257 | 257 | $columnList = $this->getSelectColumnsSQL(); |
| 258 | - $query = 'SELECT ' . $columnList |
|
| 258 | + $query = 'SELECT '.$columnList |
|
| 259 | 259 | . $lock |
| 260 | 260 | . $joinSql |
| 261 | 261 | . $where |
| 262 | 262 | . $orderBySql; |
| 263 | 263 | |
| 264 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 264 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | /** |
@@ -283,14 +283,14 @@ discard block |
||
| 283 | 283 | |
| 284 | 284 | if ($filterSql !== '') { |
| 285 | 285 | $conditionSql = $conditionSql |
| 286 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 286 | + ? $conditionSql.' AND '.$filterSql |
|
| 287 | 287 | : $filterSql; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | $sql = 'SELECT COUNT(*) ' |
| 291 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
| 291 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
| 292 | 292 | . $joinSql |
| 293 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 293 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 294 | 294 | |
| 295 | 295 | return $sql; |
| 296 | 296 | } |
@@ -311,18 +311,18 @@ discard block |
||
| 311 | 311 | $conditions = []; |
| 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,7 +349,7 @@ 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 | |
@@ -359,7 +359,7 @@ discard block |
||
| 359 | 359 | /** @var JoinColumnMetadata $joinColumn */ |
| 360 | 360 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 361 | 361 | |
| 362 | - if (! $joinColumn->getType()) { |
|
| 362 | + if ( ! $joinColumn->getType()) { |
|
| 363 | 363 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 364 | 364 | } |
| 365 | 365 | |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
| 379 | 379 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
| 380 | 380 | |
| 381 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform); |
|
| 381 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform); |
|
| 382 | 382 | |
| 383 | 383 | // sub tables |
| 384 | 384 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -402,7 +402,7 @@ discard block |
||
| 402 | 402 | /** @var JoinColumnMetadata $joinColumn */ |
| 403 | 403 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 404 | 404 | |
| 405 | - if (! $joinColumn->getType()) { |
|
| 405 | + if ( ! $joinColumn->getType()) { |
|
| 406 | 406 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 407 | 407 | } |
| 408 | 408 | |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | $columnName = $joinColumn->getColumnName(); |
| 453 | 453 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 454 | 454 | |
| 455 | - if (! $joinColumn->getType()) { |
|
| 455 | + if ( ! $joinColumn->getType()) { |
|
| 456 | 456 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 457 | 457 | } |
| 458 | 458 | |
@@ -509,12 +509,12 @@ discard block |
||
| 509 | 509 | $conditions = []; |
| 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 @@ 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 | |
@@ -273,10 +273,10 @@ discard block |
||
| 273 | 273 | */ |
| 274 | 274 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
| 275 | 275 | { |
| 276 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
| 276 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
| 277 | 277 | |
| 278 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
| 279 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
| 278 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
| 279 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | return $this->tableAliasMap[$tableName]; |
@@ -294,7 +294,7 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
| 296 | 296 | { |
| 297 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
| 297 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
| 298 | 298 | |
| 299 | 299 | $this->tableAliasMap[$tableName] = $alias; |
| 300 | 300 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function getSQLColumnAlias() |
| 310 | 310 | { |
| 311 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
| 311 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
| 312 | 312 | |
| 313 | 313 | } |
| 314 | 314 | |
@@ -336,14 +336,14 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | // If this is a joined association we must use left joins to preserve the correct result. |
| 338 | 338 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
| 339 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 339 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 340 | 340 | |
| 341 | 341 | $sqlParts = []; |
| 342 | 342 | |
| 343 | 343 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 344 | 344 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 345 | 345 | |
| 346 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 346 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | // Add filters on the root class |
@@ -365,14 +365,14 @@ discard block |
||
| 365 | 365 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 366 | 366 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
| 367 | 367 | |
| 368 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 368 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 369 | 369 | |
| 370 | 370 | $sqlParts = []; |
| 371 | 371 | |
| 372 | 372 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
| 373 | 373 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 374 | 374 | |
| 375 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 375 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | $sql .= implode(' AND ', $sqlParts); |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | $qComp = $this->queryComponents[$dqlAlias]; |
| 394 | 394 | $association = $qComp['relation']; |
| 395 | 395 | |
| 396 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 396 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 397 | 397 | continue; |
| 398 | 398 | } |
| 399 | 399 | |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $property = $qComp['metadata']->getProperty($fieldName); |
| 402 | 402 | $tableName = $property->getTableName(); |
| 403 | 403 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 404 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
| 404 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
| 405 | 405 | |
| 406 | 406 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
| 407 | 407 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | } |
| 410 | 410 | |
| 411 | 411 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
| 412 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
| 412 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
| 413 | 413 | } |
| 414 | 414 | } |
| 415 | 415 | |
@@ -449,19 +449,19 @@ discard block |
||
| 449 | 449 | $discrColumnType = $discrColumn->getType(); |
| 450 | 450 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 451 | 451 | $sqlTableAlias = ($this->useSqlTableAliases) |
| 452 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 452 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 453 | 453 | : ''; |
| 454 | 454 | |
| 455 | 455 | $sqlParts[] = sprintf( |
| 456 | 456 | '%s IN (%s)', |
| 457 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 457 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 458 | 458 | implode(', ', $values) |
| 459 | 459 | ); |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | $sql = implode(' AND ', $sqlParts); |
| 463 | 463 | |
| 464 | - return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql; |
|
| 464 | + return isset($sqlParts[1]) ? '('.$sql.')' : $sql; |
|
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | /** |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | */ |
| 475 | 475 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
| 476 | 476 | { |
| 477 | - if (! $this->em->hasFilters()) { |
|
| 477 | + if ( ! $this->em->hasFilters()) { |
|
| 478 | 478 | return ''; |
| 479 | 479 | } |
| 480 | 480 | |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 507 | 507 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 508 | 508 | if ($filterExpr !== '') { |
| 509 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 509 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 510 | 510 | } |
| 511 | 511 | } |
| 512 | 512 | |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | if ( ! $AST->orderByClause && ($orderBySql = $this->generateOrderedCollectionOrderByItems())) { |
| 541 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
| 541 | + $sql .= ' ORDER BY '.$orderBySql; |
|
| 542 | 542 | } |
| 543 | 543 | |
| 544 | 544 | if ($limit !== null || $offset !== null) { |
@@ -550,11 +550,11 @@ discard block |
||
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
| 553 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
| 553 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
| 557 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
| 557 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 612 | 612 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 613 | 613 | |
| 614 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
| 614 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | return implode(', ', $sqlParts); |
@@ -629,7 +629,7 @@ discard block |
||
| 629 | 629 | { |
| 630 | 630 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
| 631 | 631 | |
| 632 | - if (!$fieldName) { |
|
| 632 | + if ( ! $fieldName) { |
|
| 633 | 633 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
| 634 | 634 | } |
| 635 | 635 | |
@@ -658,7 +658,7 @@ discard block |
||
| 658 | 658 | $property = $class->getProperty($fieldName); |
| 659 | 659 | |
| 660 | 660 | if ($this->useSqlTableAliases) { |
| 661 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
| 661 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
| 673 | 673 | $association = $class->getProperty($fieldName); |
| 674 | 674 | |
| 675 | - if (! $association->isOwningSide()) { |
|
| 675 | + if ( ! $association->isOwningSide()) { |
|
| 676 | 676 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
| 677 | 677 | } |
| 678 | 678 | |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | $joinColumn = reset($joinColumns); |
| 687 | 687 | |
| 688 | 688 | if ($this->useSqlTableAliases) { |
| 689 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
| 689 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -704,7 +704,7 @@ discard block |
||
| 704 | 704 | */ |
| 705 | 705 | public function walkSelectClause($selectClause) |
| 706 | 706 | { |
| 707 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 707 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 708 | 708 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
| 709 | 709 | |
| 710 | 710 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -747,7 +747,7 @@ discard block |
||
| 747 | 747 | |
| 748 | 748 | $sqlSelectExpressions[] = sprintf( |
| 749 | 749 | '%s AS %s', |
| 750 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
| 750 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
| 751 | 751 | $sqlColumnAlias |
| 752 | 752 | ); |
| 753 | 753 | |
@@ -757,12 +757,12 @@ discard block |
||
| 757 | 757 | |
| 758 | 758 | // Add foreign key columns of class and also parent classes |
| 759 | 759 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 760 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
| 760 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
| 761 | 761 | || ( ! $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 | /** @var JoinColumnMetadata $joinColumn */ |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | $columnAlias = $this->getSQLColumnAlias(); |
| 773 | 773 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
| 774 | 774 | |
| 775 | - if (! $joinColumn->getType()) { |
|
| 775 | + if ( ! $joinColumn->getType()) { |
|
| 776 | 776 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 777 | 777 | } |
| 778 | 778 | |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | continue; |
| 803 | 803 | } |
| 804 | 804 | |
| 805 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 805 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 806 | 806 | continue; |
| 807 | 807 | } |
| 808 | 808 | |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | $columnAlias = $this->getSQLColumnAlias(); |
| 817 | 817 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
| 818 | 818 | |
| 819 | - if (! $joinColumn->getType()) { |
|
| 819 | + if ( ! $joinColumn->getType()) { |
|
| 820 | 820 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 821 | 821 | } |
| 822 | 822 | |
@@ -850,7 +850,7 @@ discard block |
||
| 850 | 850 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
| 851 | 851 | } |
| 852 | 852 | |
| 853 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 853 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 854 | 854 | } |
| 855 | 855 | |
| 856 | 856 | /** |
@@ -930,13 +930,13 @@ discard block |
||
| 930 | 930 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 931 | 931 | |
| 932 | 932 | $sql = $this->platform->appendLockHint( |
| 933 | - $tableName . ' ' . $tableAlias, |
|
| 933 | + $tableName.' '.$tableAlias, |
|
| 934 | 934 | $this->query->getHint(Query::HINT_LOCK_MODE) |
| 935 | 935 | ); |
| 936 | 936 | |
| 937 | 937 | if ($class->inheritanceType === InheritanceType::JOINED) { |
| 938 | 938 | if ($buildNestedJoins) { |
| 939 | - $sql = '(' . $sql . $this->generateClassTableInheritanceJoins($class, $dqlAlias) . ')'; |
|
| 939 | + $sql = '('.$sql.$this->generateClassTableInheritanceJoins($class, $dqlAlias).')'; |
|
| 940 | 940 | } else { |
| 941 | 941 | $sql .= $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
| 942 | 942 | } |
@@ -979,7 +979,7 @@ discard block |
||
| 979 | 979 | ; |
| 980 | 980 | |
| 981 | 981 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && |
| 982 | - (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 982 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 983 | 983 | if ($association instanceof ToManyAssociationMetadata) { |
| 984 | 984 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
| 985 | 985 | } |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | 1035 | $targetTableJoin = [ |
| 1036 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1036 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1037 | 1037 | 'condition' => implode(' AND ', $conditions), |
| 1038 | 1038 | ]; |
| 1039 | 1039 | } else if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | ); |
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
| 1064 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
| 1065 | 1065 | |
| 1066 | 1066 | // Join target table |
| 1067 | 1067 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | } |
| 1101 | 1101 | |
| 1102 | 1102 | $targetTableJoin = [ |
| 1103 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1103 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1104 | 1104 | 'condition' => implode(' AND ', $conditions), |
| 1105 | 1105 | ]; |
| 1106 | 1106 | } else { |
@@ -1108,23 +1108,23 @@ discard block |
||
| 1108 | 1108 | } |
| 1109 | 1109 | |
| 1110 | 1110 | // Handle WITH clause |
| 1111 | - $withCondition = ($condExpr === null) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
| 1111 | + $withCondition = ($condExpr === null) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
| 1112 | 1112 | |
| 1113 | 1113 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
| 1114 | 1114 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
| 1115 | 1115 | |
| 1116 | 1116 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
| 1117 | 1117 | if ($withCondition) { |
| 1118 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
| 1118 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
| 1119 | 1119 | } else { |
| 1120 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
| 1120 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
| 1121 | 1121 | } |
| 1122 | 1122 | } else { |
| 1123 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
| 1123 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
| 1124 | 1124 | } |
| 1125 | 1125 | |
| 1126 | 1126 | if ($withCondition) { |
| 1127 | - $sql .= ' AND ' . $withCondition; |
|
| 1127 | + $sql .= ' AND '.$withCondition; |
|
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | // Apply the indexes |
@@ -1157,7 +1157,7 @@ discard block |
||
| 1157 | 1157 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
| 1158 | 1158 | } |
| 1159 | 1159 | |
| 1160 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
| 1160 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
| 1161 | 1161 | } |
| 1162 | 1162 | |
| 1163 | 1163 | /** |
@@ -1174,10 +1174,10 @@ discard block |
||
| 1174 | 1174 | $this->orderedColumnsMap[$sql] = $type; |
| 1175 | 1175 | |
| 1176 | 1176 | if ($expr instanceof AST\Subselect) { |
| 1177 | - return '(' . $sql . ') ' . $type; |
|
| 1177 | + return '('.$sql.') '.$type; |
|
| 1178 | 1178 | } |
| 1179 | 1179 | |
| 1180 | - return $sql . ' ' . $type; |
|
| 1180 | + return $sql.' '.$type; |
|
| 1181 | 1181 | } |
| 1182 | 1182 | |
| 1183 | 1183 | /** |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | */ |
| 1186 | 1186 | public function walkHavingClause($havingClause) |
| 1187 | 1187 | { |
| 1188 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1188 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1189 | 1189 | } |
| 1190 | 1190 | |
| 1191 | 1191 | /** |
@@ -1208,7 +1208,7 @@ discard block |
||
| 1208 | 1208 | $conditions = []; |
| 1209 | 1209 | |
| 1210 | 1210 | if ($join->conditionalExpression) { |
| 1211 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
| 1211 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
| 1212 | 1212 | } |
| 1213 | 1213 | |
| 1214 | 1214 | $isUnconditionalJoin = empty($conditions); |
@@ -1216,7 +1216,7 @@ discard block |
||
| 1216 | 1216 | ? ' AND ' |
| 1217 | 1217 | : ' ON '; |
| 1218 | 1218 | |
| 1219 | - $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, !$isUnconditionalJoin); |
|
| 1219 | + $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, ! $isUnconditionalJoin); |
|
| 1220 | 1220 | |
| 1221 | 1221 | // Apply remaining inheritance restrictions |
| 1222 | 1222 | $discrSql = $this->generateDiscriminatorColumnConditionSQL([$dqlAlias]); |
@@ -1233,7 +1233,7 @@ discard block |
||
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | 1235 | if ($conditions) { |
| 1236 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
| 1236 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
| 1237 | 1237 | } |
| 1238 | 1238 | |
| 1239 | 1239 | break; |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
| 1266 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
| 1267 | 1267 | |
| 1268 | 1268 | return $sql; |
| 1269 | 1269 | } |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | ? $this->conn->quote($nullIfExpression->secondExpression) |
| 1286 | 1286 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
| 1287 | 1287 | |
| 1288 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
| 1288 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | 1291 | /** |
@@ -1300,11 +1300,11 @@ discard block |
||
| 1300 | 1300 | $sql = 'CASE'; |
| 1301 | 1301 | |
| 1302 | 1302 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
| 1303 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1304 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1303 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1304 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1305 | 1305 | } |
| 1306 | 1306 | |
| 1307 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
| 1307 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
| 1308 | 1308 | |
| 1309 | 1309 | return $sql; |
| 1310 | 1310 | } |
@@ -1318,14 +1318,14 @@ discard block |
||
| 1318 | 1318 | */ |
| 1319 | 1319 | public function walkSimpleCaseExpression($simpleCaseExpression) |
| 1320 | 1320 | { |
| 1321 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1321 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1322 | 1322 | |
| 1323 | 1323 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
| 1324 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1325 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1324 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1325 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1326 | 1326 | } |
| 1327 | 1327 | |
| 1328 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
| 1328 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
| 1329 | 1329 | |
| 1330 | 1330 | return $sql; |
| 1331 | 1331 | } |
@@ -1387,7 +1387,7 @@ discard block |
||
| 1387 | 1387 | $columnAlias = $this->getSQLColumnAlias(); |
| 1388 | 1388 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1389 | 1389 | |
| 1390 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1390 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1391 | 1391 | |
| 1392 | 1392 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1393 | 1393 | |
@@ -1402,7 +1402,7 @@ discard block |
||
| 1402 | 1402 | $columnAlias = $this->getSQLColumnAlias(); |
| 1403 | 1403 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1404 | 1404 | |
| 1405 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1405 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1406 | 1406 | |
| 1407 | 1407 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1408 | 1408 | |
@@ -1413,7 +1413,7 @@ discard block |
||
| 1413 | 1413 | break; |
| 1414 | 1414 | |
| 1415 | 1415 | case ($expr instanceof AST\NewObjectExpression): |
| 1416 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
| 1416 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
| 1417 | 1417 | break; |
| 1418 | 1418 | |
| 1419 | 1419 | default: |
@@ -1442,7 +1442,7 @@ discard block |
||
| 1442 | 1442 | |
| 1443 | 1443 | // Select all fields from the queried class |
| 1444 | 1444 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1445 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1445 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1446 | 1446 | continue; |
| 1447 | 1447 | } |
| 1448 | 1448 | |
@@ -1477,11 +1477,11 @@ discard block |
||
| 1477 | 1477 | $subClass = $this->em->getClassMetadata($subClassName); |
| 1478 | 1478 | |
| 1479 | 1479 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1480 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1480 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1481 | 1481 | continue; |
| 1482 | 1482 | } |
| 1483 | 1483 | |
| 1484 | - if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
| 1484 | + if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
| 1485 | 1485 | continue; |
| 1486 | 1486 | } |
| 1487 | 1487 | |
@@ -1516,7 +1516,7 @@ discard block |
||
| 1516 | 1516 | */ |
| 1517 | 1517 | public function walkQuantifiedExpression($qExpr) |
| 1518 | 1518 | { |
| 1519 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
| 1519 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
| 1520 | 1520 | } |
| 1521 | 1521 | |
| 1522 | 1522 | /** |
@@ -1556,7 +1556,7 @@ discard block |
||
| 1556 | 1556 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
| 1557 | 1557 | } |
| 1558 | 1558 | |
| 1559 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 1559 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 1560 | 1560 | } |
| 1561 | 1561 | |
| 1562 | 1562 | /** |
@@ -1564,7 +1564,7 @@ discard block |
||
| 1564 | 1564 | */ |
| 1565 | 1565 | public function walkSimpleSelectClause($simpleSelectClause) |
| 1566 | 1566 | { |
| 1567 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1567 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1568 | 1568 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
| 1569 | 1569 | } |
| 1570 | 1570 | |
@@ -1583,10 +1583,10 @@ discard block |
||
| 1583 | 1583 | * @param null|string $newObjectResultAlias |
| 1584 | 1584 | * @return string The SQL. |
| 1585 | 1585 | */ |
| 1586 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
| 1586 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
| 1587 | 1587 | { |
| 1588 | 1588 | $sqlSelectExpressions = []; |
| 1589 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
| 1589 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
| 1590 | 1590 | |
| 1591 | 1591 | foreach ($newObjectExpression->args as $argIndex => $e) { |
| 1592 | 1592 | $resultAlias = $this->scalarResultCounter++; |
@@ -1599,7 +1599,7 @@ discard block |
||
| 1599 | 1599 | break; |
| 1600 | 1600 | |
| 1601 | 1601 | case ($e instanceof AST\Subselect): |
| 1602 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
| 1602 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
| 1603 | 1603 | break; |
| 1604 | 1604 | |
| 1605 | 1605 | case ($e instanceof AST\PathExpression): |
@@ -1608,7 +1608,7 @@ discard block |
||
| 1608 | 1608 | $class = $qComp['metadata']; |
| 1609 | 1609 | $fieldType = $class->getProperty($e->field)->getType(); |
| 1610 | 1610 | |
| 1611 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1611 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1612 | 1612 | break; |
| 1613 | 1613 | |
| 1614 | 1614 | case ($e instanceof AST\Literal): |
@@ -1622,11 +1622,11 @@ discard block |
||
| 1622 | 1622 | break; |
| 1623 | 1623 | } |
| 1624 | 1624 | |
| 1625 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1625 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1626 | 1626 | break; |
| 1627 | 1627 | |
| 1628 | 1628 | default: |
| 1629 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1629 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1630 | 1630 | break; |
| 1631 | 1631 | } |
| 1632 | 1632 | |
@@ -1659,10 +1659,10 @@ discard block |
||
| 1659 | 1659 | case ($expr instanceof AST\Subselect): |
| 1660 | 1660 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1661 | 1661 | |
| 1662 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
| 1662 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
| 1663 | 1663 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1664 | 1664 | |
| 1665 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1665 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1666 | 1666 | break; |
| 1667 | 1667 | |
| 1668 | 1668 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1679,7 +1679,7 @@ discard block |
||
| 1679 | 1679 | $columnAlias = $this->getSQLColumnAlias(); |
| 1680 | 1680 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1681 | 1681 | |
| 1682 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1682 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1683 | 1683 | break; |
| 1684 | 1684 | |
| 1685 | 1685 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1699,8 +1699,8 @@ discard block |
||
| 1699 | 1699 | */ |
| 1700 | 1700 | public function walkAggregateExpression($aggExpression) |
| 1701 | 1701 | { |
| 1702 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1703 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
| 1702 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1703 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
| 1704 | 1704 | } |
| 1705 | 1705 | |
| 1706 | 1706 | /** |
@@ -1714,7 +1714,7 @@ discard block |
||
| 1714 | 1714 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
| 1715 | 1715 | } |
| 1716 | 1716 | |
| 1717 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
| 1717 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
| 1718 | 1718 | } |
| 1719 | 1719 | |
| 1720 | 1720 | /** |
@@ -1777,7 +1777,7 @@ discard block |
||
| 1777 | 1777 | { |
| 1778 | 1778 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
| 1779 | 1779 | $tableName = $class->getTableName(); |
| 1780 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1780 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1781 | 1781 | |
| 1782 | 1782 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
| 1783 | 1783 | |
@@ -1793,12 +1793,12 @@ discard block |
||
| 1793 | 1793 | { |
| 1794 | 1794 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
| 1795 | 1795 | $tableName = $class->getTableName(); |
| 1796 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1796 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1797 | 1797 | |
| 1798 | 1798 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
| 1799 | 1799 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
| 1800 | 1800 | |
| 1801 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1801 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1802 | 1802 | |
| 1803 | 1803 | return $sql; |
| 1804 | 1804 | } |
@@ -1811,7 +1811,7 @@ discard block |
||
| 1811 | 1811 | $useTableAliasesBefore = $this->useSqlTableAliases; |
| 1812 | 1812 | $this->useSqlTableAliases = false; |
| 1813 | 1813 | |
| 1814 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
| 1814 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
| 1815 | 1815 | $newValue = $updateItem->newValue; |
| 1816 | 1816 | |
| 1817 | 1817 | switch (true) { |
@@ -1854,7 +1854,7 @@ discard block |
||
| 1854 | 1854 | |
| 1855 | 1855 | if ($filterClauses) { |
| 1856 | 1856 | if ($condSql) { |
| 1857 | - $condSql = '(' . $condSql . ') AND '; |
|
| 1857 | + $condSql = '('.$condSql.') AND '; |
|
| 1858 | 1858 | } |
| 1859 | 1859 | |
| 1860 | 1860 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1862,11 +1862,11 @@ discard block |
||
| 1862 | 1862 | } |
| 1863 | 1863 | |
| 1864 | 1864 | if ($condSql) { |
| 1865 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
| 1865 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
| 1866 | 1866 | } |
| 1867 | 1867 | |
| 1868 | 1868 | if ($discrSql) { |
| 1869 | - return ' WHERE ' . $discrSql; |
|
| 1869 | + return ' WHERE '.$discrSql; |
|
| 1870 | 1870 | } |
| 1871 | 1871 | |
| 1872 | 1872 | return ''; |
@@ -1909,7 +1909,7 @@ discard block |
||
| 1909 | 1909 | // if only one ConditionalPrimary is defined |
| 1910 | 1910 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
| 1911 | 1911 | ? $this->walkConditionalPrimary($factor) |
| 1912 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1912 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1913 | 1913 | } |
| 1914 | 1914 | |
| 1915 | 1915 | /** |
@@ -1924,7 +1924,7 @@ discard block |
||
| 1924 | 1924 | if ($primary->isConditionalExpression()) { |
| 1925 | 1925 | $condExpr = $primary->conditionalExpression; |
| 1926 | 1926 | |
| 1927 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
| 1927 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
| 1928 | 1928 | } |
| 1929 | 1929 | } |
| 1930 | 1930 | |
@@ -1935,7 +1935,7 @@ discard block |
||
| 1935 | 1935 | { |
| 1936 | 1936 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
| 1937 | 1937 | |
| 1938 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
| 1938 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
| 1939 | 1939 | |
| 1940 | 1940 | return $sql; |
| 1941 | 1941 | } |
@@ -1984,7 +1984,7 @@ discard block |
||
| 1984 | 1984 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
| 1985 | 1985 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1986 | 1986 | |
| 1987 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
| 1987 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
| 1988 | 1988 | |
| 1989 | 1989 | $sqlParts = []; |
| 1990 | 1990 | |
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 2006 | 2006 | } |
| 2007 | 2007 | |
| 2008 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 2008 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2009 | 2009 | } |
| 2010 | 2010 | |
| 2011 | 2011 | $sql .= implode(' AND ', $sqlParts); |
@@ -2019,7 +2019,7 @@ discard block |
||
| 2019 | 2019 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 2020 | 2020 | |
| 2021 | 2021 | // join to target table |
| 2022 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
| 2022 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
| 2023 | 2023 | |
| 2024 | 2024 | // join conditions |
| 2025 | 2025 | $joinSqlParts = []; |
@@ -2070,13 +2070,13 @@ discard block |
||
| 2070 | 2070 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 2071 | 2071 | } |
| 2072 | 2072 | |
| 2073 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 2073 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2074 | 2074 | } |
| 2075 | 2075 | |
| 2076 | 2076 | $sql .= implode(' AND ', $sqlParts); |
| 2077 | 2077 | } |
| 2078 | 2078 | |
| 2079 | - return $sql . ')'; |
|
| 2079 | + return $sql.')'; |
|
| 2080 | 2080 | } |
| 2081 | 2081 | |
| 2082 | 2082 | /** |
@@ -2087,7 +2087,7 @@ discard block |
||
| 2087 | 2087 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
| 2088 | 2088 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
| 2089 | 2089 | |
| 2090 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2090 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2091 | 2091 | } |
| 2092 | 2092 | |
| 2093 | 2093 | /** |
@@ -2096,19 +2096,19 @@ discard block |
||
| 2096 | 2096 | public function walkNullComparisonExpression($nullCompExpr) |
| 2097 | 2097 | { |
| 2098 | 2098 | $expression = $nullCompExpr->expression; |
| 2099 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
| 2099 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
| 2100 | 2100 | |
| 2101 | 2101 | // Handle ResultVariable |
| 2102 | 2102 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
| 2103 | - return $this->walkResultVariable($expression) . $comparison; |
|
| 2103 | + return $this->walkResultVariable($expression).$comparison; |
|
| 2104 | 2104 | } |
| 2105 | 2105 | |
| 2106 | 2106 | // Handle InputParameter mapping inclusion to ParserResult |
| 2107 | 2107 | if ($expression instanceof AST\InputParameter) { |
| 2108 | - return $this->walkInputParameter($expression) . $comparison; |
|
| 2108 | + return $this->walkInputParameter($expression).$comparison; |
|
| 2109 | 2109 | } |
| 2110 | 2110 | |
| 2111 | - return $expression->dispatch($this) . $comparison; |
|
| 2111 | + return $expression->dispatch($this).$comparison; |
|
| 2112 | 2112 | } |
| 2113 | 2113 | |
| 2114 | 2114 | /** |
@@ -2116,7 +2116,7 @@ discard block |
||
| 2116 | 2116 | */ |
| 2117 | 2117 | public function walkInExpression($inExpr) |
| 2118 | 2118 | { |
| 2119 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
| 2119 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
| 2120 | 2120 | |
| 2121 | 2121 | $sql .= ($inExpr->subselect) |
| 2122 | 2122 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2140,12 +2140,12 @@ discard block |
||
| 2140 | 2140 | $discrColumnType = $discrColumn->getType(); |
| 2141 | 2141 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 2142 | 2142 | $sqlTableAlias = $this->useSqlTableAliases |
| 2143 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 2143 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 2144 | 2144 | : ''; |
| 2145 | 2145 | |
| 2146 | 2146 | return sprintf( |
| 2147 | 2147 | '%s %sIN %s', |
| 2148 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 2148 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 2149 | 2149 | ($instanceOfExpr->not ? 'NOT ' : ''), |
| 2150 | 2150 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
| 2151 | 2151 | ); |
@@ -2192,8 +2192,8 @@ discard block |
||
| 2192 | 2192 | $sql .= ' NOT'; |
| 2193 | 2193 | } |
| 2194 | 2194 | |
| 2195 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2196 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2195 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2196 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2197 | 2197 | |
| 2198 | 2198 | return $sql; |
| 2199 | 2199 | } |
@@ -2208,7 +2208,7 @@ discard block |
||
| 2208 | 2208 | ? $this->walkResultVariable($stringExpr) |
| 2209 | 2209 | : $stringExpr->dispatch($this); |
| 2210 | 2210 | |
| 2211 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
| 2211 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
| 2212 | 2212 | |
| 2213 | 2213 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
| 2214 | 2214 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2221,7 +2221,7 @@ discard block |
||
| 2221 | 2221 | } |
| 2222 | 2222 | |
| 2223 | 2223 | if ($likeExpr->escapeChar) { |
| 2224 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
| 2224 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
| 2225 | 2225 | } |
| 2226 | 2226 | |
| 2227 | 2227 | return $sql; |
@@ -2248,7 +2248,7 @@ discard block |
||
| 2248 | 2248 | ? $leftExpr->dispatch($this) |
| 2249 | 2249 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
| 2250 | 2250 | |
| 2251 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
| 2251 | + $sql .= ' '.$compExpr->operator.' '; |
|
| 2252 | 2252 | |
| 2253 | 2253 | $sql .= ($rightExpr instanceof AST\Node) |
| 2254 | 2254 | ? $rightExpr->dispatch($this) |
@@ -2280,7 +2280,7 @@ discard block |
||
| 2280 | 2280 | { |
| 2281 | 2281 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
| 2282 | 2282 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
| 2283 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
| 2283 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
| 2284 | 2284 | } |
| 2285 | 2285 | |
| 2286 | 2286 | /** |
@@ -2334,7 +2334,7 @@ discard block |
||
| 2334 | 2334 | |
| 2335 | 2335 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
| 2336 | 2336 | |
| 2337 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2337 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2338 | 2338 | } |
| 2339 | 2339 | |
| 2340 | 2340 | /** |
@@ -2347,7 +2347,7 @@ discard block |
||
| 2347 | 2347 | public function walkArithmeticPrimary($primary) |
| 2348 | 2348 | { |
| 2349 | 2349 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
| 2350 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
| 2350 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
| 2351 | 2351 | } |
| 2352 | 2352 | |
| 2353 | 2353 | if ($primary instanceof AST\Node) { |
@@ -2408,7 +2408,7 @@ discard block |
||
| 2408 | 2408 | $entityClassName = $entityClass->getClassName(); |
| 2409 | 2409 | |
| 2410 | 2410 | if ($entityClassName !== $rootClass->getClassName()) { |
| 2411 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
| 2411 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
| 2412 | 2412 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
| 2413 | 2413 | } |
| 2414 | 2414 | } |
@@ -2420,6 +2420,6 @@ discard block |
||
| 2420 | 2420 | $sqlParameterList[] = $this->conn->quote($discriminator); |
| 2421 | 2421 | } |
| 2422 | 2422 | |
| 2423 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
| 2423 | + return '('.implode(', ', $sqlParameterList).')'; |
|
| 2424 | 2424 | } |
| 2425 | 2425 | } |
@@ -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 | |
@@ -292,14 +292,14 @@ discard block |
||
| 292 | 292 | */ |
| 293 | 293 | private function resolveMagicCall($method, $by, array $arguments) |
| 294 | 294 | { |
| 295 | - if (! $arguments) { |
|
| 296 | - throw ORMException::findByRequiresParameter($method . $by); |
|
| 295 | + if ( ! $arguments) { |
|
| 296 | + throw ORMException::findByRequiresParameter($method.$by); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | $fieldName = lcfirst(Inflector::classify($by)); |
| 300 | 300 | |
| 301 | 301 | if ($this->class->getProperty($fieldName) === null) { |
| 302 | - throw ORMException::invalidMagicCall($this->entityName, $fieldName, $method . $by); |
|
| 302 | + throw ORMException::invalidMagicCall($this->entityName, $fieldName, $method.$by); |
|
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | return $this->$method([$fieldName => $arguments[0]], ...array_slice($arguments, 1)); |
@@ -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 | |
@@ -389,7 +389,7 @@ discard block |
||
| 389 | 389 | // Entity deletions come last and need to be in reverse commit order |
| 390 | 390 | if ($this->entityDeletions) { |
| 391 | 391 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 392 | - if (! $this->entityDeletions) { |
|
| 392 | + if ( ! $this->entityDeletions) { |
|
| 393 | 393 | break; // just a performance optimisation |
| 394 | 394 | } |
| 395 | 395 | |
@@ -474,7 +474,7 @@ discard block |
||
| 474 | 474 | $oid = spl_object_hash($entity); |
| 475 | 475 | $data = []; |
| 476 | 476 | |
| 477 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 477 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 478 | 478 | return $data; |
| 479 | 479 | } |
| 480 | 480 | |
@@ -557,7 +557,7 @@ discard block |
||
| 557 | 557 | || ! $class->getProperty($name) instanceof FieldMetadata |
| 558 | 558 | || ! $class->getProperty($name)->hasValueGenerator() |
| 559 | 559 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
| 560 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 560 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 561 | 561 | $actualData[$name] = $value; |
| 562 | 562 | } |
| 563 | 563 | } |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | if ($owner === null) { // cloned |
| 612 | 612 | $actualValue->setOwner($entity, $property); |
| 613 | 613 | } else if ($owner !== $entity) { // no clone, we have to fix |
| 614 | - if (! $actualValue->isInitialized()) { |
|
| 614 | + if ( ! $actualValue->isInitialized()) { |
|
| 615 | 615 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 616 | 616 | } |
| 617 | 617 | |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | // A PersistentCollection was de-referenced, so delete it. |
| 652 | 652 | $coid = spl_object_hash($orgValue); |
| 653 | 653 | |
| 654 | - if (!isset($this->collectionDeletions[$coid])) { |
|
| 654 | + if ( ! isset($this->collectionDeletions[$coid])) { |
|
| 655 | 655 | $this->collectionDeletions[$coid] = $orgValue; |
| 656 | 656 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
| 657 | 657 | } |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | |
| 674 | 674 | // Look for changes in associations of the entity |
| 675 | 675 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 676 | - if (! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) { |
|
| 676 | + if ( ! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) { |
|
| 677 | 677 | continue; |
| 678 | 678 | } |
| 679 | 679 | |
@@ -777,13 +777,13 @@ discard block |
||
| 777 | 777 | $targetClass = $this->em->getClassMetadata($targetEntity); |
| 778 | 778 | |
| 779 | 779 | foreach ($unwrappedValue as $key => $entry) { |
| 780 | - if (! ($entry instanceof $targetEntity)) { |
|
| 780 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 781 | 781 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
| 782 | 782 | } |
| 783 | 783 | |
| 784 | 784 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 785 | 785 | |
| 786 | - if (! ($entry instanceof $targetEntity)) { |
|
| 786 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 787 | 787 | throw ORMException::unexpectedAssociationValue( |
| 788 | 788 | $association->getSourceEntity(), |
| 789 | 789 | $association->getName(), |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | $persister = $this->getEntityPersister($class->getClassName()); |
| 846 | 846 | $generationPlan->executeImmediate($this->em, $entity); |
| 847 | 847 | |
| 848 | - if (! $generationPlan->containsDeferred()) { |
|
| 848 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 849 | 849 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 850 | 850 | $this->entityIdentifiers[$oid] = $id; |
| 851 | 851 | } |
@@ -878,7 +878,7 @@ discard block |
||
| 878 | 878 | { |
| 879 | 879 | $oid = spl_object_hash($entity); |
| 880 | 880 | |
| 881 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 881 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 882 | 882 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
| 883 | 883 | } |
| 884 | 884 | |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | break; |
| 901 | 901 | |
| 902 | 902 | case ($property instanceof FieldMetadata): |
| 903 | - if (! $property->isPrimaryKey() |
|
| 903 | + if ( ! $property->isPrimaryKey() |
|
| 904 | 904 | || ! $property->getValueGenerator() |
| 905 | 905 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 906 | 906 | $actualData[$name] = $property->getValue($entity); |
@@ -1053,7 +1053,7 @@ discard block |
||
| 1053 | 1053 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1054 | 1054 | // is obtained by a new entity because the old one went out of scope. |
| 1055 | 1055 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1056 | - if (! $class->isIdentifierComposite()) { |
|
| 1056 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1057 | 1057 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1058 | 1058 | |
| 1059 | 1059 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1100,7 +1100,7 @@ discard block |
||
| 1100 | 1100 | // Calculate dependencies for new nodes |
| 1101 | 1101 | while ($class = array_pop($newNodes)) { |
| 1102 | 1102 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1103 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1103 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1104 | 1104 | continue; |
| 1105 | 1105 | } |
| 1106 | 1106 | |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | |
| 1115 | 1115 | $weight = ! array_filter( |
| 1116 | 1116 | $property->getJoinColumns(), |
| 1117 | - function (JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
| 1117 | + function(JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); } |
|
| 1118 | 1118 | ); |
| 1119 | 1119 | |
| 1120 | 1120 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1409 | 1409 | $id = $persister->getIdentifier($entity); |
| 1410 | 1410 | |
| 1411 | - if (! $id) { |
|
| 1411 | + if ( ! $id) { |
|
| 1412 | 1412 | return self::STATE_NEW; |
| 1413 | 1413 | } |
| 1414 | 1414 | |
@@ -1641,7 +1641,7 @@ discard block |
||
| 1641 | 1641 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1642 | 1642 | |
| 1643 | 1643 | default: |
| 1644 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1644 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1645 | 1645 | } |
| 1646 | 1646 | |
| 1647 | 1647 | $this->cascadePersist($entity, $visited); |
@@ -1711,7 +1711,7 @@ discard block |
||
| 1711 | 1711 | case self::STATE_DETACHED: |
| 1712 | 1712 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1713 | 1713 | default: |
| 1714 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1714 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1715 | 1715 | } |
| 1716 | 1716 | |
| 1717 | 1717 | } |
@@ -1780,7 +1780,7 @@ discard block |
||
| 1780 | 1780 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1781 | 1781 | |
| 1782 | 1782 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1783 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
| 1783 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) { |
|
| 1784 | 1784 | continue; |
| 1785 | 1785 | } |
| 1786 | 1786 | |
@@ -1827,7 +1827,7 @@ discard block |
||
| 1827 | 1827 | } |
| 1828 | 1828 | |
| 1829 | 1829 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1830 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
| 1830 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) { |
|
| 1831 | 1831 | continue; |
| 1832 | 1832 | } |
| 1833 | 1833 | |
@@ -1843,7 +1843,7 @@ discard block |
||
| 1843 | 1843 | |
| 1844 | 1844 | case ($relatedEntities instanceof Collection): |
| 1845 | 1845 | case (is_array($relatedEntities)): |
| 1846 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1846 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1847 | 1847 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1848 | 1848 | $this->em->getClassMetadata($targetEntity), |
| 1849 | 1849 | $association, |
@@ -1858,7 +1858,7 @@ discard block |
||
| 1858 | 1858 | break; |
| 1859 | 1859 | |
| 1860 | 1860 | case ($relatedEntities !== null): |
| 1861 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1861 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1862 | 1862 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1863 | 1863 | $this->em->getClassMetadata($targetEntity), |
| 1864 | 1864 | $association, |
@@ -1889,7 +1889,7 @@ discard block |
||
| 1889 | 1889 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1890 | 1890 | |
| 1891 | 1891 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1892 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
| 1892 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) { |
|
| 1893 | 1893 | continue; |
| 1894 | 1894 | } |
| 1895 | 1895 | |
@@ -1972,7 +1972,7 @@ discard block |
||
| 1972 | 1972 | case $lockMode === LockMode::NONE: |
| 1973 | 1973 | case $lockMode === LockMode::PESSIMISTIC_READ: |
| 1974 | 1974 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
| 1975 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 1975 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 1976 | 1976 | throw TransactionRequiredException::transactionRequired(); |
| 1977 | 1977 | } |
| 1978 | 1978 | |
@@ -2196,7 +2196,7 @@ discard block |
||
| 2196 | 2196 | } |
| 2197 | 2197 | |
| 2198 | 2198 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2199 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2199 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2200 | 2200 | continue; |
| 2201 | 2201 | } |
| 2202 | 2202 | |
@@ -2245,7 +2245,7 @@ discard block |
||
| 2245 | 2245 | continue; |
| 2246 | 2246 | } |
| 2247 | 2247 | |
| 2248 | - if (! $association->isOwningSide()) { |
|
| 2248 | + if ( ! $association->isOwningSide()) { |
|
| 2249 | 2249 | // use the given entity association |
| 2250 | 2250 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2251 | 2251 | isset($this->entityStates[spl_object_hash($data[$field])])) { |
@@ -2295,7 +2295,7 @@ discard block |
||
| 2295 | 2295 | $associatedId[$targetField] = $joinColumnValue; |
| 2296 | 2296 | } |
| 2297 | 2297 | |
| 2298 | - if (! $associatedId) { |
|
| 2298 | + if ( ! $associatedId) { |
|
| 2299 | 2299 | // Foreign key is NULL |
| 2300 | 2300 | $association->setValue($entity, null); |
| 2301 | 2301 | $this->originalEntityData[$oid][$field] = null; |
@@ -2304,7 +2304,7 @@ discard block |
||
| 2304 | 2304 | } |
| 2305 | 2305 | |
| 2306 | 2306 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2307 | - if (!isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2307 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2308 | 2308 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2309 | 2309 | } |
| 2310 | 2310 | |
@@ -2321,7 +2321,7 @@ discard block |
||
| 2321 | 2321 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2322 | 2322 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2323 | 2323 | // then we can append this entity for eager loading! |
| 2324 | - if (!$targetClass->isIdentifierComposite() && |
|
| 2324 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2325 | 2325 | $newValue instanceof GhostObjectInterface && |
| 2326 | 2326 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2327 | 2327 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2358,7 +2358,7 @@ discard block |
||
| 2358 | 2358 | break; |
| 2359 | 2359 | |
| 2360 | 2360 | // Deferred eager load only works for single identifier classes |
| 2361 | - case (isset($hints[self::HINT_DEFEREAGERLOAD]) && !$targetClass->isIdentifierComposite()): |
|
| 2361 | + case (isset($hints[self::HINT_DEFEREAGERLOAD]) && ! $targetClass->isIdentifierComposite()): |
|
| 2362 | 2362 | // TODO: Is there a faster approach? |
| 2363 | 2363 | $this->eagerLoadingEntities[$targetClass->getRootClassName()][$relatedIdHash] = current($normalizedAssociatedId); |
| 2364 | 2364 | |
@@ -2765,7 +2765,7 @@ discard block |
||
| 2765 | 2765 | { |
| 2766 | 2766 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2767 | 2767 | |
| 2768 | - if (! $class->getProperty($propertyName)) { |
|
| 2768 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2769 | 2769 | return; // ignore non-persistent fields |
| 2770 | 2770 | } |
| 2771 | 2771 | |
@@ -2905,7 +2905,7 @@ discard block |
||
| 2905 | 2905 | */ |
| 2906 | 2906 | private function afterTransactionComplete() |
| 2907 | 2907 | { |
| 2908 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2908 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2909 | 2909 | $persister->afterTransactionComplete(); |
| 2910 | 2910 | }); |
| 2911 | 2911 | } |
@@ -2915,7 +2915,7 @@ discard block |
||
| 2915 | 2915 | */ |
| 2916 | 2916 | private function afterTransactionRolledBack() |
| 2917 | 2917 | { |
| 2918 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2918 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2919 | 2919 | $persister->afterTransactionRolledBack(); |
| 2920 | 2920 | }); |
| 2921 | 2921 | } |
@@ -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\Mapping; |
| 7 | 7 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | */ |
| 309 | 309 | public function __toString() |
| 310 | 310 | { |
| 311 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
| 311 | + return __CLASS__.'@'.spl_object_hash($this); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /** |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | // Restore ReflectionClass and properties |
| 412 | 412 | $this->reflectionClass = $reflectionService->getClass($this->className); |
| 413 | 413 | |
| 414 | - if (! $this->reflectionClass) { |
|
| 414 | + if ( ! $this->reflectionClass) { |
|
| 415 | 415 | return; |
| 416 | 416 | } |
| 417 | 417 | |
@@ -437,11 +437,11 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | // Verify & complete identifier mapping |
| 440 | - if (! $this->identifier) { |
|
| 440 | + if ( ! $this->identifier) { |
|
| 441 | 441 | throw MappingException::identifierRequired($this->className); |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
| 444 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
| 445 | 445 | return $property instanceof FieldMetadata |
| 446 | 446 | && $property->isPrimaryKey() |
| 447 | 447 | && $property->hasValueGenerator(); |
@@ -462,14 +462,14 @@ discard block |
||
| 462 | 462 | public function validateAssociations() : void |
| 463 | 463 | { |
| 464 | 464 | array_map( |
| 465 | - function (Property $property) { |
|
| 466 | - if (! ($property instanceof AssociationMetadata)) { |
|
| 465 | + function(Property $property) { |
|
| 466 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
| 467 | 467 | return; |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | $targetEntity = $property->getTargetEntity(); |
| 471 | 471 | |
| 472 | - if (! class_exists($targetEntity)) { |
|
| 472 | + if ( ! class_exists($targetEntity)) { |
|
| 473 | 473 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
| 474 | 474 | } |
| 475 | 475 | }, |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | foreach ($this->lifecycleCallbacks as $callbacks) { |
| 492 | 492 | /** @var array $callbacks */ |
| 493 | 493 | foreach ($callbacks as $callbackFuncName) { |
| 494 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 494 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 495 | 495 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
| 496 | 496 | } |
| 497 | 497 | } |
@@ -519,11 +519,11 @@ discard block |
||
| 519 | 519 | */ |
| 520 | 520 | public function isIdentifier(string $fieldName) : bool |
| 521 | 521 | { |
| 522 | - if (! $this->identifier) { |
|
| 522 | + if ( ! $this->identifier) { |
|
| 523 | 523 | return false; |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | - if (! $this->isIdentifierComposite()) { |
|
| 526 | + if ( ! $this->isIdentifierComposite()) { |
|
| 527 | 527 | return $fieldName === $this->identifier[0]; |
| 528 | 528 | } |
| 529 | 529 | |
@@ -551,7 +551,7 @@ discard block |
||
| 551 | 551 | */ |
| 552 | 552 | public function getNamedQuery($queryName) : string |
| 553 | 553 | { |
| 554 | - if (! isset($this->namedQueries[$queryName])) { |
|
| 554 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
| 555 | 555 | throw MappingException::queryNotFound($this->className, $queryName); |
| 556 | 556 | } |
| 557 | 557 | |
@@ -611,7 +611,7 @@ discard block |
||
| 611 | 611 | */ |
| 612 | 612 | public function getSqlResultSetMapping($name) |
| 613 | 613 | { |
| 614 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
| 614 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
| 615 | 615 | throw MappingException::resultMappingNotFound($this->className, $name); |
| 616 | 616 | } |
| 617 | 617 | |
@@ -646,7 +646,7 @@ discard block |
||
| 646 | 646 | $property->setColumnName($columnName); |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | - if (! $this->isMappedSuperclass) { |
|
| 649 | + if ( ! $this->isMappedSuperclass) { |
|
| 650 | 650 | $property->setTableName($this->getTableName()); |
| 651 | 651 | } |
| 652 | 652 | |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
| 667 | 667 | }; |
| 668 | 668 | |
| 669 | - if (! in_array($fieldName, $this->identifier)) { |
|
| 669 | + if ( ! in_array($fieldName, $this->identifier)) { |
|
| 670 | 670 | $this->identifier[] = $fieldName; |
| 671 | 671 | } |
| 672 | 672 | } |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | $fieldName = $property->getName(); |
| 721 | 721 | $targetEntity = $property->getTargetEntity(); |
| 722 | 722 | |
| 723 | - if (! $targetEntity) { |
|
| 723 | + if ( ! $targetEntity) { |
|
| 724 | 724 | throw MappingException::missingTargetEntity($fieldName); |
| 725 | 725 | } |
| 726 | 726 | |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | $this->identifier[] = $property->getName(); |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | - if ($this->cache && !$property->getCache()) { |
|
| 749 | + if ($this->cache && ! $property->getCache()) { |
|
| 750 | 750 | throw CacheException::nonCacheableEntityAssociation($this->className, $fieldName); |
| 751 | 751 | } |
| 752 | 752 | |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | /** @var JoinColumnMetadata $joinColumn */ |
| 801 | 801 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
| 802 | 802 | if (count($property->getJoinColumns()) === 1) { |
| 803 | - if (! $property->isPrimaryKey()) { |
|
| 803 | + if ( ! $property->isPrimaryKey()) { |
|
| 804 | 804 | $joinColumn->setUnique(true); |
| 805 | 805 | } |
| 806 | 806 | } else { |
@@ -808,13 +808,13 @@ discard block |
||
| 808 | 808 | } |
| 809 | 809 | } |
| 810 | 810 | |
| 811 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 811 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 812 | 812 | |
| 813 | - if (! $joinColumn->getColumnName()) { |
|
| 813 | + if ( ! $joinColumn->getColumnName()) { |
|
| 814 | 814 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
| 815 | 815 | } |
| 816 | 816 | |
| 817 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 817 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 818 | 818 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 819 | 819 | } |
| 820 | 820 | |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | if ($property->isOrphanRemoval()) { |
| 843 | 843 | $cascades = $property->getCascade(); |
| 844 | 844 | |
| 845 | - if (! in_array('remove', $cascades)) { |
|
| 845 | + if ( ! in_array('remove', $cascades)) { |
|
| 846 | 846 | $cascades[] = 'remove'; |
| 847 | 847 | |
| 848 | 848 | $property->setCascade($cascades); |
@@ -908,14 +908,14 @@ discard block |
||
| 908 | 908 | $property->setOwningSide(false); |
| 909 | 909 | |
| 910 | 910 | // OneToMany MUST have mappedBy |
| 911 | - if (! $property->getMappedBy()) { |
|
| 911 | + if ( ! $property->getMappedBy()) { |
|
| 912 | 912 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | if ($property->isOrphanRemoval()) { |
| 916 | 916 | $cascades = $property->getCascade(); |
| 917 | 917 | |
| 918 | - if (! in_array('remove', $cascades)) { |
|
| 918 | + if ( ! in_array('remove', $cascades)) { |
|
| 919 | 919 | $cascades[] = 'remove'; |
| 920 | 920 | |
| 921 | 921 | $property->setCascade($cascades); |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | |
| 939 | 939 | $property->setJoinTable($joinTable); |
| 940 | 940 | |
| 941 | - if (! $joinTable->getName()) { |
|
| 941 | + if ( ! $joinTable->getName()) { |
|
| 942 | 942 | $joinTableName = $this->namingStrategy->joinTableName( |
| 943 | 943 | $property->getSourceEntity(), |
| 944 | 944 | $property->getTargetEntity(), |
@@ -950,7 +950,7 @@ discard block |
||
| 950 | 950 | |
| 951 | 951 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() == $property->getTargetEntity() && ! $joinTable->hasColumns(); |
| 952 | 952 | |
| 953 | - if (! $joinTable->getJoinColumns()) { |
|
| 953 | + if ( ! $joinTable->getJoinColumns()) { |
|
| 954 | 954 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 955 | 955 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
| 956 | 956 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | $joinTable->addJoinColumn($joinColumn); |
| 964 | 964 | } |
| 965 | 965 | |
| 966 | - if (! $joinTable->getInverseJoinColumns()) { |
|
| 966 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
| 967 | 967 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 968 | 968 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
| 969 | 969 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -978,13 +978,13 @@ discard block |
||
| 978 | 978 | |
| 979 | 979 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 980 | 980 | /** @var JoinColumnMetadata $joinColumn */ |
| 981 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 981 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 982 | 982 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 983 | 983 | } |
| 984 | 984 | |
| 985 | 985 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 986 | 986 | |
| 987 | - if (! $joinColumn->getColumnName()) { |
|
| 987 | + if ( ! $joinColumn->getColumnName()) { |
|
| 988 | 988 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 989 | 989 | $property->getSourceEntity(), |
| 990 | 990 | $referencedColumnName |
@@ -996,13 +996,13 @@ discard block |
||
| 996 | 996 | |
| 997 | 997 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
| 998 | 998 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
| 999 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 999 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 1000 | 1000 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 1001 | 1001 | } |
| 1002 | 1002 | |
| 1003 | 1003 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
| 1004 | 1004 | |
| 1005 | - if (! $inverseJoinColumn->getColumnName()) { |
|
| 1005 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
| 1006 | 1006 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 1007 | 1007 | $property->getTargetEntity(), |
| 1008 | 1008 | $referencedColumnName |
@@ -1099,7 +1099,7 @@ discard block |
||
| 1099 | 1099 | // Association defined as Id field |
| 1100 | 1100 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1101 | 1101 | |
| 1102 | - if (! $property->isOwningSide()) { |
|
| 1102 | + if ( ! $property->isOwningSide()) { |
|
| 1103 | 1103 | $property = $targetClass->getProperty($property->getMappedBy()); |
| 1104 | 1104 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1105 | 1105 | } |
@@ -1114,7 +1114,7 @@ discard block |
||
| 1114 | 1114 | $columnName = $joinColumn->getColumnName(); |
| 1115 | 1115 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1116 | 1116 | |
| 1117 | - if (! $joinColumn->getType()) { |
|
| 1117 | + if ( ! $joinColumn->getType()) { |
|
| 1118 | 1118 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
| 1119 | 1119 | } |
| 1120 | 1120 | |
@@ -1154,11 +1154,11 @@ discard block |
||
| 1154 | 1154 | { |
| 1155 | 1155 | $schema = $this->getSchemaName() === null |
| 1156 | 1156 | ? '' |
| 1157 | - : $this->getSchemaName() . '_' |
|
| 1157 | + : $this->getSchemaName().'_' |
|
| 1158 | 1158 | ; |
| 1159 | 1159 | |
| 1160 | 1160 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 1161 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
| 1161 | + return $schema.$this->getTableName().'_id_tmp'; |
|
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | 1164 | /** |
@@ -1218,7 +1218,7 @@ discard block |
||
| 1218 | 1218 | { |
| 1219 | 1219 | $fieldName = $property->getName(); |
| 1220 | 1220 | |
| 1221 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
| 1221 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
| 1222 | 1222 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
| 1223 | 1223 | } |
| 1224 | 1224 | |
@@ -1426,7 +1426,7 @@ discard block |
||
| 1426 | 1426 | $declaringClass = $property->getDeclaringClass(); |
| 1427 | 1427 | |
| 1428 | 1428 | if ($inheritedProperty instanceof FieldMetadata) { |
| 1429 | - if (! $declaringClass->isMappedSuperclass) { |
|
| 1429 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
| 1430 | 1430 | $inheritedProperty->setTableName($property->getTableName()); |
| 1431 | 1431 | } |
| 1432 | 1432 | |
@@ -1494,7 +1494,7 @@ discard block |
||
| 1494 | 1494 | throw MappingException::duplicateQueryMapping($this->className, $name); |
| 1495 | 1495 | } |
| 1496 | 1496 | |
| 1497 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1497 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1498 | 1498 | throw MappingException::missingQueryMapping($this->className, $name); |
| 1499 | 1499 | } |
| 1500 | 1500 | |
@@ -1517,7 +1517,7 @@ discard block |
||
| 1517 | 1517 | */ |
| 1518 | 1518 | public function addSqlResultSetMapping(array $resultMapping) |
| 1519 | 1519 | { |
| 1520 | - if (!isset($resultMapping['name'])) { |
|
| 1520 | + if ( ! isset($resultMapping['name'])) { |
|
| 1521 | 1521 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
| 1522 | 1522 | } |
| 1523 | 1523 | |
@@ -1527,7 +1527,7 @@ discard block |
||
| 1527 | 1527 | |
| 1528 | 1528 | if (isset($resultMapping['entities'])) { |
| 1529 | 1529 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
| 1530 | - if (! isset($entityResult['entityClass'])) { |
|
| 1530 | + if ( ! isset($entityResult['entityClass'])) { |
|
| 1531 | 1531 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
| 1532 | 1532 | } |
| 1533 | 1533 | |
@@ -1540,11 +1540,11 @@ discard block |
||
| 1540 | 1540 | |
| 1541 | 1541 | if (isset($entityResult['fields'])) { |
| 1542 | 1542 | foreach ($entityResult['fields'] as $k => $field) { |
| 1543 | - if (! isset($field['name'])) { |
|
| 1543 | + if ( ! isset($field['name'])) { |
|
| 1544 | 1544 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
| 1545 | 1545 | } |
| 1546 | 1546 | |
| 1547 | - if (! isset($field['column'])) { |
|
| 1547 | + if ( ! isset($field['column'])) { |
|
| 1548 | 1548 | $fieldName = $field['name']; |
| 1549 | 1549 | |
| 1550 | 1550 | if (strpos($fieldName, '.')) { |
@@ -1653,11 +1653,11 @@ discard block |
||
| 1653 | 1653 | 'method' => $method, |
| 1654 | 1654 | ]; |
| 1655 | 1655 | |
| 1656 | - if (! class_exists($class)) { |
|
| 1656 | + if ( ! class_exists($class)) { |
|
| 1657 | 1657 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | - if (! method_exists($class, $method)) { |
|
| 1660 | + if ( ! method_exists($class, $method)) { |
|
| 1661 | 1661 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
| 1662 | 1662 | } |
| 1663 | 1663 | |
@@ -1733,7 +1733,7 @@ discard block |
||
| 1733 | 1733 | return; |
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | - if (! (class_exists($className) || interface_exists($className))) { |
|
| 1736 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
| 1737 | 1737 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
| 1738 | 1738 | } |
| 1739 | 1739 | |
@@ -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\Mapping\Factory\Strategy; |
| 7 | 7 | |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $this->ensureDirectoryIsReady(dirname($filePath)); |
| 36 | 36 | |
| 37 | - $tmpFileName = $filePath . '.' . uniqid('', true); |
|
| 37 | + $tmpFileName = $filePath.'.'.uniqid('', true); |
|
| 38 | 38 | |
| 39 | 39 | file_put_contents($tmpFileName, $sourceCode); |
| 40 | 40 | @chmod($tmpFileName, 0664); |
@@ -50,11 +50,11 @@ discard block |
||
| 50 | 50 | */ |
| 51 | 51 | private function ensureDirectoryIsReady(string $directory) |
| 52 | 52 | { |
| 53 | - if (! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) { |
|
| 53 | + if ( ! is_dir($directory) && (@mkdir($directory, 0775, true) === false)) { |
|
| 54 | 54 | throw new \RuntimeException(sprintf('Your metadata directory "%s" must be writable', $directory)); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if (! is_writable($directory)) { |
|
| 57 | + if ( ! is_writable($directory)) { |
|
| 58 | 58 | throw new \RuntimeException(sprintf('Your proxy directory "%s" must be writable', $directory)); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -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\Mapping\Factory; |
| 7 | 7 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | // remove namespace separators from remaining class name |
| 39 | 39 | $fileName = str_replace('\\', '', $classNameRelativeToMetadataNamespace); |
| 40 | 40 | |
| 41 | - return $metadataDir . DIRECTORY_SEPARATOR . $fileName . '.php'; |
|
| 41 | + return $metadataDir.DIRECTORY_SEPARATOR.$fileName.'.php'; |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | { |
| 61 | 61 | $metadataNamespace = ltrim($metadataNamespace, '\\'); |
| 62 | 62 | |
| 63 | - if (! ($notFoundCallback === null || is_callable($notFoundCallback))) { |
|
| 63 | + if ( ! ($notFoundCallback === null || is_callable($notFoundCallback))) { |
|
| 64 | 64 | $type = is_object($notFoundCallback) ? get_class($notFoundCallback) : gettype($notFoundCallback); |
| 65 | 65 | |
| 66 | 66 | throw new InvalidArgumentException( |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | ); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - $autoloader = function ($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) { |
|
| 71 | + $autoloader = function($className) use ($metadataDir, $metadataNamespace, $notFoundCallback) { |
|
| 72 | 72 | if (strpos($className, $metadataNamespace) === 0) { |
| 73 | 73 | $file = Autoloader::resolveFile($metadataDir, $metadataNamespace, $className); |
| 74 | 74 | |