@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Query; |
| 6 | 6 | |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
| 274 | 274 | { |
| 275 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
| 275 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
| 276 | 276 | |
| 277 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
| 278 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
| 277 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
| 278 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | return $this->tableAliasMap[$tableName]; |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | */ |
| 294 | 294 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
| 295 | 295 | { |
| 296 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
| 296 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
| 297 | 297 | |
| 298 | 298 | $this->tableAliasMap[$tableName] = $alias; |
| 299 | 299 | |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | */ |
| 308 | 308 | public function getSQLColumnAlias() |
| 309 | 309 | { |
| 310 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
| 310 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | /** |
@@ -334,14 +334,14 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | // If this is a joined association we must use left joins to preserve the correct result. |
| 336 | 336 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
| 337 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 337 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 338 | 338 | |
| 339 | 339 | $sqlParts = []; |
| 340 | 340 | |
| 341 | 341 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 342 | 342 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 343 | 343 | |
| 344 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 344 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 345 | 345 | } |
| 346 | 346 | |
| 347 | 347 | // Add filters on the root class |
@@ -363,14 +363,14 @@ discard block |
||
| 363 | 363 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 364 | 364 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
| 365 | 365 | |
| 366 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 366 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 367 | 367 | |
| 368 | 368 | $sqlParts = []; |
| 369 | 369 | |
| 370 | 370 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
| 371 | 371 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 372 | 372 | |
| 373 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 373 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | $sql .= implode(' AND ', $sqlParts); |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | $qComp = $this->queryComponents[$dqlAlias]; |
| 392 | 392 | $association = $qComp['relation']; |
| 393 | 393 | |
| 394 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 394 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 395 | 395 | continue; |
| 396 | 396 | } |
| 397 | 397 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | $property = $qComp['metadata']->getProperty($fieldName); |
| 400 | 400 | $tableName = $property->getTableName(); |
| 401 | 401 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 402 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
| 402 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
| 403 | 403 | |
| 404 | 404 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
| 405 | 405 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
| 410 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
| 410 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
| 411 | 411 | } |
| 412 | 412 | } |
| 413 | 413 | |
@@ -447,19 +447,19 @@ discard block |
||
| 447 | 447 | $discrColumnType = $discrColumn->getType(); |
| 448 | 448 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 449 | 449 | $sqlTableAlias = ($this->useSqlTableAliases) |
| 450 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 450 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 451 | 451 | : ''; |
| 452 | 452 | |
| 453 | 453 | $sqlParts[] = sprintf( |
| 454 | 454 | '%s IN (%s)', |
| 455 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 455 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 456 | 456 | implode(', ', $values) |
| 457 | 457 | ); |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | $sql = implode(' AND ', $sqlParts); |
| 461 | 461 | |
| 462 | - return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql; |
|
| 462 | + return isset($sqlParts[1]) ? '('.$sql.')' : $sql; |
|
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | /** |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | */ |
| 473 | 473 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
| 474 | 474 | { |
| 475 | - if (! $this->em->hasFilters()) { |
|
| 475 | + if ( ! $this->em->hasFilters()) { |
|
| 476 | 476 | return ''; |
| 477 | 477 | } |
| 478 | 478 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | |
| 504 | 504 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 505 | 505 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 506 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 506 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 507 | 507 | } |
| 508 | 508 | } |
| 509 | 509 | |
@@ -535,7 +535,7 @@ discard block |
||
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | if ( ! $AST->orderByClause && ($orderBySql = $this->generateOrderedCollectionOrderByItems())) { |
| 538 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
| 538 | + $sql .= ' ORDER BY '.$orderBySql; |
|
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | if ($limit !== null || $offset !== null) { |
@@ -547,11 +547,11 @@ discard block |
||
| 547 | 547 | } |
| 548 | 548 | |
| 549 | 549 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
| 550 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
| 550 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
| 554 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
| 554 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 609 | 609 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 610 | 610 | |
| 611 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
| 611 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | return implode(', ', $sqlParts); |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | { |
| 627 | 627 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
| 628 | 628 | |
| 629 | - if (!$fieldName) { |
|
| 629 | + if ( ! $fieldName) { |
|
| 630 | 630 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
| 631 | 631 | } |
| 632 | 632 | |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | $property = $class->getProperty($fieldName); |
| 656 | 656 | |
| 657 | 657 | if ($this->useSqlTableAliases) { |
| 658 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
| 658 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
| 670 | 670 | $association = $class->getProperty($fieldName); |
| 671 | 671 | |
| 672 | - if (! $association->isOwningSide()) { |
|
| 672 | + if ( ! $association->isOwningSide()) { |
|
| 673 | 673 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
| 674 | 674 | } |
| 675 | 675 | |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | $joinColumn = reset($joinColumns); |
| 684 | 684 | |
| 685 | 685 | if ($this->useSqlTableAliases) { |
| 686 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
| 686 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | */ |
| 702 | 702 | public function walkSelectClause($selectClause) |
| 703 | 703 | { |
| 704 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 704 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 705 | 705 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
| 706 | 706 | |
| 707 | 707 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | |
| 745 | 745 | $sqlSelectExpressions[] = sprintf( |
| 746 | 746 | '%s AS %s', |
| 747 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
| 747 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
| 748 | 748 | $sqlColumnAlias |
| 749 | 749 | ); |
| 750 | 750 | |
@@ -754,12 +754,12 @@ discard block |
||
| 754 | 754 | |
| 755 | 755 | // Add foreign key columns of class and also parent classes |
| 756 | 756 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 757 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
| 757 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
| 758 | 758 | || ( ! $addMetaColumns && ! $association->isPrimaryKey())) { |
| 759 | 759 | continue; |
| 760 | 760 | } |
| 761 | 761 | |
| 762 | - $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 762 | + $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 763 | 763 | |
| 764 | 764 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 765 | 765 | /** @var JoinColumnMetadata $joinColumn */ |
@@ -769,7 +769,7 @@ discard block |
||
| 769 | 769 | $columnAlias = $this->getSQLColumnAlias(); |
| 770 | 770 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
| 771 | 771 | |
| 772 | - if (! $joinColumn->getType()) { |
|
| 772 | + if ( ! $joinColumn->getType()) { |
|
| 773 | 773 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 774 | 774 | } |
| 775 | 775 | |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | continue; |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 802 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 803 | 803 | continue; |
| 804 | 804 | } |
| 805 | 805 | |
@@ -813,7 +813,7 @@ discard block |
||
| 813 | 813 | $columnAlias = $this->getSQLColumnAlias(); |
| 814 | 814 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
| 815 | 815 | |
| 816 | - if (! $joinColumn->getType()) { |
|
| 816 | + if ( ! $joinColumn->getType()) { |
|
| 817 | 817 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 818 | 818 | } |
| 819 | 819 | |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
| 848 | 848 | } |
| 849 | 849 | |
| 850 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 850 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | /** |
@@ -927,7 +927,7 @@ discard block |
||
| 927 | 927 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 928 | 928 | |
| 929 | 929 | $sql = $this->platform->appendLockHint( |
| 930 | - $tableName . ' ' . $tableAlias, |
|
| 930 | + $tableName.' '.$tableAlias, |
|
| 931 | 931 | $this->query->getHint(Query::HINT_LOCK_MODE) |
| 932 | 932 | ); |
| 933 | 933 | |
@@ -938,10 +938,10 @@ discard block |
||
| 938 | 938 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
| 939 | 939 | |
| 940 | 940 | if ( ! $buildNestedJoins) { |
| 941 | - return $sql . $classTableInheritanceJoins; |
|
| 941 | + return $sql.$classTableInheritanceJoins; |
|
| 942 | 942 | } |
| 943 | 943 | |
| 944 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
| 944 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
| 945 | 945 | } |
| 946 | 946 | |
| 947 | 947 | /** |
@@ -978,7 +978,7 @@ discard block |
||
| 978 | 978 | ; |
| 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) { |
@@ -1060,7 +1060,7 @@ discard block |
||
| 1060 | 1060 | ); |
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
| 1063 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
| 1064 | 1064 | |
| 1065 | 1065 | // Join target table |
| 1066 | 1066 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1099,7 +1099,7 @@ discard block |
||
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | 1101 | $targetTableJoin = [ |
| 1102 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1102 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1103 | 1103 | 'condition' => implode(' AND ', $conditions), |
| 1104 | 1104 | ]; |
| 1105 | 1105 | } else { |
@@ -1107,23 +1107,23 @@ discard block |
||
| 1107 | 1107 | } |
| 1108 | 1108 | |
| 1109 | 1109 | // Handle WITH clause |
| 1110 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
| 1110 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
| 1111 | 1111 | |
| 1112 | 1112 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
| 1113 | 1113 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
| 1114 | 1114 | |
| 1115 | 1115 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
| 1116 | 1116 | if ($withCondition) { |
| 1117 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
| 1117 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
| 1118 | 1118 | } else { |
| 1119 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
| 1119 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
| 1120 | 1120 | } |
| 1121 | 1121 | } else { |
| 1122 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
| 1122 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
| 1123 | 1123 | } |
| 1124 | 1124 | |
| 1125 | 1125 | if ($withCondition) { |
| 1126 | - $sql .= ' AND ' . $withCondition; |
|
| 1126 | + $sql .= ' AND '.$withCondition; |
|
| 1127 | 1127 | } |
| 1128 | 1128 | |
| 1129 | 1129 | // Apply the indexes |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
| 1157 | 1157 | } |
| 1158 | 1158 | |
| 1159 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
| 1159 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
| 1160 | 1160 | } |
| 1161 | 1161 | |
| 1162 | 1162 | /** |
@@ -1173,10 +1173,10 @@ discard block |
||
| 1173 | 1173 | $this->orderedColumnsMap[$sql] = $type; |
| 1174 | 1174 | |
| 1175 | 1175 | if ($expr instanceof AST\Subselect) { |
| 1176 | - return '(' . $sql . ') ' . $type; |
|
| 1176 | + return '('.$sql.') '.$type; |
|
| 1177 | 1177 | } |
| 1178 | 1178 | |
| 1179 | - return $sql . ' ' . $type; |
|
| 1179 | + return $sql.' '.$type; |
|
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | 1182 | /** |
@@ -1184,7 +1184,7 @@ discard block |
||
| 1184 | 1184 | */ |
| 1185 | 1185 | public function walkHavingClause($havingClause) |
| 1186 | 1186 | { |
| 1187 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1187 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | 1190 | /** |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | $conditions = []; |
| 1208 | 1208 | |
| 1209 | 1209 | if ($join->conditionalExpression) { |
| 1210 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
| 1210 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
| 1211 | 1211 | } |
| 1212 | 1212 | |
| 1213 | 1213 | $isUnconditionalJoin = empty($conditions); |
@@ -1215,7 +1215,7 @@ discard block |
||
| 1215 | 1215 | ? ' AND ' |
| 1216 | 1216 | : ' ON '; |
| 1217 | 1217 | |
| 1218 | - $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, !$isUnconditionalJoin); |
|
| 1218 | + $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, ! $isUnconditionalJoin); |
|
| 1219 | 1219 | |
| 1220 | 1220 | // Apply remaining inheritance restrictions |
| 1221 | 1221 | $discrSql = $this->generateDiscriminatorColumnConditionSQL([$dqlAlias]); |
@@ -1232,7 +1232,7 @@ discard block |
||
| 1232 | 1232 | } |
| 1233 | 1233 | |
| 1234 | 1234 | if ($conditions) { |
| 1235 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
| 1235 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
| 1236 | 1236 | } |
| 1237 | 1237 | |
| 1238 | 1238 | break; |
@@ -1262,7 +1262,7 @@ discard block |
||
| 1262 | 1262 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
| 1263 | 1263 | } |
| 1264 | 1264 | |
| 1265 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
| 1265 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
| 1266 | 1266 | |
| 1267 | 1267 | return $sql; |
| 1268 | 1268 | } |
@@ -1284,7 +1284,7 @@ discard block |
||
| 1284 | 1284 | ? $this->conn->quote($nullIfExpression->secondExpression) |
| 1285 | 1285 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
| 1286 | 1286 | |
| 1287 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
| 1287 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
| 1288 | 1288 | } |
| 1289 | 1289 | |
| 1290 | 1290 | /** |
@@ -1299,11 +1299,11 @@ discard block |
||
| 1299 | 1299 | $sql = 'CASE'; |
| 1300 | 1300 | |
| 1301 | 1301 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
| 1302 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1303 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1302 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1303 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1304 | 1304 | } |
| 1305 | 1305 | |
| 1306 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
| 1306 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
| 1307 | 1307 | |
| 1308 | 1308 | return $sql; |
| 1309 | 1309 | } |
@@ -1317,14 +1317,14 @@ discard block |
||
| 1317 | 1317 | */ |
| 1318 | 1318 | public function walkSimpleCaseExpression($simpleCaseExpression) |
| 1319 | 1319 | { |
| 1320 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1320 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1321 | 1321 | |
| 1322 | 1322 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
| 1323 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1324 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1323 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1324 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1325 | 1325 | } |
| 1326 | 1326 | |
| 1327 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
| 1327 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
| 1328 | 1328 | |
| 1329 | 1329 | return $sql; |
| 1330 | 1330 | } |
@@ -1386,7 +1386,7 @@ discard block |
||
| 1386 | 1386 | $columnAlias = $this->getSQLColumnAlias(); |
| 1387 | 1387 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1388 | 1388 | |
| 1389 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1389 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1390 | 1390 | |
| 1391 | 1391 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1392 | 1392 | |
@@ -1401,7 +1401,7 @@ discard block |
||
| 1401 | 1401 | $columnAlias = $this->getSQLColumnAlias(); |
| 1402 | 1402 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1403 | 1403 | |
| 1404 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1404 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1405 | 1405 | |
| 1406 | 1406 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1407 | 1407 | |
@@ -1441,7 +1441,7 @@ discard block |
||
| 1441 | 1441 | |
| 1442 | 1442 | // Select all fields from the queried class |
| 1443 | 1443 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1444 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1444 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1445 | 1445 | continue; |
| 1446 | 1446 | } |
| 1447 | 1447 | |
@@ -1476,11 +1476,11 @@ discard block |
||
| 1476 | 1476 | $subClass = $this->em->getClassMetadata($subClassName); |
| 1477 | 1477 | |
| 1478 | 1478 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1479 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1479 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1480 | 1480 | continue; |
| 1481 | 1481 | } |
| 1482 | 1482 | |
| 1483 | - if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
| 1483 | + if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
| 1484 | 1484 | continue; |
| 1485 | 1485 | } |
| 1486 | 1486 | |
@@ -1515,7 +1515,7 @@ discard block |
||
| 1515 | 1515 | */ |
| 1516 | 1516 | public function walkQuantifiedExpression($qExpr) |
| 1517 | 1517 | { |
| 1518 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
| 1518 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | 1521 | /** |
@@ -1555,7 +1555,7 @@ discard block |
||
| 1555 | 1555 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
| 1556 | 1556 | } |
| 1557 | 1557 | |
| 1558 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 1558 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 1559 | 1559 | } |
| 1560 | 1560 | |
| 1561 | 1561 | /** |
@@ -1563,7 +1563,7 @@ discard block |
||
| 1563 | 1563 | */ |
| 1564 | 1564 | public function walkSimpleSelectClause($simpleSelectClause) |
| 1565 | 1565 | { |
| 1566 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1566 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1567 | 1567 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
| 1568 | 1568 | } |
| 1569 | 1569 | |
@@ -1582,7 +1582,7 @@ discard block |
||
| 1582 | 1582 | * @param null|string $newObjectResultAlias |
| 1583 | 1583 | * @return string The SQL. |
| 1584 | 1584 | */ |
| 1585 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
| 1585 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
| 1586 | 1586 | { |
| 1587 | 1587 | $sqlSelectExpressions = []; |
| 1588 | 1588 | $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
@@ -1598,7 +1598,7 @@ discard block |
||
| 1598 | 1598 | break; |
| 1599 | 1599 | |
| 1600 | 1600 | case ($e instanceof AST\Subselect): |
| 1601 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
| 1601 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
| 1602 | 1602 | break; |
| 1603 | 1603 | |
| 1604 | 1604 | case ($e instanceof AST\PathExpression): |
@@ -1607,7 +1607,7 @@ discard block |
||
| 1607 | 1607 | $class = $qComp['metadata']; |
| 1608 | 1608 | $fieldType = $class->getProperty($e->field)->getType(); |
| 1609 | 1609 | |
| 1610 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1610 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1611 | 1611 | break; |
| 1612 | 1612 | |
| 1613 | 1613 | case ($e instanceof AST\Literal): |
@@ -1621,11 +1621,11 @@ discard block |
||
| 1621 | 1621 | break; |
| 1622 | 1622 | } |
| 1623 | 1623 | |
| 1624 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1624 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1625 | 1625 | break; |
| 1626 | 1626 | |
| 1627 | 1627 | default: |
| 1628 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1628 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1629 | 1629 | break; |
| 1630 | 1630 | } |
| 1631 | 1631 | |
@@ -1658,10 +1658,10 @@ discard block |
||
| 1658 | 1658 | case ($expr instanceof AST\Subselect): |
| 1659 | 1659 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1660 | 1660 | |
| 1661 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
| 1661 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
| 1662 | 1662 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1663 | 1663 | |
| 1664 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1664 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1665 | 1665 | break; |
| 1666 | 1666 | |
| 1667 | 1667 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1678,7 +1678,7 @@ discard block |
||
| 1678 | 1678 | $columnAlias = $this->getSQLColumnAlias(); |
| 1679 | 1679 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1680 | 1680 | |
| 1681 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1681 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1682 | 1682 | break; |
| 1683 | 1683 | |
| 1684 | 1684 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1698,8 +1698,8 @@ discard block |
||
| 1698 | 1698 | */ |
| 1699 | 1699 | public function walkAggregateExpression($aggExpression) |
| 1700 | 1700 | { |
| 1701 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1702 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
| 1701 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1702 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
| 1703 | 1703 | } |
| 1704 | 1704 | |
| 1705 | 1705 | /** |
@@ -1713,7 +1713,7 @@ discard block |
||
| 1713 | 1713 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
| 1714 | 1714 | } |
| 1715 | 1715 | |
| 1716 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
| 1716 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
| 1717 | 1717 | } |
| 1718 | 1718 | |
| 1719 | 1719 | /** |
@@ -1776,7 +1776,7 @@ discard block |
||
| 1776 | 1776 | { |
| 1777 | 1777 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
| 1778 | 1778 | $tableName = $class->getTableName(); |
| 1779 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1779 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1780 | 1780 | |
| 1781 | 1781 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
| 1782 | 1782 | |
@@ -1792,12 +1792,12 @@ discard block |
||
| 1792 | 1792 | { |
| 1793 | 1793 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
| 1794 | 1794 | $tableName = $class->getTableName(); |
| 1795 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1795 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1796 | 1796 | |
| 1797 | 1797 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
| 1798 | 1798 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
| 1799 | 1799 | |
| 1800 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1800 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1801 | 1801 | |
| 1802 | 1802 | return $sql; |
| 1803 | 1803 | } |
@@ -1810,7 +1810,7 @@ discard block |
||
| 1810 | 1810 | $useTableAliasesBefore = $this->useSqlTableAliases; |
| 1811 | 1811 | $this->useSqlTableAliases = false; |
| 1812 | 1812 | |
| 1813 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
| 1813 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
| 1814 | 1814 | $newValue = $updateItem->newValue; |
| 1815 | 1815 | |
| 1816 | 1816 | switch (true) { |
@@ -1853,7 +1853,7 @@ discard block |
||
| 1853 | 1853 | |
| 1854 | 1854 | if ($filterClauses) { |
| 1855 | 1855 | if ($condSql) { |
| 1856 | - $condSql = '(' . $condSql . ') AND '; |
|
| 1856 | + $condSql = '('.$condSql.') AND '; |
|
| 1857 | 1857 | } |
| 1858 | 1858 | |
| 1859 | 1859 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1861,11 +1861,11 @@ discard block |
||
| 1861 | 1861 | } |
| 1862 | 1862 | |
| 1863 | 1863 | if ($condSql) { |
| 1864 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
| 1864 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
| 1865 | 1865 | } |
| 1866 | 1866 | |
| 1867 | 1867 | if ($discrSql) { |
| 1868 | - return ' WHERE ' . $discrSql; |
|
| 1868 | + return ' WHERE '.$discrSql; |
|
| 1869 | 1869 | } |
| 1870 | 1870 | |
| 1871 | 1871 | return ''; |
@@ -1908,7 +1908,7 @@ discard block |
||
| 1908 | 1908 | // if only one ConditionalPrimary is defined |
| 1909 | 1909 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
| 1910 | 1910 | ? $this->walkConditionalPrimary($factor) |
| 1911 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1911 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1912 | 1912 | } |
| 1913 | 1913 | |
| 1914 | 1914 | /** |
@@ -1923,7 +1923,7 @@ discard block |
||
| 1923 | 1923 | if ($primary->isConditionalExpression()) { |
| 1924 | 1924 | $condExpr = $primary->conditionalExpression; |
| 1925 | 1925 | |
| 1926 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
| 1926 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
| 1927 | 1927 | } |
| 1928 | 1928 | } |
| 1929 | 1929 | |
@@ -1934,7 +1934,7 @@ discard block |
||
| 1934 | 1934 | { |
| 1935 | 1935 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
| 1936 | 1936 | |
| 1937 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
| 1937 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
| 1938 | 1938 | |
| 1939 | 1939 | return $sql; |
| 1940 | 1940 | } |
@@ -1983,7 +1983,7 @@ discard block |
||
| 1983 | 1983 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
| 1984 | 1984 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1985 | 1985 | |
| 1986 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
| 1986 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
| 1987 | 1987 | |
| 1988 | 1988 | $sqlParts = []; |
| 1989 | 1989 | |
@@ -2004,7 +2004,7 @@ discard block |
||
| 2004 | 2004 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 2005 | 2005 | } |
| 2006 | 2006 | |
| 2007 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 2007 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2008 | 2008 | } |
| 2009 | 2009 | |
| 2010 | 2010 | $sql .= implode(' AND ', $sqlParts); |
@@ -2018,7 +2018,7 @@ discard block |
||
| 2018 | 2018 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 2019 | 2019 | |
| 2020 | 2020 | // join to target table |
| 2021 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
| 2021 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
| 2022 | 2022 | |
| 2023 | 2023 | // join conditions |
| 2024 | 2024 | $joinSqlParts = []; |
@@ -2069,13 +2069,13 @@ discard block |
||
| 2069 | 2069 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 2070 | 2070 | } |
| 2071 | 2071 | |
| 2072 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 2072 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2073 | 2073 | } |
| 2074 | 2074 | |
| 2075 | 2075 | $sql .= implode(' AND ', $sqlParts); |
| 2076 | 2076 | } |
| 2077 | 2077 | |
| 2078 | - return $sql . ')'; |
|
| 2078 | + return $sql.')'; |
|
| 2079 | 2079 | } |
| 2080 | 2080 | |
| 2081 | 2081 | /** |
@@ -2086,7 +2086,7 @@ discard block |
||
| 2086 | 2086 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
| 2087 | 2087 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
| 2088 | 2088 | |
| 2089 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2089 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2090 | 2090 | } |
| 2091 | 2091 | |
| 2092 | 2092 | /** |
@@ -2095,19 +2095,19 @@ discard block |
||
| 2095 | 2095 | public function walkNullComparisonExpression($nullCompExpr) |
| 2096 | 2096 | { |
| 2097 | 2097 | $expression = $nullCompExpr->expression; |
| 2098 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
| 2098 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
| 2099 | 2099 | |
| 2100 | 2100 | // Handle ResultVariable |
| 2101 | 2101 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
| 2102 | - return $this->walkResultVariable($expression) . $comparison; |
|
| 2102 | + return $this->walkResultVariable($expression).$comparison; |
|
| 2103 | 2103 | } |
| 2104 | 2104 | |
| 2105 | 2105 | // Handle InputParameter mapping inclusion to ParserResult |
| 2106 | 2106 | if ($expression instanceof AST\InputParameter) { |
| 2107 | - return $this->walkInputParameter($expression) . $comparison; |
|
| 2107 | + return $this->walkInputParameter($expression).$comparison; |
|
| 2108 | 2108 | } |
| 2109 | 2109 | |
| 2110 | - return $expression->dispatch($this) . $comparison; |
|
| 2110 | + return $expression->dispatch($this).$comparison; |
|
| 2111 | 2111 | } |
| 2112 | 2112 | |
| 2113 | 2113 | /** |
@@ -2115,7 +2115,7 @@ discard block |
||
| 2115 | 2115 | */ |
| 2116 | 2116 | public function walkInExpression($inExpr) |
| 2117 | 2117 | { |
| 2118 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
| 2118 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
| 2119 | 2119 | |
| 2120 | 2120 | $sql .= ($inExpr->subselect) |
| 2121 | 2121 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2139,12 +2139,12 @@ discard block |
||
| 2139 | 2139 | $discrColumnType = $discrColumn->getType(); |
| 2140 | 2140 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 2141 | 2141 | $sqlTableAlias = $this->useSqlTableAliases |
| 2142 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 2142 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 2143 | 2143 | : ''; |
| 2144 | 2144 | |
| 2145 | 2145 | return sprintf( |
| 2146 | 2146 | '%s %sIN %s', |
| 2147 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 2147 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 2148 | 2148 | ($instanceOfExpr->not ? 'NOT ' : ''), |
| 2149 | 2149 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
| 2150 | 2150 | ); |
@@ -2191,8 +2191,8 @@ discard block |
||
| 2191 | 2191 | $sql .= ' NOT'; |
| 2192 | 2192 | } |
| 2193 | 2193 | |
| 2194 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2195 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2194 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2195 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2196 | 2196 | |
| 2197 | 2197 | return $sql; |
| 2198 | 2198 | } |
@@ -2207,7 +2207,7 @@ discard block |
||
| 2207 | 2207 | ? $this->walkResultVariable($stringExpr) |
| 2208 | 2208 | : $stringExpr->dispatch($this); |
| 2209 | 2209 | |
| 2210 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
| 2210 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
| 2211 | 2211 | |
| 2212 | 2212 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
| 2213 | 2213 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2220,7 +2220,7 @@ discard block |
||
| 2220 | 2220 | } |
| 2221 | 2221 | |
| 2222 | 2222 | if ($likeExpr->escapeChar) { |
| 2223 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
| 2223 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
| 2224 | 2224 | } |
| 2225 | 2225 | |
| 2226 | 2226 | return $sql; |
@@ -2247,7 +2247,7 @@ discard block |
||
| 2247 | 2247 | ? $leftExpr->dispatch($this) |
| 2248 | 2248 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
| 2249 | 2249 | |
| 2250 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
| 2250 | + $sql .= ' '.$compExpr->operator.' '; |
|
| 2251 | 2251 | |
| 2252 | 2252 | $sql .= ($rightExpr instanceof AST\Node) |
| 2253 | 2253 | ? $rightExpr->dispatch($this) |
@@ -2279,7 +2279,7 @@ discard block |
||
| 2279 | 2279 | { |
| 2280 | 2280 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
| 2281 | 2281 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
| 2282 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
| 2282 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
| 2283 | 2283 | } |
| 2284 | 2284 | |
| 2285 | 2285 | /** |
@@ -2333,7 +2333,7 @@ discard block |
||
| 2333 | 2333 | |
| 2334 | 2334 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
| 2335 | 2335 | |
| 2336 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2336 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2337 | 2337 | } |
| 2338 | 2338 | |
| 2339 | 2339 | /** |
@@ -2346,7 +2346,7 @@ discard block |
||
| 2346 | 2346 | public function walkArithmeticPrimary($primary) |
| 2347 | 2347 | { |
| 2348 | 2348 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
| 2349 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
| 2349 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
| 2350 | 2350 | } |
| 2351 | 2351 | |
| 2352 | 2352 | if ($primary instanceof AST\Node) { |
@@ -2407,7 +2407,7 @@ discard block |
||
| 2407 | 2407 | $entityClassName = $entityClass->getClassName(); |
| 2408 | 2408 | |
| 2409 | 2409 | if ($entityClassName !== $rootClass->getClassName()) { |
| 2410 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
| 2410 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
| 2411 | 2411 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
| 2412 | 2412 | } |
| 2413 | 2413 | } |
@@ -2419,6 +2419,6 @@ discard block |
||
| 2419 | 2419 | $sqlParameterList[] = $this->conn->quote($discriminator); |
| 2420 | 2420 | } |
| 2421 | 2421 | |
| 2422 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
| 2422 | + return '('.implode(', ', $sqlParameterList).')'; |
|
| 2423 | 2423 | } |
| 2424 | 2424 | } |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -declare(strict_types=1); |
|
| 4 | +declare(strict_types = 1); |
|
| 5 | 5 | |
| 6 | 6 | namespace Doctrine\ORM\Cache\Region; |
| 7 | 7 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | private function getLockFileName(CacheKey $key) |
| 105 | 105 | { |
| 106 | - return $this->directory . DIRECTORY_SEPARATOR . $key->hash . '.' . self::LOCK_EXTENSION; |
|
| 106 | + return $this->directory.DIRECTORY_SEPARATOR.$key->hash.'.'.self::LOCK_EXTENSION; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /** |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Mapping; |
| 6 | 6 | |
@@ -679,12 +679,12 @@ discard block |
||
| 679 | 679 | $findByIdQuery = $class->getNamedNativeQuery('find-by-id'); |
| 680 | 680 | |
| 681 | 681 | self::assertEquals(CmsAddress::class, $findByIdQuery['resultClass']); |
| 682 | - self::assertEquals('SELECT * FROM cms_addresses WHERE id = ?', $findByIdQuery['query']); |
|
| 682 | + self::assertEquals('SELECT * FROM cms_addresses WHERE id = ?', $findByIdQuery['query']); |
|
| 683 | 683 | |
| 684 | 684 | $countQuery = $class->getNamedNativeQuery('count'); |
| 685 | 685 | |
| 686 | 686 | self::assertEquals('mapping-count', $countQuery['resultSetMapping']); |
| 687 | - self::assertEquals('SELECT COUNT(*) AS count FROM cms_addresses', $countQuery['query']); |
|
| 687 | + self::assertEquals('SELECT COUNT(*) AS count FROM cms_addresses', $countQuery['query']); |
|
| 688 | 688 | |
| 689 | 689 | // result set mapping |
| 690 | 690 | self::assertCount(3, $class->sqlResultSetMappings); |
@@ -695,9 +695,9 @@ discard block |
||
| 695 | 695 | $findAllMapping = $class->getSqlResultSetMapping('mapping-find-all'); |
| 696 | 696 | |
| 697 | 697 | self::assertEquals(CmsAddress::class, $findAllMapping['entities'][0]['entityClass']); |
| 698 | - self::assertEquals(['name'=>'id','column'=>'id'], $findAllMapping['entities'][0]['fields'][0]); |
|
| 699 | - self::assertEquals(['name'=>'city','column'=>'city'], $findAllMapping['entities'][0]['fields'][1]); |
|
| 700 | - self::assertEquals(['name'=>'country','column'=>'country'], $findAllMapping['entities'][0]['fields'][2]); |
|
| 698 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $findAllMapping['entities'][0]['fields'][0]); |
|
| 699 | + self::assertEquals(['name'=>'city', 'column'=>'city'], $findAllMapping['entities'][0]['fields'][1]); |
|
| 700 | + self::assertEquals(['name'=>'country', 'column'=>'country'], $findAllMapping['entities'][0]['fields'][2]); |
|
| 701 | 701 | |
| 702 | 702 | $withoutFieldsMapping = $class->getSqlResultSetMapping('mapping-without-fields'); |
| 703 | 703 | |
@@ -727,14 +727,14 @@ discard block |
||
| 727 | 727 | |
| 728 | 728 | self::assertNull($mapping['entities'][0]['discriminatorColumn']); |
| 729 | 729 | |
| 730 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 731 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 732 | - self::assertEquals(['name'=>'status','column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
| 733 | - self::assertEquals(['name'=>'address.zip','column'=>'zip'], $mapping['entities'][0]['fields'][3]); |
|
| 734 | - self::assertEquals(['name'=>'address.city','column'=>'city'], $mapping['entities'][0]['fields'][4]); |
|
| 735 | - self::assertEquals(['name'=>'address.country','column'=>'country'], $mapping['entities'][0]['fields'][5]); |
|
| 736 | - self::assertEquals(['name'=>'address.id','column'=>'a_id'], $mapping['entities'][0]['fields'][6]); |
|
| 737 | - self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
| 730 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 731 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 732 | + self::assertEquals(['name'=>'status', 'column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
| 733 | + self::assertEquals(['name'=>'address.zip', 'column'=>'zip'], $mapping['entities'][0]['fields'][3]); |
|
| 734 | + self::assertEquals(['name'=>'address.city', 'column'=>'city'], $mapping['entities'][0]['fields'][4]); |
|
| 735 | + self::assertEquals(['name'=>'address.country', 'column'=>'country'], $mapping['entities'][0]['fields'][5]); |
|
| 736 | + self::assertEquals(['name'=>'address.id', 'column'=>'a_id'], $mapping['entities'][0]['fields'][6]); |
|
| 737 | + self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
| 738 | 738 | |
| 739 | 739 | $mapping = $userMetadata->getSqlResultSetMapping('mappingJoinedPhonenumber'); |
| 740 | 740 | |
@@ -743,11 +743,11 @@ discard block |
||
| 743 | 743 | |
| 744 | 744 | self::assertNull($mapping['entities'][0]['discriminatorColumn']); |
| 745 | 745 | |
| 746 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 747 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 748 | - self::assertEquals(['name'=>'status','column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
| 749 | - self::assertEquals(['name'=>'phonenumbers.phonenumber','column'=>'number'], $mapping['entities'][0]['fields'][3]); |
|
| 750 | - self::assertEquals($userMetadata->getClassName(), $mapping['entities'][0]['entityClass']); |
|
| 746 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 747 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 748 | + self::assertEquals(['name'=>'status', 'column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
| 749 | + self::assertEquals(['name'=>'phonenumbers.phonenumber', 'column'=>'number'], $mapping['entities'][0]['fields'][3]); |
|
| 750 | + self::assertEquals($userMetadata->getClassName(), $mapping['entities'][0]['entityClass']); |
|
| 751 | 751 | |
| 752 | 752 | $mapping = $userMetadata->getSqlResultSetMapping('mappingUserPhonenumberCount'); |
| 753 | 753 | |
@@ -756,10 +756,10 @@ discard block |
||
| 756 | 756 | |
| 757 | 757 | self::assertNull($mapping['entities'][0]['discriminatorColumn']); |
| 758 | 758 | |
| 759 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 760 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 761 | - self::assertEquals(['name'=>'status','column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
| 762 | - self::assertEquals($userMetadata->getClassName(), $mapping['entities'][0]['entityClass']); |
|
| 759 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 760 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 761 | + self::assertEquals(['name'=>'status', 'column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
| 762 | + self::assertEquals($userMetadata->getClassName(), $mapping['entities'][0]['entityClass']); |
|
| 763 | 763 | |
| 764 | 764 | $mapping = $userMetadata->getSqlResultSetMapping('mappingMultipleJoinsEntityResults'); |
| 765 | 765 | |
@@ -768,17 +768,17 @@ discard block |
||
| 768 | 768 | |
| 769 | 769 | self::assertNull($mapping['entities'][0]['discriminatorColumn']); |
| 770 | 770 | |
| 771 | - self::assertEquals(['name'=>'id','column'=>'u_id'], $mapping['entities'][0]['fields'][0]); |
|
| 772 | - self::assertEquals(['name'=>'name','column'=>'u_name'], $mapping['entities'][0]['fields'][1]); |
|
| 773 | - self::assertEquals(['name'=>'status','column'=>'u_status'], $mapping['entities'][0]['fields'][2]); |
|
| 774 | - self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
| 771 | + self::assertEquals(['name'=>'id', 'column'=>'u_id'], $mapping['entities'][0]['fields'][0]); |
|
| 772 | + self::assertEquals(['name'=>'name', 'column'=>'u_name'], $mapping['entities'][0]['fields'][1]); |
|
| 773 | + self::assertEquals(['name'=>'status', 'column'=>'u_status'], $mapping['entities'][0]['fields'][2]); |
|
| 774 | + self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
| 775 | 775 | |
| 776 | 776 | self::assertNull($mapping['entities'][1]['discriminatorColumn']); |
| 777 | 777 | |
| 778 | - self::assertEquals(['name'=>'id','column'=>'a_id'], $mapping['entities'][1]['fields'][0]); |
|
| 779 | - self::assertEquals(['name'=>'zip','column'=>'a_zip'], $mapping['entities'][1]['fields'][1]); |
|
| 780 | - self::assertEquals(['name'=>'country','column'=>'a_country'], $mapping['entities'][1]['fields'][2]); |
|
| 781 | - self::assertEquals(CmsAddress::class, $mapping['entities'][1]['entityClass']); |
|
| 778 | + self::assertEquals(['name'=>'id', 'column'=>'a_id'], $mapping['entities'][1]['fields'][0]); |
|
| 779 | + self::assertEquals(['name'=>'zip', 'column'=>'a_zip'], $mapping['entities'][1]['fields'][1]); |
|
| 780 | + self::assertEquals(['name'=>'country', 'column'=>'a_country'], $mapping['entities'][1]['fields'][2]); |
|
| 781 | + self::assertEquals(CmsAddress::class, $mapping['entities'][1]['entityClass']); |
|
| 782 | 782 | |
| 783 | 783 | //person asserts |
| 784 | 784 | self::assertCount(1, $personMetadata->getSqlResultSetMappings()); |
@@ -790,9 +790,9 @@ discard block |
||
| 790 | 790 | |
| 791 | 791 | self::assertEquals('discriminator', $mapping['entities'][0]['discriminatorColumn']); |
| 792 | 792 | |
| 793 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 794 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 795 | - self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
| 793 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
| 794 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
| 795 | + self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
| 796 | 796 | } |
| 797 | 797 | |
| 798 | 798 | /* |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $this->em->clear(); |
| 53 | 53 | |
| 54 | - $result2 = $this->em->createQuery($dql) |
|
| 54 | + $result2 = $this->em->createQuery($dql) |
|
| 55 | 55 | ->setCacheable(true) |
| 56 | 56 | ->getResult(); |
| 57 | 57 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | $this->em->clear(); |
| 256 | 256 | |
| 257 | - $result2 = $this->em->createQuery($dql) |
|
| 257 | + $result2 = $this->em->createQuery($dql) |
|
| 258 | 258 | ->setCacheable(true) |
| 259 | 259 | ->getResult(); |
| 260 | 260 | |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | |
| 347 | 347 | $this->em->clear(); |
| 348 | 348 | |
| 349 | - $result2 = $this->em->createQuery($dql) |
|
| 349 | + $result2 = $this->em->createQuery($dql) |
|
| 350 | 350 | ->setCacheable(true) |
| 351 | 351 | ->getResult(); |
| 352 | 352 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | $this->em->clear(); |
| 396 | 396 | |
| 397 | - $result2 = $this->em->createQuery($dql)->setCacheable(true) |
|
| 397 | + $result2 = $this->em->createQuery($dql)->setCacheable(true) |
|
| 398 | 398 | ->setParameter('name', $name) |
| 399 | 399 | ->getResult(); |
| 400 | 400 | |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | |
| 439 | 439 | $this->em->clear(); |
| 440 | 440 | |
| 441 | - $result2 = $this->em->createQuery($dql) |
|
| 441 | + $result2 = $this->em->createQuery($dql) |
|
| 442 | 442 | ->setCacheable(true) |
| 443 | 443 | ->getResult(); |
| 444 | 444 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | |
| 501 | 501 | $this->em->clear(); |
| 502 | 502 | |
| 503 | - $result2 = $this->em->createQuery($dql) |
|
| 503 | + $result2 = $this->em->createQuery($dql) |
|
| 504 | 504 | ->setCacheable(true) |
| 505 | 505 | ->getResult(); |
| 506 | 506 | |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | $this->em->clear(); |
| 567 | 567 | $this->secondLevelCacheLogger->clearStats(); |
| 568 | 568 | |
| 569 | - $result2 = $this->em->createQuery($dql) |
|
| 569 | + $result2 = $this->em->createQuery($dql) |
|
| 570 | 570 | ->setCacheable(true) |
| 571 | 571 | ->getResult(); |
| 572 | 572 | |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | |
| 627 | 627 | $this->cache->evictEntityRegion(State::class); |
| 628 | 628 | |
| 629 | - $result2 = $this->em->createQuery($dql) |
|
| 629 | + $result2 = $this->em->createQuery($dql) |
|
| 630 | 630 | ->setCacheable(true) |
| 631 | 631 | ->getResult(); |
| 632 | 632 | |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | |
| 670 | 670 | $this->cache->evictEntityRegion(City::class); |
| 671 | 671 | |
| 672 | - $result2 = $this->em->createQuery($dql) |
|
| 672 | + $result2 = $this->em->createQuery($dql) |
|
| 673 | 673 | ->setCacheable(true) |
| 674 | 674 | ->getResult(); |
| 675 | 675 | |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | |
| 721 | 721 | $this->em->clear(); |
| 722 | 722 | |
| 723 | - $result2 = $this->em->createNativeQuery($sql, $rsm) |
|
| 723 | + $result2 = $this->em->createNativeQuery($sql, $rsm) |
|
| 724 | 724 | ->setCacheable(true) |
| 725 | 725 | ->getResult(); |
| 726 | 726 | |
@@ -775,7 +775,7 @@ discard block |
||
| 775 | 775 | |
| 776 | 776 | $this->em->clear(); |
| 777 | 777 | |
| 778 | - $result2 = $this->em->createQuery($dql) |
|
| 778 | + $result2 = $this->em->createQuery($dql) |
|
| 779 | 779 | ->setCacheable(true) |
| 780 | 780 | ->setFirstResult(2) |
| 781 | 781 | ->setMaxResults(1) |
@@ -787,7 +787,7 @@ discard block |
||
| 787 | 787 | |
| 788 | 788 | $this->em->clear(); |
| 789 | 789 | |
| 790 | - $result3 = $this->em->createQuery($dql) |
|
| 790 | + $result3 = $this->em->createQuery($dql) |
|
| 791 | 791 | ->setCacheable(true) |
| 792 | 792 | ->getResult(); |
| 793 | 793 | |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | ->getRegion() |
| 838 | 838 | ->put($key, $entry); |
| 839 | 839 | |
| 840 | - $result2 = $this->em->createQuery($dql) |
|
| 840 | + $result2 = $this->em->createQuery($dql) |
|
| 841 | 841 | ->setCacheable(true) |
| 842 | 842 | ->setLifetime(3600) |
| 843 | 843 | ->getResult(); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | $this->em->clear(); |
| 51 | 51 | |
| 52 | - $query = $this->em->createQuery('select p from ' . CompanyPerson::class . ' p order by p.name desc'); |
|
| 52 | + $query = $this->em->createQuery('select p from '.CompanyPerson::class.' p order by p.name desc'); |
|
| 53 | 53 | |
| 54 | 54 | $entities = $query->getResult(); |
| 55 | 55 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $this->em->clear(); |
| 66 | 66 | |
| 67 | - $query = $this->em->createQuery('select p from ' . CompanyEmployee::class . ' p'); |
|
| 67 | + $query = $this->em->createQuery('select p from '.CompanyEmployee::class.' p'); |
|
| 68 | 68 | |
| 69 | 69 | $entities = $query->getResult(); |
| 70 | 70 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $this->em->clear(); |
| 85 | 85 | |
| 86 | - $query = $this->em->createQuery("update " . CompanyEmployee::class . " p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3"); |
|
| 86 | + $query = $this->em->createQuery("update ".CompanyEmployee::class." p set p.name = ?1, p.department = ?2 where p.name='Guilherme Blanco' and p.salary = ?3"); |
|
| 87 | 87 | |
| 88 | 88 | $query->setParameter(1, 'NewName', 'string'); |
| 89 | 89 | $query->setParameter(2, 'NewDepartment'); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | self::assertEquals(1, $numUpdated); |
| 96 | 96 | |
| 97 | - $query = $this->em->createQuery('delete from ' . CompanyPerson::class . ' p'); |
|
| 97 | + $query = $this->em->createQuery('delete from '.CompanyPerson::class.' p'); |
|
| 98 | 98 | |
| 99 | 99 | $numDeleted = $query->execute(); |
| 100 | 100 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $this->em->flush(); |
| 170 | 170 | $this->em->clear(); |
| 171 | 171 | |
| 172 | - $query = $this->em->createQuery('select p, s from ' . CompanyPerson::class . ' p join p.spouse s where p.name=\'Mary Smith\''); |
|
| 172 | + $query = $this->em->createQuery('select p, s from '.CompanyPerson::class.' p join p.spouse s where p.name=\'Mary Smith\''); |
|
| 173 | 173 | |
| 174 | 174 | $result = $query->getResult(); |
| 175 | 175 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | $this->em->clear(); |
| 203 | 203 | |
| 204 | - $query = $this->em->createQuery('select p, f from ' . CompanyPerson::class . ' p join p.friends f where p.name=?1'); |
|
| 204 | + $query = $this->em->createQuery('select p, f from '.CompanyPerson::class.' p join p.friends f where p.name=?1'); |
|
| 205 | 205 | |
| 206 | 206 | $query->setParameter(1, 'Roman'); |
| 207 | 207 | |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | $this->em->flush(); |
| 268 | 268 | $this->em->clear(); |
| 269 | 269 | |
| 270 | - $q = $this->em->createQuery('select a from ' . CompanyEvent::class . ' a where a.id = ?1'); |
|
| 270 | + $q = $this->em->createQuery('select a from '.CompanyEvent::class.' a where a.id = ?1'); |
|
| 271 | 271 | |
| 272 | 272 | $q->setParameter(1, $event1->getId()); |
| 273 | 273 | |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | |
| 279 | 279 | $this->em->clear(); |
| 280 | 280 | |
| 281 | - $q = $this->em->createQuery('select a from ' . CompanyOrganization::class . ' a where a.id = ?1'); |
|
| 281 | + $q = $this->em->createQuery('select a from '.CompanyOrganization::class.' a where a.id = ?1'); |
|
| 282 | 282 | |
| 283 | 283 | $q->setParameter(1, $org->getId()); |
| 284 | 284 | |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | */ |
| 300 | 300 | public function testBulkUpdateIssueDDC368() |
| 301 | 301 | { |
| 302 | - $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.salary = 1') |
|
| 302 | + $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.salary = 1') |
|
| 303 | 303 | ->execute(); |
| 304 | 304 | |
| 305 | - $result = $this->em->createQuery('SELECT count(p.id) FROM ' . CompanyEmployee::class . ' p WHERE p.salary = 1') |
|
| 305 | + $result = $this->em->createQuery('SELECT count(p.id) FROM '.CompanyEmployee::class.' p WHERE p.salary = 1') |
|
| 306 | 306 | ->getResult(); |
| 307 | 307 | |
| 308 | 308 | self::assertGreaterThan(0, $result); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | */ |
| 314 | 314 | public function testBulkUpdateNonScalarParameterDDC1341() |
| 315 | 315 | { |
| 316 | - $this->em->createQuery('UPDATE ' . CompanyEmployee::class . ' AS p SET p.startDate = ?0 WHERE p.department = ?1') |
|
| 316 | + $this->em->createQuery('UPDATE '.CompanyEmployee::class.' AS p SET p.startDate = ?0 WHERE p.department = ?1') |
|
| 317 | 317 | ->setParameter(0, new \DateTime()) |
| 318 | 318 | ->setParameter(1, 'IT') |
| 319 | 319 | ->execute(); |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | $this->em->flush(); |
| 372 | 372 | $this->em->clear(); |
| 373 | 373 | |
| 374 | - $dqlManager = $this->em->createQuery('SELECT m FROM ' . CompanyManager::class . ' m WHERE m.spouse = ?1') |
|
| 374 | + $dqlManager = $this->em->createQuery('SELECT m FROM '.CompanyManager::class.' m WHERE m.spouse = ?1') |
|
| 375 | 375 | ->setParameter(1, $person->getId()) |
| 376 | 376 | ->getSingleResult(); |
| 377 | 377 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | public function testCanRetrieveRepositoryFromClassNameWithLeadingBackslash() |
| 677 | 677 | { |
| 678 | 678 | self::assertSame( |
| 679 | - $this->em->getRepository('\\' . CmsUser::class), |
|
| 679 | + $this->em->getRepository('\\'.CmsUser::class), |
|
| 680 | 680 | $this->em->getRepository(CmsUser::class) |
| 681 | 681 | ); |
| 682 | 682 | } |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | $data = $repo->findBy(['user' => [1, 2, 3]]); |
| 715 | 715 | |
| 716 | 716 | $query = array_pop($this->sqlLoggerStack->queries); |
| 717 | - self::assertEquals([1,2,3], $query['params'][0]); |
|
| 717 | + self::assertEquals([1, 2, 3], $query['params'][0]); |
|
| 718 | 718 | self::assertEquals(Connection::PARAM_INT_ARRAY, $query['types'][0]); |
| 719 | 719 | } |
| 720 | 720 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $fix = new CompanyFixContract(); |
| 38 | 38 | $fix->setFixPrice(2000); |
| 39 | 39 | |
| 40 | - $this->listener->preFlushCalls = []; |
|
| 40 | + $this->listener->preFlushCalls = []; |
|
| 41 | 41 | |
| 42 | 42 | $this->em->persist($fix); |
| 43 | 43 | $this->em->flush(); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $this->em->flush(); |
| 58 | 58 | $this->em->clear(); |
| 59 | 59 | |
| 60 | - $this->listener->postLoadCalls = []; |
|
| 60 | + $this->listener->postLoadCalls = []; |
|
| 61 | 61 | |
| 62 | 62 | $dql = "SELECT f FROM Doctrine\Tests\Models\Company\CompanyFixContract f WHERE f.id = ?1"; |
| 63 | 63 | $fix = $this->em->createQuery($dql)->setParameter(1, $fix->getId())->getSingleResult(); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $fix = new CompanyFixContract(); |
| 74 | 74 | $fix->setFixPrice(2000); |
| 75 | 75 | |
| 76 | - $this->listener->prePersistCalls = []; |
|
| 76 | + $this->listener->prePersistCalls = []; |
|
| 77 | 77 | |
| 78 | 78 | $this->em->persist($fix); |
| 79 | 79 | $this->em->flush(); |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -1115,11 +1115,11 @@ discard block |
||
| 1115 | 1115 | { |
| 1116 | 1116 | public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) |
| 1117 | 1117 | { |
| 1118 | - if (!in_array("LocaleAware", $targetEntity->getReflectionClass()->getInterfaceNames())) { |
|
| 1118 | + if ( ! in_array("LocaleAware", $targetEntity->getReflectionClass()->getInterfaceNames())) { |
|
| 1119 | 1119 | return ""; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | - return $targetTableAlias.'.locale = ' . $this->getParameter('locale'); // getParam uses connection to quote the value. |
|
| 1122 | + return $targetTableAlias.'.locale = '.$this->getParameter('locale'); // getParam uses connection to quote the value. |
|
| 1123 | 1123 | } |
| 1124 | 1124 | } |
| 1125 | 1125 | |
@@ -1131,7 +1131,7 @@ discard block |
||
| 1131 | 1131 | return ""; |
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | - return $targetTableAlias.'.country = ' . $this->getParameter('country'); // getParam uses connection to quote the value. |
|
| 1134 | + return $targetTableAlias.'.country = '.$this->getParameter('country'); // getParam uses connection to quote the value. |
|
| 1135 | 1135 | } |
| 1136 | 1136 | } |
| 1137 | 1137 | |
@@ -1143,7 +1143,7 @@ discard block |
||
| 1143 | 1143 | return ""; |
| 1144 | 1144 | } |
| 1145 | 1145 | |
| 1146 | - return $targetTableAlias.'.name LIKE ' . $this->getParameter('prefix'); // getParam uses connection to quote the value. |
|
| 1146 | + return $targetTableAlias.'.name LIKE '.$this->getParameter('prefix'); // getParam uses connection to quote the value. |
|
| 1147 | 1147 | } |
| 1148 | 1148 | } |
| 1149 | 1149 | |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | return ""; |
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | - return $targetTableAlias.'.topic = ' . $this->getParameter('topic'); // getParam uses connection to quote the value. |
|
| 1158 | + return $targetTableAlias.'.topic = '.$this->getParameter('topic'); // getParam uses connection to quote the value. |
|
| 1159 | 1159 | } |
| 1160 | 1160 | } |
| 1161 | 1161 | |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | return ""; |
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | - return $targetTableAlias.'.name LIKE ' . $this->getParameter('name'); |
|
| 1170 | + return $targetTableAlias.'.name LIKE '.$this->getParameter('name'); |
|
| 1171 | 1171 | } |
| 1172 | 1172 | } |
| 1173 | 1173 | |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | return ""; |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | - return $targetTableAlias.'."completed" = ' . $this->getParameter('completed'); |
|
| 1182 | + return $targetTableAlias.'."completed" = '.$this->getParameter('completed'); |
|
| 1183 | 1183 | } |
| 1184 | 1184 | } |
| 1185 | 1185 | |
@@ -1191,6 +1191,6 @@ discard block |
||
| 1191 | 1191 | return ""; |
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | - return $targetTableAlias.'.id = ' . $this->getParameter('id'); |
|
| 1194 | + return $targetTableAlias.'.id = '.$this->getParameter('id'); |
|
| 1195 | 1195 | } |
| 1196 | 1196 | } |