@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | ) { |
144 | 144 | $this->reverseEngineerMappingFromDatabase(); |
145 | 145 | |
146 | - if (! isset($this->classToTableNames[$className])) { |
|
147 | - throw new InvalidArgumentException('Unknown class ' . $className); |
|
146 | + if ( ! isset($this->classToTableNames[$className])) { |
|
147 | + throw new InvalidArgumentException('Unknown class '.$className); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | // @todo guilhermeblanco This should somehow disappear... =) |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | - if (! $otherFk) { |
|
177 | + if ( ! $otherFk) { |
|
178 | 178 | // the definition of this many to many table does not contain |
179 | 179 | // enough foreign key information to continue reverse engineering. |
180 | 180 | continue; |
@@ -255,9 +255,9 @@ discard block |
||
255 | 255 | $allForeignKeyColumns = array_merge($allForeignKeyColumns, $foreignKey->getLocalColumns()); |
256 | 256 | } |
257 | 257 | |
258 | - if (! $table->hasPrimaryKey()) { |
|
258 | + if ( ! $table->hasPrimaryKey()) { |
|
259 | 259 | throw new Mapping\MappingException( |
260 | - 'Table ' . $table->getName() . ' has no primary key. Doctrine does not ' . |
|
260 | + 'Table '.$table->getName().' has no primary key. Doctrine does not '. |
|
261 | 261 | "support reverse engineering from tables that don't have a primary key." |
262 | 262 | ); |
263 | 263 | } |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | } |
448 | 448 | |
449 | 449 | // Here we need to check if $fkColumns are the same as $primaryKeys |
450 | - if (! array_diff($fkColumns, $primaryKeys)) { |
|
450 | + if ( ! array_diff($fkColumns, $primaryKeys)) { |
|
451 | 451 | $metadata->addProperty($associationMapping); |
452 | 452 | } else { |
453 | 453 | $metadata->addProperty($associationMapping); |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | */ |
493 | 493 | private function getClassNameForTable($tableName) |
494 | 494 | { |
495 | - return $this->namespace . ( |
|
495 | + return $this->namespace.( |
|
496 | 496 | $this->classNamesForTables[$tableName] |
497 | 497 | ?? Inflector::classify(strtolower($tableName)) |
498 | 498 | ); |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | |
306 | 306 | // FIXME: Order with composite keys might not be correct |
307 | 307 | $sql = 'SELECT ' . $columnName |
308 | - . ' FROM ' . $tableName |
|
309 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
308 | + . ' FROM ' . $tableName |
|
309 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
310 | 310 | |
311 | 311 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
312 | 312 | $versionType = $versionProperty->getType(); |
@@ -519,8 +519,8 @@ discard block |
||
519 | 519 | } |
520 | 520 | |
521 | 521 | $sql = 'UPDATE ' . $quotedTableName |
522 | - . ' SET ' . implode(', ', $set) |
|
523 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
522 | + . ' SET ' . implode(', ', $set) |
|
523 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
524 | 524 | |
525 | 525 | $result = $this->conn->executeUpdate($sql, $params, $types); |
526 | 526 | |
@@ -1641,9 +1641,9 @@ discard block |
||
1641 | 1641 | $lock = $this->getLockTablesSql($lockMode); |
1642 | 1642 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1643 | 1643 | $sql = 'SELECT 1 ' |
1644 | - . $lock |
|
1645 | - . $where |
|
1646 | - . $lockSql; |
|
1644 | + . $lock |
|
1645 | + . $where |
|
1646 | + . $lockSql; |
|
1647 | 1647 | |
1648 | 1648 | [$params, $types] = $this->expandParameters($criteria); |
1649 | 1649 | |
@@ -2112,8 +2112,8 @@ discard block |
||
2112 | 2112 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
2113 | 2113 | |
2114 | 2114 | $sql = 'SELECT 1 ' |
2115 | - . $this->getLockTablesSql(null) |
|
2116 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2115 | + . $this->getLockTablesSql(null) |
|
2116 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2117 | 2117 | |
2118 | 2118 | [$params, $types] = $this->expandParameters($criteria); |
2119 | 2119 |
@@ -297,16 +297,16 @@ discard block |
||
297 | 297 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
298 | 298 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
299 | 299 | $identifier = array_map( |
300 | - function ($columnName) { |
|
300 | + function($columnName) { |
|
301 | 301 | return $this->platform->quoteIdentifier($columnName); |
302 | 302 | }, |
303 | 303 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
304 | 304 | ); |
305 | 305 | |
306 | 306 | // FIXME: Order with composite keys might not be correct |
307 | - $sql = 'SELECT ' . $columnName |
|
308 | - . ' FROM ' . $tableName |
|
309 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
307 | + $sql = 'SELECT '.$columnName |
|
308 | + . ' FROM '.$tableName |
|
309 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
310 | 310 | |
311 | 311 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
312 | 312 | $versionType = $versionProperty->getType(); |
@@ -345,13 +345,13 @@ discard block |
||
345 | 345 | $tableName = $this->class->getTableName(); |
346 | 346 | $updateData = $this->prepareUpdateData($entity); |
347 | 347 | |
348 | - if (! isset($updateData[$tableName])) { |
|
348 | + if ( ! isset($updateData[$tableName])) { |
|
349 | 349 | return; |
350 | 350 | } |
351 | 351 | |
352 | 352 | $data = $updateData[$tableName]; |
353 | 353 | |
354 | - if (! $data) { |
|
354 | + if ( ! $data) { |
|
355 | 355 | return; |
356 | 356 | } |
357 | 357 | |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | if ($value !== null) { |
405 | 405 | // @todo guilhermeblanco Make sure we do not have flat association values. |
406 | - if (! is_array($value)) { |
|
406 | + if ( ! is_array($value)) { |
|
407 | 407 | $value = [$targetClass->identifier[0] => $value]; |
408 | 408 | } |
409 | 409 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
417 | 417 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
418 | 418 | |
419 | - if (! $joinColumn->getType()) { |
|
419 | + if ( ! $joinColumn->getType()) { |
|
420 | 420 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
421 | 421 | } |
422 | 422 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
483 | 483 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
484 | 484 | |
485 | - if (! $joinColumn->getType()) { |
|
485 | + if ( ! $joinColumn->getType()) { |
|
486 | 486 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
487 | 487 | } |
488 | 488 | |
@@ -509,18 +509,18 @@ discard block |
||
509 | 509 | case Type::SMALLINT: |
510 | 510 | case Type::INTEGER: |
511 | 511 | case Type::BIGINT: |
512 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
512 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
513 | 513 | break; |
514 | 514 | |
515 | 515 | case Type::DATETIME: |
516 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
516 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
517 | 517 | break; |
518 | 518 | } |
519 | 519 | } |
520 | 520 | |
521 | - $sql = 'UPDATE ' . $quotedTableName |
|
522 | - . ' SET ' . implode(', ', $set) |
|
523 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
521 | + $sql = 'UPDATE '.$quotedTableName |
|
522 | + . ' SET '.implode(', ', $set) |
|
523 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
524 | 524 | |
525 | 525 | $result = $this->conn->executeUpdate($sql, $params, $types); |
526 | 526 | |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | protected function deleteJoinTableRecords($identifier) |
538 | 538 | { |
539 | 539 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
540 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
540 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
541 | 541 | continue; |
542 | 542 | } |
543 | 543 | |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | $otherKeys = []; |
550 | 550 | $keys = []; |
551 | 551 | |
552 | - if (! $owningAssociation->isOwningSide()) { |
|
552 | + if ( ! $owningAssociation->isOwningSide()) { |
|
553 | 553 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
554 | 554 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
555 | 555 | } |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | } |
660 | 660 | |
661 | 661 | // Only owning side of x-1 associations can have a FK column. |
662 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
662 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
663 | 663 | continue; |
664 | 664 | } |
665 | 665 | |
@@ -679,7 +679,7 @@ discard block |
||
679 | 679 | /** @var JoinColumnMetadata $joinColumn */ |
680 | 680 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
681 | 681 | |
682 | - if (! $joinColumn->getType()) { |
|
682 | + if ( ! $joinColumn->getType()) { |
|
683 | 683 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
684 | 684 | } |
685 | 685 | |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | $propertyName = $this->class->fieldNames[$columnName]; |
707 | 707 | $property = $this->class->getProperty($propertyName); |
708 | 708 | |
709 | - if (! $property) { |
|
709 | + if ( ! $property) { |
|
710 | 710 | return null; |
711 | 711 | } |
712 | 712 | |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | /** @var JoinColumnMetadata $joinColumn */ |
726 | 726 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
727 | 727 | |
728 | - if (! $joinColumn->getType()) { |
|
728 | + if ( ! $joinColumn->getType()) { |
|
729 | 729 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
730 | 730 | } |
731 | 731 | |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
831 | 831 | $targetKeyColumn = $joinColumn->getColumnName(); |
832 | 832 | |
833 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
833 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
834 | 834 | throw MappingException::joinColumnMustPointToMappedField( |
835 | 835 | $sourceClass->getClassName(), |
836 | 836 | $sourceKeyColumn |
@@ -1057,7 +1057,7 @@ discard block |
||
1057 | 1057 | $criteria = []; |
1058 | 1058 | $parameters = []; |
1059 | 1059 | |
1060 | - if (! $association->isOwningSide()) { |
|
1060 | + if ( ! $association->isOwningSide()) { |
|
1061 | 1061 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1062 | 1062 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1063 | 1063 | } |
@@ -1085,7 +1085,7 @@ discard block |
||
1085 | 1085 | $value = $value[$targetClass->identifier[0]]; |
1086 | 1086 | } |
1087 | 1087 | |
1088 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1088 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1089 | 1089 | $parameters[] = [ |
1090 | 1090 | 'value' => $value, |
1091 | 1091 | 'field' => $fieldName, |
@@ -1135,11 +1135,11 @@ discard block |
||
1135 | 1135 | |
1136 | 1136 | switch ($lockMode) { |
1137 | 1137 | case LockMode::PESSIMISTIC_READ: |
1138 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1138 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1139 | 1139 | break; |
1140 | 1140 | |
1141 | 1141 | case LockMode::PESSIMISTIC_WRITE: |
1142 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1142 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1143 | 1143 | break; |
1144 | 1144 | } |
1145 | 1145 | |
@@ -1150,14 +1150,14 @@ discard block |
||
1150 | 1150 | |
1151 | 1151 | if ($filterSql !== '') { |
1152 | 1152 | $conditionSql = $conditionSql |
1153 | - ? $conditionSql . ' AND ' . $filterSql |
|
1153 | + ? $conditionSql.' AND '.$filterSql |
|
1154 | 1154 | : $filterSql; |
1155 | 1155 | } |
1156 | 1156 | |
1157 | - $select = 'SELECT ' . $columnList; |
|
1158 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
1159 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1160 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1157 | + $select = 'SELECT '.$columnList; |
|
1158 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1159 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1160 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1161 | 1161 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1162 | 1162 | $query = $select |
1163 | 1163 | . $lock |
@@ -1165,7 +1165,7 @@ discard block |
||
1165 | 1165 | . $where |
1166 | 1166 | . $orderBySql; |
1167 | 1167 | |
1168 | - return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql; |
|
1168 | + return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql; |
|
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | /** |
@@ -1184,13 +1184,13 @@ discard block |
||
1184 | 1184 | |
1185 | 1185 | if ($filterSql !== '') { |
1186 | 1186 | $conditionSql = $conditionSql |
1187 | - ? $conditionSql . ' AND ' . $filterSql |
|
1187 | + ? $conditionSql.' AND '.$filterSql |
|
1188 | 1188 | : $filterSql; |
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | return 'SELECT COUNT(*) ' |
1192 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1193 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1192 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1193 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1194 | 1194 | } |
1195 | 1195 | |
1196 | 1196 | /** |
@@ -1205,7 +1205,7 @@ discard block |
||
1205 | 1205 | */ |
1206 | 1206 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
1207 | 1207 | { |
1208 | - if (! $orderBy) { |
|
1208 | + if ( ! $orderBy) { |
|
1209 | 1209 | return ''; |
1210 | 1210 | } |
1211 | 1211 | |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | foreach ($orderBy as $fieldName => $orientation) { |
1215 | 1215 | $orientation = strtoupper(trim($orientation)); |
1216 | 1216 | |
1217 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1217 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
1218 | 1218 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
1219 | 1219 | } |
1220 | 1220 | |
@@ -1224,11 +1224,11 @@ discard block |
||
1224 | 1224 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1225 | 1225 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1226 | 1226 | |
1227 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1227 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1228 | 1228 | |
1229 | 1229 | continue; |
1230 | 1230 | } elseif ($property instanceof AssociationMetadata) { |
1231 | - if (! $property->isOwningSide()) { |
|
1231 | + if ( ! $property->isOwningSide()) { |
|
1232 | 1232 | throw InvalidFindByCall::fromInverseSideUsage( |
1233 | 1233 | $this->class->getClassName(), |
1234 | 1234 | $fieldName |
@@ -1244,7 +1244,7 @@ discard block |
||
1244 | 1244 | /** @var JoinColumnMetadata $joinColumn */ |
1245 | 1245 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1246 | 1246 | |
1247 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1247 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1248 | 1248 | } |
1249 | 1249 | |
1250 | 1250 | continue; |
@@ -1253,7 +1253,7 @@ discard block |
||
1253 | 1253 | throw UnrecognizedField::byName($fieldName); |
1254 | 1254 | } |
1255 | 1255 | |
1256 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1256 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1257 | 1257 | } |
1258 | 1258 | |
1259 | 1259 | /** |
@@ -1295,7 +1295,7 @@ discard block |
||
1295 | 1295 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
1296 | 1296 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
1297 | 1297 | |
1298 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1298 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
1299 | 1299 | break; |
1300 | 1300 | } |
1301 | 1301 | |
@@ -1310,7 +1310,7 @@ discard block |
||
1310 | 1310 | break; // now this is why you shouldn't use inheritance |
1311 | 1311 | } |
1312 | 1312 | |
1313 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1313 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1314 | 1314 | |
1315 | 1315 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1316 | 1316 | |
@@ -1338,14 +1338,14 @@ discard block |
||
1338 | 1338 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1339 | 1339 | } |
1340 | 1340 | |
1341 | - if (! $property->isOwningSide()) { |
|
1341 | + if ( ! $property->isOwningSide()) { |
|
1342 | 1342 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1343 | 1343 | } |
1344 | 1344 | |
1345 | 1345 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1346 | 1346 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1347 | 1347 | |
1348 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1348 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1349 | 1349 | |
1350 | 1350 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1351 | 1351 | $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; |
@@ -1391,7 +1391,7 @@ discard block |
||
1391 | 1391 | */ |
1392 | 1392 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1393 | 1393 | { |
1394 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1394 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1395 | 1395 | return ''; |
1396 | 1396 | } |
1397 | 1397 | |
@@ -1406,7 +1406,7 @@ discard block |
||
1406 | 1406 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1407 | 1407 | $resultColumnName = $this->getSQLColumnAlias(); |
1408 | 1408 | |
1409 | - if (! $joinColumn->getType()) { |
|
1409 | + if ( ! $joinColumn->getType()) { |
|
1410 | 1410 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1411 | 1411 | } |
1412 | 1412 | |
@@ -1436,7 +1436,7 @@ discard block |
||
1436 | 1436 | $owningAssociation = $association; |
1437 | 1437 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1438 | 1438 | |
1439 | - if (! $association->isOwningSide()) { |
|
1439 | + if ( ! $association->isOwningSide()) { |
|
1440 | 1440 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1441 | 1441 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1442 | 1442 | } |
@@ -1457,7 +1457,7 @@ discard block |
||
1457 | 1457 | ); |
1458 | 1458 | } |
1459 | 1459 | |
1460 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1460 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1461 | 1461 | } |
1462 | 1462 | |
1463 | 1463 | /** |
@@ -1551,7 +1551,7 @@ discard block |
||
1551 | 1551 | $columnName = $joinColumn->getColumnName(); |
1552 | 1552 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1553 | 1553 | |
1554 | - if (! $joinColumn->getType()) { |
|
1554 | + if ( ! $joinColumn->getType()) { |
|
1555 | 1555 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1556 | 1556 | } |
1557 | 1557 | |
@@ -1590,7 +1590,7 @@ discard block |
||
1590 | 1590 | |
1591 | 1591 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1592 | 1592 | |
1593 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1593 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1594 | 1594 | } |
1595 | 1595 | |
1596 | 1596 | /** |
@@ -1604,14 +1604,14 @@ discard block |
||
1604 | 1604 | protected function getSQLTableAlias($tableName, $assocName = '') |
1605 | 1605 | { |
1606 | 1606 | if ($tableName) { |
1607 | - $tableName .= '#' . $assocName; |
|
1607 | + $tableName .= '#'.$assocName; |
|
1608 | 1608 | } |
1609 | 1609 | |
1610 | 1610 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1611 | 1611 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1612 | 1612 | } |
1613 | 1613 | |
1614 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1614 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1615 | 1615 | |
1616 | 1616 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1617 | 1617 | |
@@ -1637,7 +1637,7 @@ discard block |
||
1637 | 1637 | } |
1638 | 1638 | |
1639 | 1639 | $lock = $this->getLockTablesSql($lockMode); |
1640 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1640 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1641 | 1641 | $sql = 'SELECT 1 ' |
1642 | 1642 | . $lock |
1643 | 1643 | . $where |
@@ -1660,7 +1660,7 @@ discard block |
||
1660 | 1660 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1661 | 1661 | |
1662 | 1662 | return $this->platform->appendLockHint( |
1663 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1663 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1664 | 1664 | $lockMode |
1665 | 1665 | ); |
1666 | 1666 | } |
@@ -1710,19 +1710,19 @@ discard block |
||
1710 | 1710 | |
1711 | 1711 | if ($comparison !== null) { |
1712 | 1712 | // special case null value handling |
1713 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
1714 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1713 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
1714 | + $selectedColumns[] = $column.' IS NULL'; |
|
1715 | 1715 | |
1716 | 1716 | continue; |
1717 | 1717 | } |
1718 | 1718 | |
1719 | 1719 | if ($comparison === Comparison::NEQ && $value === null) { |
1720 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1720 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1721 | 1721 | |
1722 | 1722 | continue; |
1723 | 1723 | } |
1724 | 1724 | |
1725 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1725 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1726 | 1726 | |
1727 | 1727 | continue; |
1728 | 1728 | } |
@@ -1770,7 +1770,7 @@ discard block |
||
1770 | 1770 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1771 | 1771 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1772 | 1772 | |
1773 | - return [$tableAlias . '.' . $columnName]; |
|
1773 | + return [$tableAlias.'.'.$columnName]; |
|
1774 | 1774 | } |
1775 | 1775 | |
1776 | 1776 | if ($property instanceof AssociationMetadata) { |
@@ -1779,7 +1779,7 @@ discard block |
||
1779 | 1779 | |
1780 | 1780 | // Many-To-Many requires join table check for joinColumn |
1781 | 1781 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1782 | - if (! $owningAssociation->isOwningSide()) { |
|
1782 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1783 | 1783 | $owningAssociation = $association; |
1784 | 1784 | } |
1785 | 1785 | |
@@ -1792,10 +1792,10 @@ discard block |
||
1792 | 1792 | foreach ($joinColumns as $joinColumn) { |
1793 | 1793 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1794 | 1794 | |
1795 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1795 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1796 | 1796 | } |
1797 | 1797 | } else { |
1798 | - if (! $owningAssociation->isOwningSide()) { |
|
1798 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1799 | 1799 | throw InvalidFindByCall::fromInverseSideUsage( |
1800 | 1800 | $this->class->getClassName(), |
1801 | 1801 | $field |
@@ -1810,7 +1810,7 @@ discard block |
||
1810 | 1810 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1811 | 1811 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1812 | 1812 | |
1813 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1813 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1814 | 1814 | } |
1815 | 1815 | } |
1816 | 1816 | |
@@ -1919,7 +1919,7 @@ discard block |
||
1919 | 1919 | $value = $value[$targetClass->identifier[0]]; |
1920 | 1920 | } |
1921 | 1921 | |
1922 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
1922 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
1923 | 1923 | $parameters[] = [ |
1924 | 1924 | 'value' => $value, |
1925 | 1925 | 'field' => $fieldName, |
@@ -2004,7 +2004,7 @@ discard block |
||
2004 | 2004 | case $property instanceof AssociationMetadata: |
2005 | 2005 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2006 | 2006 | |
2007 | - if (! $property->isOwningSide()) { |
|
2007 | + if ( ! $property->isOwningSide()) { |
|
2008 | 2008 | $property = $class->getProperty($property->getMappedBy()); |
2009 | 2009 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2010 | 2010 | } |
@@ -2017,7 +2017,7 @@ discard block |
||
2017 | 2017 | /** @var JoinColumnMetadata $joinColumn */ |
2018 | 2018 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2019 | 2019 | |
2020 | - if (! $joinColumn->getType()) { |
|
2020 | + if ( ! $joinColumn->getType()) { |
|
2021 | 2021 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2022 | 2022 | } |
2023 | 2023 | |
@@ -2032,7 +2032,7 @@ discard block |
||
2032 | 2032 | } |
2033 | 2033 | |
2034 | 2034 | if (is_array($value)) { |
2035 | - return array_map(static function ($type) { |
|
2035 | + return array_map(static function($type) { |
|
2036 | 2036 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2037 | 2037 | }, $types); |
2038 | 2038 | } |
@@ -2089,7 +2089,7 @@ discard block |
||
2089 | 2089 | */ |
2090 | 2090 | private function getIndividualValue($value) |
2091 | 2091 | { |
2092 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2092 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
2093 | 2093 | return $value; |
2094 | 2094 | } |
2095 | 2095 | |
@@ -2103,7 +2103,7 @@ discard block |
||
2103 | 2103 | { |
2104 | 2104 | $criteria = $this->getIdentifier($entity); |
2105 | 2105 | |
2106 | - if (! $criteria) { |
|
2106 | + if ( ! $criteria) { |
|
2107 | 2107 | return false; |
2108 | 2108 | } |
2109 | 2109 | |
@@ -2111,12 +2111,12 @@ discard block |
||
2111 | 2111 | |
2112 | 2112 | $sql = 'SELECT 1 ' |
2113 | 2113 | . $this->getLockTablesSql(null) |
2114 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2114 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2115 | 2115 | |
2116 | 2116 | [$params, $types] = $this->expandParameters($criteria); |
2117 | 2117 | |
2118 | 2118 | if ($extraConditions !== null) { |
2119 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2119 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2120 | 2120 | [$criteriaParams, $criteriaTypes] = $this->expandCriteriaParameters($extraConditions); |
2121 | 2121 | |
2122 | 2122 | $params = array_merge($params, $criteriaParams); |
@@ -2126,7 +2126,7 @@ discard block |
||
2126 | 2126 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
2127 | 2127 | |
2128 | 2128 | if ($filterSql) { |
2129 | - $sql .= ' AND ' . $filterSql; |
|
2129 | + $sql .= ' AND '.$filterSql; |
|
2130 | 2130 | } |
2131 | 2131 | |
2132 | 2132 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2139,13 +2139,13 @@ discard block |
||
2139 | 2139 | */ |
2140 | 2140 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2141 | 2141 | { |
2142 | - if (! $association->isOwningSide()) { |
|
2142 | + if ( ! $association->isOwningSide()) { |
|
2143 | 2143 | return 'LEFT JOIN'; |
2144 | 2144 | } |
2145 | 2145 | |
2146 | 2146 | // if one of the join columns is nullable, return left join |
2147 | 2147 | foreach ($association->getJoinColumns() as $joinColumn) { |
2148 | - if (! $joinColumn->isNullable()) { |
|
2148 | + if ( ! $joinColumn->isNullable()) { |
|
2149 | 2149 | continue; |
2150 | 2150 | } |
2151 | 2151 | |
@@ -2162,7 +2162,7 @@ discard block |
||
2162 | 2162 | */ |
2163 | 2163 | public function getSQLColumnAlias() |
2164 | 2164 | { |
2165 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2165 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2166 | 2166 | } |
2167 | 2167 | |
2168 | 2168 | /** |
@@ -2181,13 +2181,13 @@ discard block |
||
2181 | 2181 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
2182 | 2182 | |
2183 | 2183 | if ($filterExpr !== '') { |
2184 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2184 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2185 | 2185 | } |
2186 | 2186 | } |
2187 | 2187 | |
2188 | 2188 | $sql = implode(' AND ', $filterClauses); |
2189 | 2189 | |
2190 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2190 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2191 | 2191 | } |
2192 | 2192 | |
2193 | 2193 | /** |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | // It's a joined result |
86 | 86 | |
87 | 87 | $parent = $this->rsm->parentAliasMap[$dqlAlias]; |
88 | - $path = $parent . '.' . $dqlAlias; |
|
88 | + $path = $parent.'.'.$dqlAlias; |
|
89 | 89 | |
90 | 90 | // missing parent data, skipping as RIGHT JOIN hydration is not supported. |
91 | - if (! isset($nonemptyComponents[$parent])) { |
|
91 | + if ( ! isset($nonemptyComponents[$parent])) { |
|
92 | 92 | continue; |
93 | 93 | } |
94 | 94 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) { |
98 | 98 | $first = reset($this->resultPointers); |
99 | 99 | // TODO: Exception if $key === null ? |
100 | - $baseElement =& $this->resultPointers[$parent][key($first)]; |
|
100 | + $baseElement = & $this->resultPointers[$parent][key($first)]; |
|
101 | 101 | } elseif (isset($this->resultPointers[$parent])) { |
102 | - $baseElement =& $this->resultPointers[$parent]; |
|
102 | + $baseElement = & $this->resultPointers[$parent]; |
|
103 | 103 | } else { |
104 | 104 | unset($this->resultPointers[$dqlAlias]); // Ticket #1228 |
105 | 105 | |
@@ -111,10 +111,10 @@ discard block |
||
111 | 111 | $relation = $parentClass->getProperty($relationAlias); |
112 | 112 | |
113 | 113 | // Check the type of the relation (many or single-valued) |
114 | - if (! $relation instanceof ToOneAssociationMetadata) { |
|
114 | + if ( ! $relation instanceof ToOneAssociationMetadata) { |
|
115 | 115 | $oneToOne = false; |
116 | 116 | |
117 | - if (! isset($baseElement[$relationAlias])) { |
|
117 | + if ( ! isset($baseElement[$relationAlias])) { |
|
118 | 118 | $baseElement[$relationAlias] = []; |
119 | 119 | } |
120 | 120 | |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $index = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false; |
124 | 124 | $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false; |
125 | 125 | |
126 | - if (! $indexExists || ! $indexIsValid) { |
|
126 | + if ( ! $indexExists || ! $indexIsValid) { |
|
127 | 127 | $element = $data; |
128 | 128 | |
129 | 129 | if (isset($this->rsm->indexByMap[$dqlAlias])) { |
@@ -140,16 +140,16 @@ discard block |
||
140 | 140 | } else { |
141 | 141 | $oneToOne = true; |
142 | 142 | |
143 | - if (! isset($nonemptyComponents[$dqlAlias]) && |
|
143 | + if ( ! isset($nonemptyComponents[$dqlAlias]) && |
|
144 | 144 | ( ! isset($baseElement[$relationAlias])) |
145 | 145 | ) { |
146 | 146 | $baseElement[$relationAlias] = null; |
147 | - } elseif (! isset($baseElement[$relationAlias])) { |
|
147 | + } elseif ( ! isset($baseElement[$relationAlias])) { |
|
148 | 148 | $baseElement[$relationAlias] = $data; |
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | - $coll =& $baseElement[$relationAlias]; |
|
152 | + $coll = & $baseElement[$relationAlias]; |
|
153 | 153 | |
154 | 154 | if (is_array($coll)) { |
155 | 155 | $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne); |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0; |
162 | 162 | |
163 | 163 | // if this row has a NULL value for the root result id then make it a null result. |
164 | - if (! isset($nonemptyComponents[$dqlAlias])) { |
|
164 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
165 | 165 | $result[] = $this->rsm->isMixed |
166 | 166 | ? [$entityKey => null] |
167 | 167 | : null; |
@@ -198,13 +198,13 @@ discard block |
||
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
201 | - if (! isset($resultKey)) { |
|
201 | + if ( ! isset($resultKey)) { |
|
202 | 202 | $this->resultCounter++; |
203 | 203 | } |
204 | 204 | |
205 | 205 | // Append scalar values to mixed result sets |
206 | 206 | if (isset($rowData['scalars'])) { |
207 | - if (! isset($resultKey)) { |
|
207 | + if ( ! isset($resultKey)) { |
|
208 | 208 | // this only ever happens when no object is fetched (scalar result only) |
209 | 209 | $resultKey = isset($this->rsm->indexByMap['scalars']) |
210 | 210 | ? $row[$this->rsm->indexByMap['scalars']] |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | // Append new object to mixed result sets |
220 | 220 | if (isset($rowData['newObjects'])) { |
221 | - if (! isset($resultKey)) { |
|
221 | + if ( ! isset($resultKey)) { |
|
222 | 222 | $resultKey = $this->resultCounter - 1; |
223 | 223 | } |
224 | 224 | |
@@ -259,22 +259,22 @@ discard block |
||
259 | 259 | } |
260 | 260 | |
261 | 261 | if ($oneToOne) { |
262 | - $this->resultPointers[$dqlAlias] =& $coll; |
|
262 | + $this->resultPointers[$dqlAlias] = & $coll; |
|
263 | 263 | |
264 | 264 | return; |
265 | 265 | } |
266 | 266 | |
267 | 267 | if ($index !== false) { |
268 | - $this->resultPointers[$dqlAlias] =& $coll[$index]; |
|
268 | + $this->resultPointers[$dqlAlias] = & $coll[$index]; |
|
269 | 269 | |
270 | 270 | return; |
271 | 271 | } |
272 | 272 | |
273 | - if (! $coll) { |
|
273 | + if ( ! $coll) { |
|
274 | 274 | return; |
275 | 275 | } |
276 | 276 | |
277 | 277 | end($coll); |
278 | - $this->resultPointers[$dqlAlias] =& $coll[key($coll)]; |
|
278 | + $this->resultPointers[$dqlAlias] = & $coll[key($coll)]; |
|
279 | 279 | } |
280 | 280 | } |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
274 | 274 | { |
275 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
275 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
276 | 276 | |
277 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
278 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
277 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
278 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | return $this->tableAliasMap[$tableName]; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | */ |
294 | 294 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
295 | 295 | { |
296 | - $tableName .= $dqlAlias ? '@[' . $dqlAlias . ']' : ''; |
|
296 | + $tableName .= $dqlAlias ? '@['.$dqlAlias.']' : ''; |
|
297 | 297 | |
298 | 298 | $this->tableAliasMap[$tableName] = $alias; |
299 | 299 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function getSQLColumnAlias() |
309 | 309 | { |
310 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
310 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -334,14 +334,14 @@ discard block |
||
334 | 334 | |
335 | 335 | // If this is a joined association we must use left joins to preserve the correct result. |
336 | 336 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
337 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
337 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
338 | 338 | |
339 | 339 | $sqlParts = []; |
340 | 340 | |
341 | 341 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
342 | 342 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
343 | 343 | |
344 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
344 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | $filterSql = $this->generateFilterConditionSQL($parentClass, $tableAlias); |
@@ -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 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
508 | 508 | |
509 | 509 | if ($filterExpr !== '') { |
510 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
510 | + $filterClauses[] = '('.$filterExpr.')'; |
|
511 | 511 | } |
512 | 512 | } |
513 | 513 | |
@@ -538,11 +538,11 @@ discard block |
||
538 | 538 | $sql .= $this->walkOrderByClause($AST->orderByClause); |
539 | 539 | } |
540 | 540 | |
541 | - if (! $AST->orderByClause) { |
|
541 | + if ( ! $AST->orderByClause) { |
|
542 | 542 | $orderBySql = $this->generateOrderedCollectionOrderByItems(); |
543 | 543 | |
544 | 544 | if ($orderBySql) { |
545 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
545 | + $sql .= ' ORDER BY '.$orderBySql; |
|
546 | 546 | } |
547 | 547 | } |
548 | 548 | |
@@ -555,11 +555,11 @@ discard block |
||
555 | 555 | } |
556 | 556 | |
557 | 557 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
558 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
558 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
562 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
562 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
563 | 563 | } |
564 | 564 | |
565 | 565 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | } |
568 | 568 | |
569 | 569 | foreach ($this->selectedClasses as $selectedClass) { |
570 | - if (! $selectedClass['class']->isVersioned()) { |
|
570 | + if ( ! $selectedClass['class']->isVersioned()) { |
|
571 | 571 | throw OptimisticLockException::lockFailed($selectedClass['class']->getClassName()); |
572 | 572 | } |
573 | 573 | } |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
617 | 617 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
618 | 618 | |
619 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
619 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
620 | 620 | } |
621 | 621 | |
622 | 622 | return implode(', ', $sqlParts); |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | { |
635 | 635 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
636 | 636 | |
637 | - if (! $fieldName) { |
|
637 | + if ( ! $fieldName) { |
|
638 | 638 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
639 | 639 | } |
640 | 640 | |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | $property = $class->getProperty($fieldName); |
664 | 664 | |
665 | 665 | if ($this->useSqlTableAliases) { |
666 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
666 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
678 | 678 | $association = $class->getProperty($fieldName); |
679 | 679 | |
680 | - if (! $association->isOwningSide()) { |
|
680 | + if ( ! $association->isOwningSide()) { |
|
681 | 681 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
682 | 682 | } |
683 | 683 | |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | $joinColumn = reset($joinColumns); |
692 | 692 | |
693 | 693 | if ($this->useSqlTableAliases) { |
694 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
694 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
695 | 695 | } |
696 | 696 | |
697 | 697 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | */ |
710 | 710 | public function walkSelectClause($selectClause) |
711 | 711 | { |
712 | - $sql = 'SELECT ' . ($selectClause->isDistinct ? 'DISTINCT ' : ''); |
|
712 | + $sql = 'SELECT '.($selectClause->isDistinct ? 'DISTINCT ' : ''); |
|
713 | 713 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
714 | 714 | |
715 | 715 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && $selectClause->isDistinct) { |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | |
753 | 753 | $sqlSelectExpressions[] = sprintf( |
754 | 754 | '%s AS %s', |
755 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
755 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
756 | 756 | $sqlColumnAlias |
757 | 757 | ); |
758 | 758 | |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | |
763 | 763 | // Add foreign key columns of class and also parent classes |
764 | 764 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
765 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
765 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
766 | 766 | || ( ! $addMetaColumns && ! $association->isPrimaryKey())) { |
767 | 767 | continue; |
768 | 768 | } |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | $columnAlias = $this->getSQLColumnAlias(); |
778 | 778 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
779 | 779 | |
780 | - if (! $joinColumn->getType()) { |
|
780 | + if ( ! $joinColumn->getType()) { |
|
781 | 781 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
782 | 782 | } |
783 | 783 | |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | } |
794 | 794 | |
795 | 795 | // Add foreign key columns to SQL, if necessary |
796 | - if (! $addMetaColumns) { |
|
796 | + if ( ! $addMetaColumns) { |
|
797 | 797 | continue; |
798 | 798 | } |
799 | 799 | |
@@ -807,7 +807,7 @@ discard block |
||
807 | 807 | continue; |
808 | 808 | } |
809 | 809 | |
810 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
810 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
811 | 811 | continue; |
812 | 812 | } |
813 | 813 | |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | $columnAlias = $this->getSQLColumnAlias(); |
822 | 822 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
823 | 823 | |
824 | - if (! $joinColumn->getType()) { |
|
824 | + if ( ! $joinColumn->getType()) { |
|
825 | 825 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
826 | 826 | } |
827 | 827 | |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | } |
839 | 839 | } |
840 | 840 | |
841 | - return $sql . implode(', ', $sqlSelectExpressions); |
|
841 | + return $sql.implode(', ', $sqlSelectExpressions); |
|
842 | 842 | } |
843 | 843 | |
844 | 844 | /** |
@@ -853,7 +853,7 @@ discard block |
||
853 | 853 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
854 | 854 | } |
855 | 855 | |
856 | - return ' FROM ' . implode(', ', $sqlParts); |
|
856 | + return ' FROM '.implode(', ', $sqlParts); |
|
857 | 857 | } |
858 | 858 | |
859 | 859 | /** |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
929 | 929 | |
930 | 930 | $sql = $this->platform->appendLockHint( |
931 | - $tableName . ' ' . $tableAlias, |
|
931 | + $tableName.' '.$tableAlias, |
|
932 | 932 | $this->query->getHint(Query::HINT_LOCK_MODE) |
933 | 933 | ); |
934 | 934 | |
@@ -938,11 +938,11 @@ discard block |
||
938 | 938 | |
939 | 939 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
940 | 940 | |
941 | - if (! $buildNestedJoins) { |
|
942 | - return $sql . $classTableInheritanceJoins; |
|
941 | + if ( ! $buildNestedJoins) { |
|
942 | + return $sql.$classTableInheritanceJoins; |
|
943 | 943 | } |
944 | 944 | |
945 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
945 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
946 | 946 | } |
947 | 947 | |
948 | 948 | /** |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | : $association; |
979 | 979 | |
980 | 980 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && |
981 | - (! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
981 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
982 | 982 | if ($association instanceof ToManyAssociationMetadata) { |
983 | 983 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
984 | 984 | } |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | $targetTableJoin = [ |
1035 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1035 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1036 | 1036 | 'condition' => implode(' AND ', $conditions), |
1037 | 1037 | ]; |
1038 | 1038 | } elseif ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1059,7 +1059,7 @@ discard block |
||
1059 | 1059 | ); |
1060 | 1060 | } |
1061 | 1061 | |
1062 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1062 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1063 | 1063 | |
1064 | 1064 | // Join target table |
1065 | 1065 | $sql .= $joinType === AST\Join::JOIN_TYPE_LEFT || $joinType === AST\Join::JOIN_TYPE_LEFTOUTER ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1097,7 +1097,7 @@ discard block |
||
1097 | 1097 | } |
1098 | 1098 | |
1099 | 1099 | $targetTableJoin = [ |
1100 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1100 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1101 | 1101 | 'condition' => implode(' AND ', $conditions), |
1102 | 1102 | ]; |
1103 | 1103 | } else { |
@@ -1105,23 +1105,23 @@ discard block |
||
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | // Handle WITH clause |
1108 | - $withCondition = $condExpr === null ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1108 | + $withCondition = $condExpr === null ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1109 | 1109 | |
1110 | 1110 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
1111 | 1111 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1112 | 1112 | |
1113 | 1113 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1114 | 1114 | if ($withCondition) { |
1115 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1115 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1116 | 1116 | } else { |
1117 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1117 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1118 | 1118 | } |
1119 | 1119 | } else { |
1120 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1120 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1121 | 1121 | } |
1122 | 1122 | |
1123 | 1123 | if ($withCondition) { |
1124 | - $sql .= ' AND ' . $withCondition; |
|
1124 | + $sql .= ' AND '.$withCondition; |
|
1125 | 1125 | } |
1126 | 1126 | |
1127 | 1127 | // Apply the indexes |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1156 | 1156 | } |
1157 | 1157 | |
1158 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1158 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1159 | 1159 | } |
1160 | 1160 | |
1161 | 1161 | /** |
@@ -1172,10 +1172,10 @@ discard block |
||
1172 | 1172 | $this->orderedColumnsMap[$sql] = $type; |
1173 | 1173 | |
1174 | 1174 | if ($expr instanceof AST\Subselect) { |
1175 | - return '(' . $sql . ') ' . $type; |
|
1175 | + return '('.$sql.') '.$type; |
|
1176 | 1176 | } |
1177 | 1177 | |
1178 | - return $sql . ' ' . $type; |
|
1178 | + return $sql.' '.$type; |
|
1179 | 1179 | } |
1180 | 1180 | |
1181 | 1181 | /** |
@@ -1183,7 +1183,7 @@ discard block |
||
1183 | 1183 | */ |
1184 | 1184 | public function walkHavingClause($havingClause) |
1185 | 1185 | { |
1186 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1186 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1187 | 1187 | } |
1188 | 1188 | |
1189 | 1189 | /** |
@@ -1206,7 +1206,7 @@ discard block |
||
1206 | 1206 | $conditions = []; |
1207 | 1207 | |
1208 | 1208 | if ($join->conditionalExpression) { |
1209 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1209 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1210 | 1210 | } |
1211 | 1211 | |
1212 | 1212 | $isUnconditionalJoin = empty($conditions); |
@@ -1231,7 +1231,7 @@ discard block |
||
1231 | 1231 | } |
1232 | 1232 | |
1233 | 1233 | if ($conditions) { |
1234 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1234 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1235 | 1235 | } |
1236 | 1236 | |
1237 | 1237 | break; |
@@ -1261,7 +1261,7 @@ discard block |
||
1261 | 1261 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1262 | 1262 | } |
1263 | 1263 | |
1264 | - return $sql . implode(', ', $scalarExpressions) . ')'; |
|
1264 | + return $sql.implode(', ', $scalarExpressions).')'; |
|
1265 | 1265 | } |
1266 | 1266 | |
1267 | 1267 | /** |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1282 | 1282 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1283 | 1283 | |
1284 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1284 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1285 | 1285 | } |
1286 | 1286 | |
1287 | 1287 | /** |
@@ -1294,11 +1294,11 @@ discard block |
||
1294 | 1294 | $sql = 'CASE'; |
1295 | 1295 | |
1296 | 1296 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1297 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1298 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1297 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1298 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1299 | 1299 | } |
1300 | 1300 | |
1301 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1301 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1302 | 1302 | |
1303 | 1303 | return $sql; |
1304 | 1304 | } |
@@ -1312,14 +1312,14 @@ discard block |
||
1312 | 1312 | */ |
1313 | 1313 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1314 | 1314 | { |
1315 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1315 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1316 | 1316 | |
1317 | 1317 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1318 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1319 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1318 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1319 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1320 | 1320 | } |
1321 | 1321 | |
1322 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1322 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1323 | 1323 | |
1324 | 1324 | return $sql; |
1325 | 1325 | } |
@@ -1360,7 +1360,7 @@ discard block |
||
1360 | 1360 | |
1361 | 1361 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1362 | 1362 | |
1363 | - if (! $hidden) { |
|
1363 | + if ( ! $hidden) { |
|
1364 | 1364 | $this->rsm->addScalarResult($columnAlias, $resultAlias, $property->getType()); |
1365 | 1365 | $this->scalarFields[$dqlAlias][$fieldName] = $columnAlias; |
1366 | 1366 | } |
@@ -1381,11 +1381,11 @@ discard block |
||
1381 | 1381 | $columnAlias = $this->getSQLColumnAlias(); |
1382 | 1382 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1383 | 1383 | |
1384 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1384 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1385 | 1385 | |
1386 | 1386 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1387 | 1387 | |
1388 | - if (! $hidden) { |
|
1388 | + if ( ! $hidden) { |
|
1389 | 1389 | // Conceptually we could resolve field type here by traverse through AST to retrieve field type, |
1390 | 1390 | // but this is not a feasible solution; assume 'string'. |
1391 | 1391 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
@@ -1396,11 +1396,11 @@ discard block |
||
1396 | 1396 | $columnAlias = $this->getSQLColumnAlias(); |
1397 | 1397 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1398 | 1398 | |
1399 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1399 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1400 | 1400 | |
1401 | 1401 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1402 | 1402 | |
1403 | - if (! $hidden) { |
|
1403 | + if ( ! $hidden) { |
|
1404 | 1404 | // We cannot resolve field type here; assume 'string'. |
1405 | 1405 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
1406 | 1406 | } |
@@ -1424,7 +1424,7 @@ discard block |
||
1424 | 1424 | $class = $queryComp['metadata']; |
1425 | 1425 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: null; |
1426 | 1426 | |
1427 | - if (! isset($this->selectedClasses[$dqlAlias])) { |
|
1427 | + if ( ! isset($this->selectedClasses[$dqlAlias])) { |
|
1428 | 1428 | $this->selectedClasses[$dqlAlias] = [ |
1429 | 1429 | 'class' => $class, |
1430 | 1430 | 'dqlAlias' => $dqlAlias, |
@@ -1436,7 +1436,7 @@ discard block |
||
1436 | 1436 | |
1437 | 1437 | // Select all fields from the queried class |
1438 | 1438 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1439 | - if (! ($property instanceof FieldMetadata)) { |
|
1439 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1440 | 1440 | continue; |
1441 | 1441 | } |
1442 | 1442 | |
@@ -1471,7 +1471,7 @@ discard block |
||
1471 | 1471 | $subClass = $this->em->getClassMetadata($subClassName); |
1472 | 1472 | |
1473 | 1473 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1474 | - if (! ($property instanceof FieldMetadata)) { |
|
1474 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1475 | 1475 | continue; |
1476 | 1476 | } |
1477 | 1477 | |
@@ -1510,7 +1510,7 @@ discard block |
||
1510 | 1510 | */ |
1511 | 1511 | public function walkQuantifiedExpression($qExpr) |
1512 | 1512 | { |
1513 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1513 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1514 | 1514 | } |
1515 | 1515 | |
1516 | 1516 | /** |
@@ -1550,7 +1550,7 @@ discard block |
||
1550 | 1550 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1551 | 1551 | } |
1552 | 1552 | |
1553 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1553 | + return ' FROM '.implode(', ', $sqlParts); |
|
1554 | 1554 | } |
1555 | 1555 | |
1556 | 1556 | /** |
@@ -1558,7 +1558,7 @@ discard block |
||
1558 | 1558 | */ |
1559 | 1559 | public function walkSimpleSelectClause($simpleSelectClause) |
1560 | 1560 | { |
1561 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1561 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1562 | 1562 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1563 | 1563 | } |
1564 | 1564 | |
@@ -1592,7 +1592,7 @@ discard block |
||
1592 | 1592 | break; |
1593 | 1593 | |
1594 | 1594 | case $e instanceof AST\Subselect: |
1595 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1595 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1596 | 1596 | break; |
1597 | 1597 | |
1598 | 1598 | case $e instanceof AST\PathExpression: |
@@ -1601,7 +1601,7 @@ discard block |
||
1601 | 1601 | $class = $qComp['metadata']; |
1602 | 1602 | $fieldType = $class->getProperty($e->field)->getType(); |
1603 | 1603 | |
1604 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1604 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1605 | 1605 | break; |
1606 | 1606 | |
1607 | 1607 | case $e instanceof AST\Literal: |
@@ -1615,11 +1615,11 @@ discard block |
||
1615 | 1615 | break; |
1616 | 1616 | } |
1617 | 1617 | |
1618 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1618 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1619 | 1619 | break; |
1620 | 1620 | |
1621 | 1621 | default: |
1622 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1622 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1623 | 1623 | break; |
1624 | 1624 | } |
1625 | 1625 | |
@@ -1652,10 +1652,10 @@ discard block |
||
1652 | 1652 | case $expr instanceof AST\Subselect: |
1653 | 1653 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1654 | 1654 | |
1655 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1655 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1656 | 1656 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1657 | 1657 | |
1658 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1658 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1659 | 1659 | break; |
1660 | 1660 | |
1661 | 1661 | case $expr instanceof AST\Functions\FunctionNode: |
@@ -1672,7 +1672,7 @@ discard block |
||
1672 | 1672 | $columnAlias = $this->getSQLColumnAlias(); |
1673 | 1673 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1674 | 1674 | |
1675 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1675 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1676 | 1676 | break; |
1677 | 1677 | |
1678 | 1678 | case $expr instanceof AST\ParenthesisExpression: |
@@ -1692,8 +1692,8 @@ discard block |
||
1692 | 1692 | */ |
1693 | 1693 | public function walkAggregateExpression($aggExpression) |
1694 | 1694 | { |
1695 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1696 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1695 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1696 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1697 | 1697 | } |
1698 | 1698 | |
1699 | 1699 | /** |
@@ -1707,7 +1707,7 @@ discard block |
||
1707 | 1707 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1708 | 1708 | } |
1709 | 1709 | |
1710 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1710 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1711 | 1711 | } |
1712 | 1712 | |
1713 | 1713 | /** |
@@ -1716,7 +1716,7 @@ discard block |
||
1716 | 1716 | public function walkGroupByItem($groupByItem) |
1717 | 1717 | { |
1718 | 1718 | // StateFieldPathExpression |
1719 | - if (! is_string($groupByItem)) { |
|
1719 | + if ( ! is_string($groupByItem)) { |
|
1720 | 1720 | return $this->walkPathExpression($groupByItem); |
1721 | 1721 | } |
1722 | 1722 | |
@@ -1770,7 +1770,7 @@ discard block |
||
1770 | 1770 | { |
1771 | 1771 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1772 | 1772 | $tableName = $class->getTableName(); |
1773 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1773 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
1774 | 1774 | |
1775 | 1775 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1776 | 1776 | |
@@ -1786,12 +1786,12 @@ discard block |
||
1786 | 1786 | { |
1787 | 1787 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1788 | 1788 | $tableName = $class->getTableName(); |
1789 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1789 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
1790 | 1790 | |
1791 | 1791 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1792 | 1792 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1793 | 1793 | |
1794 | - return $sql . ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1794 | + return $sql.' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1795 | 1795 | } |
1796 | 1796 | |
1797 | 1797 | /** |
@@ -1802,7 +1802,7 @@ discard block |
||
1802 | 1802 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1803 | 1803 | $this->useSqlTableAliases = false; |
1804 | 1804 | |
1805 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1805 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1806 | 1806 | $newValue = $updateItem->newValue; |
1807 | 1807 | |
1808 | 1808 | switch (true) { |
@@ -1846,7 +1846,7 @@ discard block |
||
1846 | 1846 | |
1847 | 1847 | if ($filterClauses) { |
1848 | 1848 | if ($condSql) { |
1849 | - $condSql = '(' . $condSql . ') AND '; |
|
1849 | + $condSql = '('.$condSql.') AND '; |
|
1850 | 1850 | } |
1851 | 1851 | |
1852 | 1852 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1854,11 +1854,11 @@ discard block |
||
1854 | 1854 | } |
1855 | 1855 | |
1856 | 1856 | if ($condSql) { |
1857 | - return ' WHERE ' . (! $discrSql ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1857 | + return ' WHERE '.( ! $discrSql ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1858 | 1858 | } |
1859 | 1859 | |
1860 | 1860 | if ($discrSql) { |
1861 | - return ' WHERE ' . $discrSql; |
|
1861 | + return ' WHERE '.$discrSql; |
|
1862 | 1862 | } |
1863 | 1863 | |
1864 | 1864 | return ''; |
@@ -1871,7 +1871,7 @@ discard block |
||
1871 | 1871 | { |
1872 | 1872 | // Phase 2 AST optimization: Skip processing of ConditionalExpression |
1873 | 1873 | // if only one ConditionalTerm is defined |
1874 | - if (! ($condExpr instanceof AST\ConditionalExpression)) { |
|
1874 | + if ( ! ($condExpr instanceof AST\ConditionalExpression)) { |
|
1875 | 1875 | return $this->walkConditionalTerm($condExpr); |
1876 | 1876 | } |
1877 | 1877 | |
@@ -1885,7 +1885,7 @@ discard block |
||
1885 | 1885 | { |
1886 | 1886 | // Phase 2 AST optimization: Skip processing of ConditionalTerm |
1887 | 1887 | // if only one ConditionalFactor is defined |
1888 | - if (! ($condTerm instanceof AST\ConditionalTerm)) { |
|
1888 | + if ( ! ($condTerm instanceof AST\ConditionalTerm)) { |
|
1889 | 1889 | return $this->walkConditionalFactor($condTerm); |
1890 | 1890 | } |
1891 | 1891 | |
@@ -1901,7 +1901,7 @@ discard block |
||
1901 | 1901 | // if only one ConditionalPrimary is defined |
1902 | 1902 | return ! ($factor instanceof AST\ConditionalFactor) |
1903 | 1903 | ? $this->walkConditionalPrimary($factor) |
1904 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1904 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1905 | 1905 | } |
1906 | 1906 | |
1907 | 1907 | /** |
@@ -1916,7 +1916,7 @@ discard block |
||
1916 | 1916 | if ($primary->isConditionalExpression()) { |
1917 | 1917 | $condExpr = $primary->conditionalExpression; |
1918 | 1918 | |
1919 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1919 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1920 | 1920 | } |
1921 | 1921 | } |
1922 | 1922 | |
@@ -1927,7 +1927,7 @@ discard block |
||
1927 | 1927 | { |
1928 | 1928 | $sql = $existsExpr->not ? 'NOT ' : ''; |
1929 | 1929 | |
1930 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1930 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1931 | 1931 | |
1932 | 1932 | return $sql; |
1933 | 1933 | } |
@@ -1975,7 +1975,7 @@ discard block |
||
1975 | 1975 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1976 | 1976 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1977 | 1977 | |
1978 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
1978 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
1979 | 1979 | |
1980 | 1980 | $sqlParts = []; |
1981 | 1981 | |
@@ -1996,7 +1996,7 @@ discard block |
||
1996 | 1996 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1997 | 1997 | } |
1998 | 1998 | |
1999 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
1999 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2000 | 2000 | } |
2001 | 2001 | |
2002 | 2002 | $sql .= implode(' AND ', $sqlParts); |
@@ -2010,7 +2010,7 @@ discard block |
||
2010 | 2010 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
2011 | 2011 | |
2012 | 2012 | // join to target table |
2013 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
2013 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
2014 | 2014 | |
2015 | 2015 | // join conditions |
2016 | 2016 | $joinSqlParts = []; |
@@ -2059,13 +2059,13 @@ discard block |
||
2059 | 2059 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2060 | 2060 | } |
2061 | 2061 | |
2062 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2062 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2063 | 2063 | } |
2064 | 2064 | |
2065 | 2065 | $sql .= implode(' AND ', $sqlParts); |
2066 | 2066 | } |
2067 | 2067 | |
2068 | - return $sql . ')'; |
|
2068 | + return $sql.')'; |
|
2069 | 2069 | } |
2070 | 2070 | |
2071 | 2071 | /** |
@@ -2076,7 +2076,7 @@ discard block |
||
2076 | 2076 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2077 | 2077 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2078 | 2078 | |
2079 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2079 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2080 | 2080 | } |
2081 | 2081 | |
2082 | 2082 | /** |
@@ -2085,19 +2085,19 @@ discard block |
||
2085 | 2085 | public function walkNullComparisonExpression($nullCompExpr) |
2086 | 2086 | { |
2087 | 2087 | $expression = $nullCompExpr->expression; |
2088 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2088 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2089 | 2089 | |
2090 | 2090 | // Handle ResultVariable |
2091 | 2091 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2092 | - return $this->walkResultVariable($expression) . $comparison; |
|
2092 | + return $this->walkResultVariable($expression).$comparison; |
|
2093 | 2093 | } |
2094 | 2094 | |
2095 | 2095 | // Handle InputParameter mapping inclusion to ParserResult |
2096 | 2096 | if ($expression instanceof AST\InputParameter) { |
2097 | - return $this->walkInputParameter($expression) . $comparison; |
|
2097 | + return $this->walkInputParameter($expression).$comparison; |
|
2098 | 2098 | } |
2099 | 2099 | |
2100 | - return $expression->dispatch($this) . $comparison; |
|
2100 | + return $expression->dispatch($this).$comparison; |
|
2101 | 2101 | } |
2102 | 2102 | |
2103 | 2103 | /** |
@@ -2105,7 +2105,7 @@ discard block |
||
2105 | 2105 | */ |
2106 | 2106 | public function walkInExpression($inExpr) |
2107 | 2107 | { |
2108 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2108 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2109 | 2109 | |
2110 | 2110 | $sql .= $inExpr->subselect |
2111 | 2111 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2130,12 +2130,12 @@ discard block |
||
2130 | 2130 | $discrColumnType = $discrColumn->getType(); |
2131 | 2131 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
2132 | 2132 | $sqlTableAlias = $this->useSqlTableAliases |
2133 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
2133 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
2134 | 2134 | : ''; |
2135 | 2135 | |
2136 | 2136 | return sprintf( |
2137 | 2137 | '%s %sIN %s', |
2138 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
2138 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
2139 | 2139 | ($instanceOfExpr->not ? 'NOT ' : ''), |
2140 | 2140 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
2141 | 2141 | ); |
@@ -2182,8 +2182,8 @@ discard block |
||
2182 | 2182 | $sql .= ' NOT'; |
2183 | 2183 | } |
2184 | 2184 | |
2185 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2186 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2185 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2186 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2187 | 2187 | |
2188 | 2188 | return $sql; |
2189 | 2189 | } |
@@ -2198,7 +2198,7 @@ discard block |
||
2198 | 2198 | ? $this->walkResultVariable($stringExpr) |
2199 | 2199 | : $stringExpr->dispatch($this); |
2200 | 2200 | |
2201 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2201 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2202 | 2202 | |
2203 | 2203 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2204 | 2204 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2211,7 +2211,7 @@ discard block |
||
2211 | 2211 | } |
2212 | 2212 | |
2213 | 2213 | if ($likeExpr->escapeChar) { |
2214 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2214 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2215 | 2215 | } |
2216 | 2216 | |
2217 | 2217 | return $sql; |
@@ -2238,7 +2238,7 @@ discard block |
||
2238 | 2238 | ? $leftExpr->dispatch($this) |
2239 | 2239 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2240 | 2240 | |
2241 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2241 | + $sql .= ' '.$compExpr->operator.' '; |
|
2242 | 2242 | |
2243 | 2243 | $sql .= $rightExpr instanceof AST\Node |
2244 | 2244 | ? $rightExpr->dispatch($this) |
@@ -2274,7 +2274,7 @@ discard block |
||
2274 | 2274 | { |
2275 | 2275 | return $arithmeticExpr->isSimpleArithmeticExpression() |
2276 | 2276 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2277 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2277 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2278 | 2278 | } |
2279 | 2279 | |
2280 | 2280 | /** |
@@ -2282,7 +2282,7 @@ discard block |
||
2282 | 2282 | */ |
2283 | 2283 | public function walkSimpleArithmeticExpression($simpleArithmeticExpr) |
2284 | 2284 | { |
2285 | - if (! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2285 | + if ( ! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
2286 | 2286 | return $this->walkArithmeticTerm($simpleArithmeticExpr); |
2287 | 2287 | } |
2288 | 2288 | |
@@ -2302,7 +2302,7 @@ discard block |
||
2302 | 2302 | |
2303 | 2303 | // Phase 2 AST optimization: Skip processing of ArithmeticTerm |
2304 | 2304 | // if only one ArithmeticFactor is defined |
2305 | - if (! ($term instanceof AST\ArithmeticTerm)) { |
|
2305 | + if ( ! ($term instanceof AST\ArithmeticTerm)) { |
|
2306 | 2306 | return $this->walkArithmeticFactor($term); |
2307 | 2307 | } |
2308 | 2308 | |
@@ -2322,13 +2322,13 @@ discard block |
||
2322 | 2322 | |
2323 | 2323 | // Phase 2 AST optimization: Skip processing of ArithmeticFactor |
2324 | 2324 | // if only one ArithmeticPrimary is defined |
2325 | - if (! ($factor instanceof AST\ArithmeticFactor)) { |
|
2325 | + if ( ! ($factor instanceof AST\ArithmeticFactor)) { |
|
2326 | 2326 | return $this->walkArithmeticPrimary($factor); |
2327 | 2327 | } |
2328 | 2328 | |
2329 | 2329 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2330 | 2330 | |
2331 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2331 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2332 | 2332 | } |
2333 | 2333 | |
2334 | 2334 | /** |
@@ -2341,7 +2341,7 @@ discard block |
||
2341 | 2341 | public function walkArithmeticPrimary($primary) |
2342 | 2342 | { |
2343 | 2343 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2344 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2344 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2345 | 2345 | } |
2346 | 2346 | |
2347 | 2347 | if ($primary instanceof AST\Node) { |
@@ -2399,7 +2399,7 @@ discard block |
||
2399 | 2399 | $entityClassName = $entityClass->getClassName(); |
2400 | 2400 | |
2401 | 2401 | if ($entityClassName !== $rootClass->getClassName()) { |
2402 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2402 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2403 | 2403 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
2404 | 2404 | } |
2405 | 2405 | } |
@@ -2411,6 +2411,6 @@ discard block |
||
2411 | 2411 | $sqlParameterList[] = $this->conn->quote($discriminator); |
2412 | 2412 | } |
2413 | 2413 | |
2414 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
2414 | + return '('.implode(', ', $sqlParameterList).')'; |
|
2415 | 2415 | } |
2416 | 2416 | } |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $conn = static::$sharedConn; |
347 | 347 | |
348 | 348 | // In case test is skipped, tearDown is called, but no setup may have run |
349 | - if (! $conn) { |
|
349 | + if ( ! $conn) { |
|
350 | 350 | return; |
351 | 351 | } |
352 | 352 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | if (isset($this->usedModelSets['directorytree'])) { |
423 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('file')); |
|
423 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('file')); |
|
424 | 424 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
425 | 425 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
426 | 426 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -513,12 +513,12 @@ discard block |
||
513 | 513 | ) |
514 | 514 | ); |
515 | 515 | |
516 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
517 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-group')); |
|
518 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-phone')); |
|
519 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-user')); |
|
520 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-address')); |
|
521 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
516 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
517 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-group')); |
|
518 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-phone')); |
|
519 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-user')); |
|
520 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-address')); |
|
521 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $classes = []; |
631 | 631 | |
632 | 632 | foreach ($classNames as $className) { |
633 | - if (! isset(static::$entityTablesCreated[$className])) { |
|
633 | + if ( ! isset(static::$entityTablesCreated[$className])) { |
|
634 | 634 | static::$entityTablesCreated[$className] = true; |
635 | 635 | $classes[] = $this->em->getClassMetadata($className); |
636 | 636 | } |
@@ -649,25 +649,25 @@ discard block |
||
649 | 649 | { |
650 | 650 | $this->setUpDBALTypes(); |
651 | 651 | |
652 | - if (! isset(static::$sharedConn)) { |
|
652 | + if ( ! isset(static::$sharedConn)) { |
|
653 | 653 | static::$sharedConn = TestUtil::getConnection(); |
654 | 654 | } |
655 | 655 | |
656 | 656 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
657 | 657 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ['mysql', 'postgresql'], true)) { |
658 | - static::$sharedConn->executeQuery('SELECT 1 /*' . static::class . '*/'); |
|
658 | + static::$sharedConn->executeQuery('SELECT 1 /*'.static::class.'*/'); |
|
659 | 659 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === 'oracle') { |
660 | - static::$sharedConn->executeQuery('SELECT 1 /*' . static::class . '*/ FROM dual'); |
|
660 | + static::$sharedConn->executeQuery('SELECT 1 /*'.static::class.'*/ FROM dual'); |
|
661 | 661 | } |
662 | 662 | } |
663 | 663 | |
664 | - if (! $this->em) { |
|
664 | + if ( ! $this->em) { |
|
665 | 665 | $this->em = $this->getEntityManager(); |
666 | 666 | $this->schemaTool = new SchemaTool($this->em); |
667 | 667 | } |
668 | 668 | |
669 | 669 | foreach ($this->usedModelSets as $setName => $bool) { |
670 | - if (! isset(static::$tablesCreated[$setName])) { |
|
670 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
671 | 671 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
672 | 672 | |
673 | 673 | static::$tablesCreated[$setName] = true; |
@@ -742,8 +742,8 @@ discard block |
||
742 | 742 | |
743 | 743 | $config->setMetadataDriverImpl( |
744 | 744 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
745 | - realpath(__DIR__ . '/Models/Cache'), |
|
746 | - realpath(__DIR__ . '/Models/GeoNames'), |
|
745 | + realpath(__DIR__.'/Models/Cache'), |
|
746 | + realpath(__DIR__.'/Models/GeoNames'), |
|
747 | 747 | ]) |
748 | 748 | ); |
749 | 749 | |
@@ -791,13 +791,13 @@ discard block |
||
791 | 791 | |
792 | 792 | foreach ($last25queries as $i => $query) { |
793 | 793 | $params = array_map( |
794 | - static function ($p) { |
|
794 | + static function($p) { |
|
795 | 795 | return is_object($p) ? get_class($p) : var_export($p, true); |
796 | 796 | }, |
797 | 797 | $query['params'] ?: [] |
798 | 798 | ); |
799 | 799 | |
800 | - $queries .= $i . ". SQL: '" . $query['sql'] . "' Params: " . implode(', ', $params) . PHP_EOL; |
|
800 | + $queries .= $i.". SQL: '".$query['sql']."' Params: ".implode(', ', $params).PHP_EOL; |
|
801 | 801 | } |
802 | 802 | |
803 | 803 | $trace = $e->getTrace(); |
@@ -810,11 +810,11 @@ discard block |
||
810 | 810 | break; |
811 | 811 | } |
812 | 812 | |
813 | - $traceMsg .= $part['file'] . ':' . $part['line'] . PHP_EOL; |
|
813 | + $traceMsg .= $part['file'].':'.$part['line'].PHP_EOL; |
|
814 | 814 | } |
815 | 815 | } |
816 | 816 | |
817 | - $message = '[' . get_class($e) . '] ' . $e->getMessage() . PHP_EOL . PHP_EOL . 'With queries:' . PHP_EOL . $queries . PHP_EOL . 'Trace:' . PHP_EOL . $traceMsg; |
|
817 | + $message = '['.get_class($e).'] '.$e->getMessage().PHP_EOL.PHP_EOL.'With queries:'.PHP_EOL.$queries.PHP_EOL.'Trace:'.PHP_EOL.$traceMsg; |
|
818 | 818 | |
819 | 819 | throw new Exception($message, (int) $e->getCode(), $e); |
820 | 820 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | */ |
24 | 24 | public static function pathRequired() |
25 | 25 | { |
26 | - return new self('Specifying the paths to your entities is required ' . |
|
26 | + return new self('Specifying the paths to your entities is required '. |
|
27 | 27 | 'in the AnnotationDriver to retrieve all class names.'); |
28 | 28 | } |
29 | 29 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public static function missingQueryMapping($entity, $queryName) |
215 | 215 | { |
216 | - return new self('Query named "' . $queryName . '" in "' . $entity . ' requires a result class or result set mapping.'); |
|
216 | + return new self('Query named "'.$queryName.'" in "'.$entity.' requires a result class or result set mapping.'); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public static function missingResultSetMappingEntity($entity, $resultName) |
226 | 226 | { |
227 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a entity class name.'); |
|
227 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a entity class name.'); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public static function missingResultSetMappingFieldName($entity, $resultName) |
237 | 237 | { |
238 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . ' requires a field name.'); |
|
238 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.' requires a field name.'); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | { |
283 | 283 | $message = sprintf("The mapping of field '%s' is invalid: The option '%s' is required.", $field, $expectedOption); |
284 | 284 | |
285 | - if (! empty($hint)) { |
|
286 | - $message .= ' (Hint: ' . $hint . ')'; |
|
285 | + if ( ! empty($hint)) { |
|
286 | + $message .= ' (Hint: '.$hint.')'; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | return new self($message); |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | public static function reflectionFailure($entity, ReflectionException $previousException) |
314 | 314 | { |
315 | - return new self('An error occurred in ' . $entity, 0, $previousException); |
|
315 | + return new self('An error occurred in '.$entity, 0, $previousException); |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | /** |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | */ |
324 | 324 | public static function joinColumnMustPointToMappedField($className, $joinColumn) |
325 | 325 | { |
326 | - return new self('The column ' . $joinColumn . ' must be mapped to a field in class ' |
|
327 | - . $className . ' since it is referenced by a join column of another class.'); |
|
326 | + return new self('The column '.$joinColumn.' must be mapped to a field in class ' |
|
327 | + . $className.' since it is referenced by a join column of another class.'); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public static function propertyTypeIsRequired($className, $propertyName) |
360 | 360 | { |
361 | - return new self("The attribute 'type' is required for the column description of property " . $className . '::$' . $propertyName . '.'); |
|
361 | + return new self("The attribute 'type' is required for the column description of property ".$className.'::$'.$propertyName.'.'); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | /** |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | */ |
369 | 369 | public static function tableIdGeneratorNotImplemented($className) |
370 | 370 | { |
371 | - return new self('TableIdGenerator is not yet implemented for use with class ' . $className); |
|
371 | + return new self('TableIdGenerator is not yet implemented for use with class '.$className); |
|
372 | 372 | } |
373 | 373 | |
374 | 374 | /** |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | */ |
395 | 395 | public static function duplicateQueryMapping($entity, $queryName) |
396 | 396 | { |
397 | - return new self('Query named "' . $queryName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
397 | + return new self('Query named "'.$queryName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
398 | 398 | } |
399 | 399 | |
400 | 400 | /** |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | */ |
406 | 406 | public static function duplicateResultSetMapping($entity, $resultName) |
407 | 407 | { |
408 | - return new self('Result set mapping named "' . $resultName . '" in "' . $entity . '" was already declared, but it must be declared only once'); |
|
408 | + return new self('Result set mapping named "'.$resultName.'" in "'.$entity.'" was already declared, but it must be declared only once'); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | */ |
416 | 416 | public static function singleIdNotAllowedOnCompositePrimaryKey($entity) |
417 | 417 | { |
418 | - return new self('Single id is not allowed on composite primary key in entity ' . $entity); |
|
418 | + return new self('Single id is not allowed on composite primary key in entity '.$entity); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | /** |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | */ |
426 | 426 | public static function noIdDefined($entity) |
427 | 427 | { |
428 | - return new self('No ID defined for entity ' . $entity); |
|
428 | + return new self('No ID defined for entity '.$entity); |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | /** |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | */ |
436 | 436 | public static function unsupportedOptimisticLockingType($unsupportedType) |
437 | 437 | { |
438 | - return new self('Locking type "' . $unsupportedType->getName() . '" is not supported by Doctrine.'); |
|
438 | + return new self('Locking type "'.$unsupportedType->getName().'" is not supported by Doctrine.'); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | /** |
@@ -445,13 +445,13 @@ discard block |
||
445 | 445 | */ |
446 | 446 | public static function fileMappingDriversRequireConfiguredDirectoryPath($path = null) |
447 | 447 | { |
448 | - if (! empty($path)) { |
|
449 | - $path = '[' . $path . ']'; |
|
448 | + if ( ! empty($path)) { |
|
449 | + $path = '['.$path.']'; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | return new self( |
453 | - 'File mapping drivers must have a valid directory path, ' . |
|
454 | - 'however the given path ' . $path . ' seems to be incorrect!' |
|
453 | + 'File mapping drivers must have a valid directory path, '. |
|
454 | + 'however the given path '.$path.' seems to be incorrect!' |
|
455 | 455 | ); |
456 | 456 | } |
457 | 457 | |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | public static function invalidClassInDiscriminatorMap($className, $owningClass) |
468 | 468 | { |
469 | 469 | return new self(sprintf( |
470 | - "Entity class '%s' used in the discriminator map of class '%s' " . |
|
470 | + "Entity class '%s' used in the discriminator map of class '%s' ". |
|
471 | 471 | 'does not exist.', |
472 | 472 | $className, |
473 | 473 | $owningClass |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | public static function sqlConversionNotAllowedForPrimaryKeyProperties($className, Property $property) |
534 | 534 | { |
535 | 535 | return new self(sprintf( |
536 | - 'It is not possible to set id field "%s" to type "%s" in entity class "%s". ' . |
|
536 | + 'It is not possible to set id field "%s" to type "%s" in entity class "%s". '. |
|
537 | 537 | 'The type "%s" requires conversion SQL which is not allowed for identifiers.', |
538 | 538 | $property->getName(), |
539 | 539 | $property->getTypeName(), |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | */ |
570 | 570 | public static function duplicateColumnName($className, $columnName) |
571 | 571 | { |
572 | - return new self("Duplicate definition of column '" . $columnName . "' on entity '" . $className . "' in a field or discriminator column mapping."); |
|
572 | + return new self("Duplicate definition of column '".$columnName."' on entity '".$className."' in a field or discriminator column mapping."); |
|
573 | 573 | } |
574 | 574 | |
575 | 575 | /** |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | */ |
581 | 581 | public static function illegalToManyAssociationOnMappedSuperclass($className, $field) |
582 | 582 | { |
583 | - return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '" . $className . '#' . $field . "'."); |
|
583 | + return new self("It is illegal to put an inverse side one-to-many or many-to-many association on mapped superclass '".$className.'#'.$field."'."); |
|
584 | 584 | } |
585 | 585 | |
586 | 586 | /** |
@@ -592,8 +592,8 @@ discard block |
||
592 | 592 | */ |
593 | 593 | public static function cannotMapCompositePrimaryKeyEntitiesAsForeignId($className, $targetEntity, $targetField) |
594 | 594 | { |
595 | - return new self("It is not possible to map entity '" . $className . "' with a composite primary key " . |
|
596 | - "as part of the primary key of another entity '" . $targetEntity . '#' . $targetField . "'."); |
|
595 | + return new self("It is not possible to map entity '".$className."' with a composite primary key ". |
|
596 | + "as part of the primary key of another entity '".$targetEntity.'#'.$targetField."'."); |
|
597 | 597 | } |
598 | 598 | |
599 | 599 | /** |
@@ -647,8 +647,8 @@ discard block |
||
647 | 647 | */ |
648 | 648 | public static function illegalOrphanRemoval($className, $field) |
649 | 649 | { |
650 | - return new self('Orphan removal is only allowed on one-to-one and one-to-many ' . |
|
651 | - 'associations, but ' . $className . '#' . $field . ' is not.'); |
|
650 | + return new self('Orphan removal is only allowed on one-to-one and one-to-many '. |
|
651 | + 'associations, but '.$className.'#'.$field.' is not.'); |
|
652 | 652 | } |
653 | 653 | |
654 | 654 | /** |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | */ |
681 | 681 | public static function noInheritanceOnMappedSuperClass($className) |
682 | 682 | { |
683 | - return new self("It is not supported to define inheritance information on a mapped superclass '" . $className . "'."); |
|
683 | + return new self("It is not supported to define inheritance information on a mapped superclass '".$className."'."); |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | /** |
@@ -692,8 +692,8 @@ discard block |
||
692 | 692 | public static function mappedClassNotPartOfDiscriminatorMap($className, $rootClassName) |
693 | 693 | { |
694 | 694 | return new self( |
695 | - "Entity '" . $className . "' has to be part of the discriminator map of '" . $rootClassName . "' " . |
|
696 | - "to be properly mapped in the inheritance hierarchy. Alternatively you can make '" . $className . "' an abstract class " . |
|
695 | + "Entity '".$className."' has to be part of the discriminator map of '".$rootClassName."' ". |
|
696 | + "to be properly mapped in the inheritance hierarchy. Alternatively you can make '".$className."' an abstract class ". |
|
697 | 697 | 'to avoid this exception from occurring.' |
698 | 698 | ); |
699 | 699 | } |
@@ -706,7 +706,7 @@ discard block |
||
706 | 706 | */ |
707 | 707 | public static function lifecycleCallbackMethodNotFound($className, $methodName) |
708 | 708 | { |
709 | - return new self("Entity '" . $className . "' has no method '" . $methodName . "' to be registered as lifecycle callback."); |
|
709 | + return new self("Entity '".$className."' has no method '".$methodName."' to be registered as lifecycle callback."); |
|
710 | 710 | } |
711 | 711 | |
712 | 712 | /** |
@@ -752,7 +752,7 @@ discard block |
||
752 | 752 | */ |
753 | 753 | public static function invalidFetchMode($className, $annotation) |
754 | 754 | { |
755 | - return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'"); |
|
755 | + return new self("Entity '".$className."' has a mapping with invalid fetch mode '".$annotation."'"); |
|
756 | 756 | } |
757 | 757 | |
758 | 758 | /** |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | */ |
763 | 763 | public static function compositeKeyAssignedIdGeneratorRequired($className) |
764 | 764 | { |
765 | - return new self("Entity '" . $className . "' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
765 | + return new self("Entity '".$className."' has a composite identifier but uses an ID generator other than manually assigning (Identity, Sequence). This is not supported."); |
|
766 | 766 | } |
767 | 767 | |
768 | 768 | /** |
@@ -774,7 +774,7 @@ discard block |
||
774 | 774 | */ |
775 | 775 | public static function invalidTargetEntityClass($targetEntity, $sourceEntity, $associationName) |
776 | 776 | { |
777 | - return new self("The target-entity '" . $targetEntity . "' cannot be found in '" . $sourceEntity . '#' . $associationName . "'."); |
|
777 | + return new self("The target-entity '".$targetEntity."' cannot be found in '".$sourceEntity.'#'.$associationName."'."); |
|
778 | 778 | } |
779 | 779 | |
780 | 780 | /** |
@@ -786,8 +786,8 @@ discard block |
||
786 | 786 | */ |
787 | 787 | public static function invalidCascadeOption(array $cascades, $className, $propertyName) |
788 | 788 | { |
789 | - $cascades = implode(', ', array_map(static function ($e) { |
|
790 | - return "'" . $e . "'"; |
|
789 | + $cascades = implode(', ', array_map(static function($e) { |
|
790 | + return "'".$e."'"; |
|
791 | 791 | }, $cascades)); |
792 | 792 | |
793 | 793 | return new self(sprintf( |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | { |
821 | 821 | return new self( |
822 | 822 | sprintf( |
823 | - 'Infinite nesting detected for embedded property %s::%s. ' . |
|
823 | + 'Infinite nesting detected for embedded property %s::%s. '. |
|
824 | 824 | 'You cannot embed an embeddable from the same type inside an embeddable.', |
825 | 825 | $className, |
826 | 826 | $propertyName |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | { |
836 | 836 | return new self( |
837 | 837 | sprintf( |
838 | - 'Class %s not found in namespaces %s.' . |
|
838 | + 'Class %s not found in namespaces %s.'. |
|
839 | 839 | $className, |
840 | 840 | implode(', ', $namespaces) |
841 | 841 | ) |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | |
111 | 111 | foreach ($data as $columnName => $value) { |
112 | - if (! is_array($id) || ! isset($id[$columnName])) { |
|
112 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
113 | 113 | $type = $this->columns[$columnName]->getType(); |
114 | 114 | |
115 | 115 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $updateData = $this->prepareUpdateData($entity); |
135 | 135 | |
136 | - if (! $updateData) { |
|
136 | + if ( ! $updateData) { |
|
137 | 137 | return; |
138 | 138 | } |
139 | 139 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $versionedClass = $this->class->versionProperty->getDeclaringClass(); |
152 | 152 | $versionedTable = $versionedClass->getTableName(); |
153 | 153 | |
154 | - if (! isset($updateData[$versionedTable])) { |
|
154 | + if ( ! isset($updateData[$versionedTable])) { |
|
155 | 155 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
156 | 156 | |
157 | 157 | $this->updateTable($entity, $tableName, [], true); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | if ($filterSql) { |
234 | 234 | $conditionSql .= $conditionSql |
235 | - ? ' AND ' . $filterSql |
|
235 | + ? ' AND '.$filterSql |
|
236 | 236 | : $filterSql; |
237 | 237 | } |
238 | 238 | |
@@ -240,26 +240,26 @@ discard block |
||
240 | 240 | |
241 | 241 | switch ($lockMode) { |
242 | 242 | case LockMode::PESSIMISTIC_READ: |
243 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
243 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
244 | 244 | break; |
245 | 245 | |
246 | 246 | case LockMode::PESSIMISTIC_WRITE: |
247 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
247 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
248 | 248 | break; |
249 | 249 | } |
250 | 250 | |
251 | 251 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
252 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
253 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
252 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
253 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
254 | 254 | $lock = $this->platform->appendLockHint($from, $lockMode); |
255 | 255 | $columnList = $this->getSelectColumnsSQL(); |
256 | - $query = 'SELECT ' . $columnList |
|
256 | + $query = 'SELECT '.$columnList |
|
257 | 257 | . $lock |
258 | 258 | . $joinSql |
259 | 259 | . $where |
260 | 260 | . $orderBySql; |
261 | 261 | |
262 | - return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0) . $lockSql; |
|
262 | + return $this->platform->modifyLimitQuery($query, $limit, $offset ?? 0).$lockSql; |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
@@ -281,14 +281,14 @@ discard block |
||
281 | 281 | |
282 | 282 | if ($filterSql !== '') { |
283 | 283 | $conditionSql = $conditionSql |
284 | - ? $conditionSql . ' AND ' . $filterSql |
|
284 | + ? $conditionSql.' AND '.$filterSql |
|
285 | 285 | : $filterSql; |
286 | 286 | } |
287 | 287 | |
288 | 288 | return 'SELECT COUNT(*) ' |
289 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
289 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
290 | 290 | . $joinSql |
291 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
291 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -307,18 +307,18 @@ discard block |
||
307 | 307 | $conditions = []; |
308 | 308 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
309 | 309 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
310 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
310 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
311 | 311 | |
312 | 312 | foreach ($identifierColumns as $idColumn) { |
313 | 313 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
314 | 314 | |
315 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
315 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | $joinSql .= implode(' AND ', $conditions); |
319 | 319 | } |
320 | 320 | |
321 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
321 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | continue; |
346 | 346 | } |
347 | 347 | |
348 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
348 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
349 | 349 | continue; |
350 | 350 | } |
351 | 351 | |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | /** @var JoinColumnMetadata $joinColumn */ |
356 | 356 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
357 | 357 | |
358 | - if (! $joinColumn->getType()) { |
|
358 | + if ( ! $joinColumn->getType()) { |
|
359 | 359 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
360 | 360 | } |
361 | 361 | |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
375 | 375 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
376 | 376 | |
377 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias . '.' . $quotedColumnName, $this->platform); |
|
377 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($discrTableAlias.'.'.$quotedColumnName, $this->platform); |
|
378 | 378 | |
379 | 379 | // sub tables |
380 | 380 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | /** @var JoinColumnMetadata $joinColumn */ |
399 | 399 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
400 | 400 | |
401 | - if (! $joinColumn->getType()) { |
|
401 | + if ( ! $joinColumn->getType()) { |
|
402 | 402 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
403 | 403 | } |
404 | 404 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | $columnName = $joinColumn->getColumnName(); |
449 | 449 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
450 | 450 | |
451 | - if (! $joinColumn->getType()) { |
|
451 | + if ( ! $joinColumn->getType()) { |
|
452 | 452 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
453 | 453 | } |
454 | 454 | |
@@ -504,12 +504,12 @@ discard block |
||
504 | 504 | $conditions = []; |
505 | 505 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
506 | 506 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
507 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
507 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
508 | 508 | |
509 | 509 | foreach ($identifierColumns as $idColumn) { |
510 | 510 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
511 | 511 | |
512 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
512 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | $joinSql .= implode(' AND ', $conditions); |
@@ -521,12 +521,12 @@ discard block |
||
521 | 521 | $subClass = $this->em->getClassMetadata($subClassName); |
522 | 522 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
523 | 523 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
524 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
524 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
525 | 525 | |
526 | 526 | foreach ($identifierColumns as $idColumn) { |
527 | 527 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
528 | 528 | |
529 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
529 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | $joinSql .= implode(' AND ', $conditions); |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | |
341 | 341 | $this->computeChangeSets(); |
342 | 342 | |
343 | - if (! ($this->entityInsertions || |
|
343 | + if ( ! ($this->entityInsertions || |
|
344 | 344 | $this->entityDeletions || |
345 | 345 | $this->entityUpdates || |
346 | 346 | $this->collectionUpdates || |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | // Entity deletions come last and need to be in reverse commit order |
400 | 400 | if ($this->entityDeletions) { |
401 | 401 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
402 | - if (! $this->entityDeletions) { |
|
402 | + if ( ! $this->entityDeletions) { |
|
403 | 403 | break; // just a performance optimisation |
404 | 404 | } |
405 | 405 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | $oid = spl_object_id($entity); |
480 | 480 | $data = []; |
481 | 481 | |
482 | - if (! isset($this->entityChangeSets[$oid])) { |
|
482 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
483 | 483 | return $data; |
484 | 484 | } |
485 | 485 | |
@@ -559,12 +559,12 @@ discard block |
||
559 | 559 | || ! $class->getProperty($name) instanceof FieldMetadata |
560 | 560 | || ! $class->getProperty($name)->hasValueGenerator() |
561 | 561 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
562 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
562 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
563 | 563 | $actualData[$name] = $value; |
564 | 564 | } |
565 | 565 | } |
566 | 566 | |
567 | - if (! isset($this->originalEntityData[$oid])) { |
|
567 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
568 | 568 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
569 | 569 | // These result in an INSERT. |
570 | 570 | $this->originalEntityData[$oid] = $actualData; |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | |
592 | 592 | foreach ($actualData as $propName => $actualValue) { |
593 | 593 | // skip field, its a partially omitted one! |
594 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
594 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
595 | 595 | continue; |
596 | 596 | } |
597 | 597 | |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | if ($owner === null) { // cloned |
614 | 614 | $actualValue->setOwner($entity, $property); |
615 | 615 | } elseif ($owner !== $entity) { // no clone, we have to fix |
616 | - if (! $actualValue->isInitialized()) { |
|
616 | + if ( ! $actualValue->isInitialized()) { |
|
617 | 617 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
618 | 618 | } |
619 | 619 | |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | // Check if original value exists |
652 | 652 | if ($orgValue instanceof PersistentCollection) { |
653 | 653 | // A PersistentCollection was de-referenced, so delete it. |
654 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
654 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
655 | 655 | $this->scheduleCollectionDeletion($orgValue); |
656 | 656 | |
657 | 657 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | |
675 | 675 | // Look for changes in associations of the entity |
676 | 676 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
677 | - if (! $property instanceof AssociationMetadata) { |
|
677 | + if ( ! $property instanceof AssociationMetadata) { |
|
678 | 678 | continue; |
679 | 679 | } |
680 | 680 | |
@@ -741,7 +741,7 @@ discard block |
||
741 | 741 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
742 | 742 | $oid = spl_object_id($entity); |
743 | 743 | |
744 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
744 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
745 | 745 | $this->computeChangeSet($class, $entity); |
746 | 746 | } |
747 | 747 | } |
@@ -778,13 +778,13 @@ discard block |
||
778 | 778 | $targetClass = $this->em->getClassMetadata($targetEntity); |
779 | 779 | |
780 | 780 | foreach ($unwrappedValue as $key => $entry) { |
781 | - if (! ($entry instanceof $targetEntity)) { |
|
781 | + if ( ! ($entry instanceof $targetEntity)) { |
|
782 | 782 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
783 | 783 | } |
784 | 784 | |
785 | 785 | $state = $this->getEntityState($entry, self::STATE_NEW); |
786 | 786 | |
787 | - if (! ($entry instanceof $targetEntity)) { |
|
787 | + if ( ! ($entry instanceof $targetEntity)) { |
|
788 | 788 | throw UnexpectedAssociationValue::create( |
789 | 789 | $association->getSourceEntity(), |
790 | 790 | $association->getName(), |
@@ -795,7 +795,7 @@ discard block |
||
795 | 795 | |
796 | 796 | switch ($state) { |
797 | 797 | case self::STATE_NEW: |
798 | - if (! in_array('persist', $association->getCascade(), true)) { |
|
798 | + if ( ! in_array('persist', $association->getCascade(), true)) { |
|
799 | 799 | $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry]; |
800 | 800 | |
801 | 801 | break; |
@@ -844,7 +844,7 @@ discard block |
||
844 | 844 | $persister = $this->getEntityPersister($class->getClassName()); |
845 | 845 | $generationPlan->executeImmediate($this->em, $entity); |
846 | 846 | |
847 | - if (! $generationPlan->containsDeferred()) { |
|
847 | + if ( ! $generationPlan->containsDeferred()) { |
|
848 | 848 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
849 | 849 | $this->entityIdentifiers[$oid] = $id; |
850 | 850 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | { |
876 | 876 | $oid = spl_object_id($entity); |
877 | 877 | |
878 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
878 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
879 | 879 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
880 | 880 | } |
881 | 881 | |
@@ -897,7 +897,7 @@ discard block |
||
897 | 897 | break; |
898 | 898 | |
899 | 899 | case $property instanceof FieldMetadata: |
900 | - if (! $property->isPrimaryKey() |
|
900 | + if ( ! $property->isPrimaryKey() |
|
901 | 901 | || ! $property->getValueGenerator() |
902 | 902 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
903 | 903 | $actualData[$name] = $property->getValue($entity); |
@@ -911,7 +911,7 @@ discard block |
||
911 | 911 | } |
912 | 912 | } |
913 | 913 | |
914 | - if (! isset($this->originalEntityData[$oid])) { |
|
914 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
915 | 915 | throw new RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
916 | 916 | } |
917 | 917 | |
@@ -929,7 +929,7 @@ discard block |
||
929 | 929 | if ($changeSet) { |
930 | 930 | if (isset($this->entityChangeSets[$oid])) { |
931 | 931 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
932 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
932 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
933 | 933 | $this->entityChangeSets[$oid] = $changeSet; |
934 | 934 | $this->entityUpdates[$oid] = $entity; |
935 | 935 | } |
@@ -999,7 +999,7 @@ discard block |
||
999 | 999 | $this->recomputeSingleEntityChangeSet($class, $entity); |
1000 | 1000 | } |
1001 | 1001 | |
1002 | - if (! empty($this->entityChangeSets[$oid])) { |
|
1002 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
1003 | 1003 | $persister->update($entity); |
1004 | 1004 | } |
1005 | 1005 | |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | |
1039 | 1039 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
1040 | 1040 | // is obtained by a new entity because the old one went out of scope. |
1041 | - if (! $class->isIdentifierComposite()) { |
|
1041 | + if ( ! $class->isIdentifierComposite()) { |
|
1042 | 1042 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
1043 | 1043 | |
1044 | 1044 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1085,13 +1085,13 @@ discard block |
||
1085 | 1085 | // Calculate dependencies for new nodes |
1086 | 1086 | while ($class = array_pop($newNodes)) { |
1087 | 1087 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
1088 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1088 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
1089 | 1089 | continue; |
1090 | 1090 | } |
1091 | 1091 | |
1092 | 1092 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
1093 | 1093 | |
1094 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
1094 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
1095 | 1095 | $calc->addNode($targetClass->getClassName(), $targetClass); |
1096 | 1096 | |
1097 | 1097 | $newNodes[] = $targetClass; |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | |
1100 | 1100 | $weight = ! array_filter( |
1101 | 1101 | $property->getJoinColumns(), |
1102 | - static function (JoinColumnMetadata $joinColumn) { |
|
1102 | + static function(JoinColumnMetadata $joinColumn) { |
|
1103 | 1103 | return $joinColumn->isNullable(); |
1104 | 1104 | } |
1105 | 1105 | ); |
@@ -1107,14 +1107,14 @@ discard block |
||
1107 | 1107 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
1108 | 1108 | |
1109 | 1109 | // If the target class has mapped subclasses, these share the same dependency. |
1110 | - if (! $targetClass->getSubClasses()) { |
|
1110 | + if ( ! $targetClass->getSubClasses()) { |
|
1111 | 1111 | continue; |
1112 | 1112 | } |
1113 | 1113 | |
1114 | 1114 | foreach ($targetClass->getSubClasses() as $subClassName) { |
1115 | 1115 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
1116 | 1116 | |
1117 | - if (! $calc->hasNode($subClassName)) { |
|
1117 | + if ( ! $calc->hasNode($subClassName)) { |
|
1118 | 1118 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
1119 | 1119 | |
1120 | 1120 | $newNodes[] = $targetSubClass; |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | { |
1191 | 1191 | $oid = spl_object_id($entity); |
1192 | 1192 | |
1193 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
1193 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
1194 | 1194 | throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update'); |
1195 | 1195 | } |
1196 | 1196 | |
@@ -1198,7 +1198,7 @@ discard block |
||
1198 | 1198 | throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update'); |
1199 | 1199 | } |
1200 | 1200 | |
1201 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
1201 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
1202 | 1202 | $this->entityUpdates[$oid] = $entity; |
1203 | 1203 | } |
1204 | 1204 | } |
@@ -1273,7 +1273,7 @@ discard block |
||
1273 | 1273 | return; // entity has not been persisted yet, so nothing more to do. |
1274 | 1274 | } |
1275 | 1275 | |
1276 | - if (! $this->isInIdentityMap($entity)) { |
|
1276 | + if ( ! $this->isInIdentityMap($entity)) { |
|
1277 | 1277 | return; |
1278 | 1278 | } |
1279 | 1279 | |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | |
1282 | 1282 | unset($this->entityUpdates[$oid]); |
1283 | 1283 | |
1284 | - if (! isset($this->entityDeletions[$oid])) { |
|
1284 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
1285 | 1285 | $this->entityDeletions[$oid] = $entity; |
1286 | 1286 | $this->entityStates[$oid] = self::STATE_REMOVED; |
1287 | 1287 | } |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | $persister = $this->getEntityPersister($class->getClassName()); |
1384 | 1384 | $id = $persister->getIdentifier($entity); |
1385 | 1385 | |
1386 | - if (! $id) { |
|
1386 | + if ( ! $id) { |
|
1387 | 1387 | return self::STATE_NEW; |
1388 | 1388 | } |
1389 | 1389 | |
@@ -1741,7 +1741,7 @@ discard block |
||
1741 | 1741 | $class = $this->em->getClassMetadata(get_class($entity)); |
1742 | 1742 | |
1743 | 1743 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1744 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
1744 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
1745 | 1745 | continue; |
1746 | 1746 | } |
1747 | 1747 | |
@@ -1788,7 +1788,7 @@ discard block |
||
1788 | 1788 | } |
1789 | 1789 | |
1790 | 1790 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1791 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
1791 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
1792 | 1792 | continue; |
1793 | 1793 | } |
1794 | 1794 | |
@@ -1804,7 +1804,7 @@ discard block |
||
1804 | 1804 | |
1805 | 1805 | case $relatedEntities instanceof Collection: |
1806 | 1806 | case is_array($relatedEntities): |
1807 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
1807 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
1808 | 1808 | throw ORMInvalidArgumentException::invalidAssociation( |
1809 | 1809 | $this->em->getClassMetadata($targetEntity), |
1810 | 1810 | $association, |
@@ -1819,7 +1819,7 @@ discard block |
||
1819 | 1819 | break; |
1820 | 1820 | |
1821 | 1821 | case $relatedEntities !== null: |
1822 | - if (! $relatedEntities instanceof $targetEntity) { |
|
1822 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
1823 | 1823 | throw ORMInvalidArgumentException::invalidAssociation( |
1824 | 1824 | $this->em->getClassMetadata($targetEntity), |
1825 | 1825 | $association, |
@@ -1848,7 +1848,7 @@ discard block |
||
1848 | 1848 | $class = $this->em->getClassMetadata(get_class($entity)); |
1849 | 1849 | |
1850 | 1850 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
1851 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
1851 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
1852 | 1852 | continue; |
1853 | 1853 | } |
1854 | 1854 | |
@@ -1907,7 +1907,7 @@ discard block |
||
1907 | 1907 | |
1908 | 1908 | switch (true) { |
1909 | 1909 | case $lockMode === LockMode::OPTIMISTIC: |
1910 | - if (! $class->isVersioned()) { |
|
1910 | + if ( ! $class->isVersioned()) { |
|
1911 | 1911 | throw OptimisticLockException::notVersioned($class->getClassName()); |
1912 | 1912 | } |
1913 | 1913 | |
@@ -1930,7 +1930,7 @@ discard block |
||
1930 | 1930 | case $lockMode === LockMode::NONE: |
1931 | 1931 | case $lockMode === LockMode::PESSIMISTIC_READ: |
1932 | 1932 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
1933 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
1933 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
1934 | 1934 | throw TransactionRequiredException::transactionRequired(); |
1935 | 1935 | } |
1936 | 1936 | |
@@ -2088,7 +2088,7 @@ discard block |
||
2088 | 2088 | $entity->addPropertyChangedListener($this); |
2089 | 2089 | } |
2090 | 2090 | } else { |
2091 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
2091 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
2092 | 2092 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
2093 | 2093 | return $entity; |
2094 | 2094 | } |
@@ -2136,7 +2136,7 @@ discard block |
||
2136 | 2136 | } |
2137 | 2137 | |
2138 | 2138 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
2139 | - if (! ($association instanceof AssociationMetadata)) { |
|
2139 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
2140 | 2140 | continue; |
2141 | 2141 | } |
2142 | 2142 | |
@@ -2185,7 +2185,7 @@ discard block |
||
2185 | 2185 | continue; |
2186 | 2186 | } |
2187 | 2187 | |
2188 | - if (! $association->isOwningSide()) { |
|
2188 | + if ( ! $association->isOwningSide()) { |
|
2189 | 2189 | // use the given entity association |
2190 | 2190 | if (isset($data[$field]) && is_object($data[$field]) && |
2191 | 2191 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2235,7 +2235,7 @@ discard block |
||
2235 | 2235 | $associatedId[$targetField] = $joinColumnValue; |
2236 | 2236 | } |
2237 | 2237 | |
2238 | - if (! $associatedId) { |
|
2238 | + if ( ! $associatedId) { |
|
2239 | 2239 | // Foreign key is NULL |
2240 | 2240 | $association->setValue($entity, null); |
2241 | 2241 | $this->originalEntityData[$oid][$field] = null; |
@@ -2244,7 +2244,7 @@ discard block |
||
2244 | 2244 | } |
2245 | 2245 | |
2246 | 2246 | // @todo guilhermeblanco Can we remove the need of this somehow? |
2247 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2247 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
2248 | 2248 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
2249 | 2249 | } |
2250 | 2250 | |
@@ -2261,7 +2261,7 @@ discard block |
||
2261 | 2261 | // If this is an uninitialized proxy, we are deferring eager loads, |
2262 | 2262 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
2263 | 2263 | // then we can append this entity for eager loading! |
2264 | - if (! $targetClass->isIdentifierComposite() && |
|
2264 | + if ( ! $targetClass->isIdentifierComposite() && |
|
2265 | 2265 | $newValue instanceof GhostObjectInterface && |
2266 | 2266 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2267 | 2267 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2344,7 +2344,7 @@ discard block |
||
2344 | 2344 | |
2345 | 2345 | public function triggerEagerLoads() |
2346 | 2346 | { |
2347 | - if (! $this->eagerLoadingEntities) { |
|
2347 | + if ( ! $this->eagerLoadingEntities) { |
|
2348 | 2348 | return; |
2349 | 2349 | } |
2350 | 2350 | |
@@ -2353,7 +2353,7 @@ discard block |
||
2353 | 2353 | $this->eagerLoadingEntities = []; |
2354 | 2354 | |
2355 | 2355 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
2356 | - if (! $ids) { |
|
2356 | + if ( ! $ids) { |
|
2357 | 2357 | continue; |
2358 | 2358 | } |
2359 | 2359 | |
@@ -2651,7 +2651,7 @@ discard block |
||
2651 | 2651 | { |
2652 | 2652 | $class = $this->em->getClassMetadata(get_class($entity)); |
2653 | 2653 | |
2654 | - if (! $class->getProperty($propertyName)) { |
|
2654 | + if ( ! $class->getProperty($propertyName)) { |
|
2655 | 2655 | return; // ignore non-persistent fields |
2656 | 2656 | } |
2657 | 2657 | |
@@ -2660,7 +2660,7 @@ discard block |
||
2660 | 2660 | // Update changeset and mark entity for synchronization |
2661 | 2661 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
2662 | 2662 | |
2663 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
2663 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
2664 | 2664 | $this->scheduleForSynchronization($entity); |
2665 | 2665 | } |
2666 | 2666 | } |
@@ -2742,7 +2742,7 @@ discard block |
||
2742 | 2742 | */ |
2743 | 2743 | private static function objToStr($obj) |
2744 | 2744 | { |
2745 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
2745 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
2746 | 2746 | } |
2747 | 2747 | |
2748 | 2748 | /** |
@@ -2757,7 +2757,7 @@ discard block |
||
2757 | 2757 | */ |
2758 | 2758 | public function markReadOnly($object) |
2759 | 2759 | { |
2760 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
2760 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
2761 | 2761 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
2762 | 2762 | } |
2763 | 2763 | |
@@ -2775,7 +2775,7 @@ discard block |
||
2775 | 2775 | */ |
2776 | 2776 | public function isReadOnly($object) |
2777 | 2777 | { |
2778 | - if (! is_object($object)) { |
|
2778 | + if ( ! is_object($object)) { |
|
2779 | 2779 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
2780 | 2780 | } |
2781 | 2781 | |
@@ -2787,7 +2787,7 @@ discard block |
||
2787 | 2787 | */ |
2788 | 2788 | private function afterTransactionComplete() |
2789 | 2789 | { |
2790 | - $this->performCallbackOnCachedPersister(static function (CachedPersister $persister) { |
|
2790 | + $this->performCallbackOnCachedPersister(static function(CachedPersister $persister) { |
|
2791 | 2791 | $persister->afterTransactionComplete(); |
2792 | 2792 | }); |
2793 | 2793 | } |
@@ -2797,7 +2797,7 @@ discard block |
||
2797 | 2797 | */ |
2798 | 2798 | private function afterTransactionRolledBack() |
2799 | 2799 | { |
2800 | - $this->performCallbackOnCachedPersister(static function (CachedPersister $persister) { |
|
2800 | + $this->performCallbackOnCachedPersister(static function(CachedPersister $persister) { |
|
2801 | 2801 | $persister->afterTransactionRolledBack(); |
2802 | 2802 | }); |
2803 | 2803 | } |
@@ -2807,7 +2807,7 @@ discard block |
||
2807 | 2807 | */ |
2808 | 2808 | private function performCallbackOnCachedPersister(callable $callback) |
2809 | 2809 | { |
2810 | - if (! $this->hasCache) { |
|
2810 | + if ( ! $this->hasCache) { |
|
2811 | 2811 | return; |
2812 | 2812 | } |
2813 | 2813 |
@@ -33,13 +33,13 @@ |
||
33 | 33 | protected function configure() |
34 | 34 | { |
35 | 35 | $this->setName('orm:run-dql') |
36 | - ->setDescription('Executes arbitrary DQL directly from the command line') |
|
37 | - ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
38 | - ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
39 | - ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
40 | - ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
41 | - ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
42 | - ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
36 | + ->setDescription('Executes arbitrary DQL directly from the command line') |
|
37 | + ->addArgument('dql', InputArgument::REQUIRED, 'The DQL to execute.') |
|
38 | + ->addOption('hydrate', null, InputOption::VALUE_REQUIRED, 'Hydration mode of result set. Should be either: object, array, scalar or single-scalar.', 'object') |
|
39 | + ->addOption('first-result', null, InputOption::VALUE_REQUIRED, 'The first result in the result set.') |
|
40 | + ->addOption('max-result', null, InputOption::VALUE_REQUIRED, 'The maximum number of results in the result set.') |
|
41 | + ->addOption('show-sql', null, InputOption::VALUE_NONE, 'Dump generated SQL instead of executing query') |
|
42 | + ->setHelp('Executes arbitrary DQL directly from the command line.'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | $hydrationModeName = $input->getOption('hydrate'); |
61 | - $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_' . strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
61 | + $hydrationMode = 'Doctrine\ORM\Query::HYDRATE_'.strtoupper(str_replace('-', '_', $hydrationModeName)); |
|
62 | 62 | |
63 | - if (! defined($hydrationMode)) { |
|
63 | + if ( ! defined($hydrationMode)) { |
|
64 | 64 | throw new RuntimeException(sprintf( |
65 | 65 | "Hydration mode '%s' does not exist. It should be either: object. array, scalar or single-scalar.", |
66 | 66 | $hydrationModeName |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $firstResult = $input->getOption('first-result'); |
72 | 72 | |
73 | 73 | if ($firstResult !== null) { |
74 | - if (! is_numeric($firstResult)) { |
|
74 | + if ( ! is_numeric($firstResult)) { |
|
75 | 75 | throw new LogicException("Option 'first-result' must contain an integer value"); |
76 | 76 | } |
77 | 77 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $maxResult = $input->getOption('max-result'); |
82 | 82 | |
83 | 83 | if ($maxResult !== null) { |
84 | - if (! is_numeric($maxResult)) { |
|
84 | + if ( ! is_numeric($maxResult)) { |
|
85 | 85 | throw new LogicException("Option 'max-result' must contain an integer value"); |
86 | 86 | } |
87 | 87 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $resultSet = $query->execute([], constant($hydrationMode)); |
97 | 97 | |
98 | - $dumper = new CliDumper(static function (string $payload) use ($output) : void { |
|
98 | + $dumper = new CliDumper(static function(string $payload) use ($output) : void { |
|
99 | 99 | $output->write($payload); |
100 | 100 | }); |
101 | 101 | $dumper->dump((new VarCloner())->cloneVar($resultSet)); |