@@ -6,7 +6,6 @@ |
||
6 | 6 | |
7 | 7 | use Doctrine\DBAL\LockMode; |
8 | 8 | use Doctrine\DBAL\Types\Type; |
9 | -use Doctrine\ORM\Mapping\AssociationMetadata; |
|
10 | 9 | use Doctrine\ORM\Mapping\ClassMetadata; |
11 | 10 | use Doctrine\ORM\Mapping\FieldMetadata; |
12 | 11 | use Doctrine\ORM\Mapping\InheritanceType; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Query; |
6 | 6 | |
@@ -273,10 +273,10 @@ discard block |
||
273 | 273 | */ |
274 | 274 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
275 | 275 | { |
276 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
276 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
277 | 277 | |
278 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
279 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
278 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
279 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | return $this->tableAliasMap[$tableName]; |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
296 | 296 | { |
297 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
297 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
298 | 298 | |
299 | 299 | $this->tableAliasMap[$tableName] = $alias; |
300 | 300 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | */ |
309 | 309 | public function getSQLColumnAlias() |
310 | 310 | { |
311 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
311 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
312 | 312 | |
313 | 313 | } |
314 | 314 | |
@@ -336,14 +336,14 @@ discard block |
||
336 | 336 | |
337 | 337 | // If this is a joined association we must use left joins to preserve the correct result. |
338 | 338 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
339 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
339 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
340 | 340 | |
341 | 341 | $sqlParts = []; |
342 | 342 | |
343 | 343 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
344 | 344 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
345 | 345 | |
346 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
346 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | // Add filters on the root class |
@@ -365,14 +365,14 @@ discard block |
||
365 | 365 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
366 | 366 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
367 | 367 | |
368 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
368 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
369 | 369 | |
370 | 370 | $sqlParts = []; |
371 | 371 | |
372 | 372 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
373 | 373 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
374 | 374 | |
375 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
375 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
376 | 376 | } |
377 | 377 | |
378 | 378 | $sql .= implode(' AND ', $sqlParts); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | $qComp = $this->queryComponents[$dqlAlias]; |
394 | 394 | $association = $qComp['relation']; |
395 | 395 | |
396 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
396 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
397 | 397 | continue; |
398 | 398 | } |
399 | 399 | |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | $property = $qComp['metadata']->getProperty($fieldName); |
402 | 402 | $tableName = $property->getTableName(); |
403 | 403 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
404 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
404 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
405 | 405 | |
406 | 406 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
407 | 407 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | } |
410 | 410 | |
411 | 411 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
412 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
412 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
413 | 413 | } |
414 | 414 | } |
415 | 415 | |
@@ -449,19 +449,19 @@ discard block |
||
449 | 449 | $discrColumnType = $discrColumn->getType(); |
450 | 450 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
451 | 451 | $sqlTableAlias = ($this->useSqlTableAliases) |
452 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
452 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
453 | 453 | : ''; |
454 | 454 | |
455 | 455 | $sqlParts[] = sprintf( |
456 | 456 | '%s IN (%s)', |
457 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
457 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
458 | 458 | implode(', ', $values) |
459 | 459 | ); |
460 | 460 | } |
461 | 461 | |
462 | 462 | $sql = implode(' AND ', $sqlParts); |
463 | 463 | |
464 | - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
464 | + return (count($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 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | |
506 | 506 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
507 | 507 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
508 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
508 | + $filterClauses[] = '('.$filterExpr.')'; |
|
509 | 509 | } |
510 | 510 | } |
511 | 511 | |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | } |
538 | 538 | |
539 | 539 | if ( ! $AST->orderByClause && ($orderBySql = $this->generateOrderedCollectionOrderByItems())) { |
540 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
540 | + $sql .= ' ORDER BY '.$orderBySql; |
|
541 | 541 | } |
542 | 542 | |
543 | 543 | if ($limit !== null || $offset !== null) { |
@@ -549,11 +549,11 @@ discard block |
||
549 | 549 | } |
550 | 550 | |
551 | 551 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
552 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
552 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
553 | 553 | } |
554 | 554 | |
555 | 555 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
556 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
556 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
611 | 611 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
612 | 612 | |
613 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
613 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
614 | 614 | } |
615 | 615 | |
616 | 616 | return implode(', ', $sqlParts); |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | { |
629 | 629 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
630 | 630 | |
631 | - if (!$fieldName) { |
|
631 | + if ( ! $fieldName) { |
|
632 | 632 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
633 | 633 | } |
634 | 634 | |
@@ -657,7 +657,7 @@ discard block |
||
657 | 657 | $property = $class->getProperty($fieldName); |
658 | 658 | |
659 | 659 | if ($this->useSqlTableAliases) { |
660 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
660 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
661 | 661 | } |
662 | 662 | |
663 | 663 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -671,7 +671,7 @@ discard block |
||
671 | 671 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
672 | 672 | $association = $class->getProperty($fieldName); |
673 | 673 | |
674 | - if (! $association->isOwningSide()) { |
|
674 | + if ( ! $association->isOwningSide()) { |
|
675 | 675 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
676 | 676 | } |
677 | 677 | |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | $joinColumn = reset($joinColumns); |
686 | 686 | |
687 | 687 | if ($this->useSqlTableAliases) { |
688 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
688 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
689 | 689 | } |
690 | 690 | |
691 | 691 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -703,7 +703,7 @@ discard block |
||
703 | 703 | */ |
704 | 704 | public function walkSelectClause($selectClause) |
705 | 705 | { |
706 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
706 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
707 | 707 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
708 | 708 | |
709 | 709 | 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,13 +754,13 @@ 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 | continue; |
759 | - } else if (! $addMetaColumns && ! $association->isPrimaryKey()) { |
|
759 | + } else if ( ! $addMetaColumns && ! $association->isPrimaryKey()) { |
|
760 | 760 | continue; |
761 | 761 | } |
762 | 762 | |
763 | - $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
763 | + $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
764 | 764 | |
765 | 765 | foreach ($association->getJoinColumns() as $joinColumn) { |
766 | 766 | /** @var JoinColumnMetadata $joinColumn */ |
@@ -770,7 +770,7 @@ discard block |
||
770 | 770 | $columnAlias = $this->getSQLColumnAlias(); |
771 | 771 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
772 | 772 | |
773 | - if (! $joinColumn->getType()) { |
|
773 | + if ( ! $joinColumn->getType()) { |
|
774 | 774 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
775 | 775 | } |
776 | 776 | |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | continue; |
801 | 801 | } |
802 | 802 | |
803 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
803 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
804 | 804 | continue; |
805 | 805 | } |
806 | 806 | |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | $columnAlias = $this->getSQLColumnAlias(); |
815 | 815 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
816 | 816 | |
817 | - if (! $joinColumn->getType()) { |
|
817 | + if ( ! $joinColumn->getType()) { |
|
818 | 818 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
819 | 819 | } |
820 | 820 | |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
849 | 849 | } |
850 | 850 | |
851 | - return ' FROM ' . implode(', ', $sqlParts); |
|
851 | + return ' FROM '.implode(', ', $sqlParts); |
|
852 | 852 | } |
853 | 853 | |
854 | 854 | /** |
@@ -915,7 +915,7 @@ discard block |
||
915 | 915 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
916 | 916 | |
917 | 917 | $sql = $this->platform->appendLockHint( |
918 | - $tableName . ' ' . $tableAlias, |
|
918 | + $tableName.' '.$tableAlias, |
|
919 | 919 | $this->query->getHint(Query::HINT_LOCK_MODE) |
920 | 920 | ); |
921 | 921 | |
@@ -960,7 +960,7 @@ discard block |
||
960 | 960 | ; |
961 | 961 | |
962 | 962 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && |
963 | - (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
963 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
964 | 964 | if ($association instanceof ToManyAssociationMetadata) { |
965 | 965 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
966 | 966 | } |
@@ -1014,7 +1014,7 @@ discard block |
||
1014 | 1014 | } |
1015 | 1015 | |
1016 | 1016 | $targetTableJoin = [ |
1017 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1017 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1018 | 1018 | 'condition' => implode(' AND ', $conditions), |
1019 | 1019 | ]; |
1020 | 1020 | } else if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1042,7 +1042,7 @@ discard block |
||
1042 | 1042 | ); |
1043 | 1043 | } |
1044 | 1044 | |
1045 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1045 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1046 | 1046 | |
1047 | 1047 | // Join target table |
1048 | 1048 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1081,7 +1081,7 @@ discard block |
||
1081 | 1081 | } |
1082 | 1082 | |
1083 | 1083 | $targetTableJoin = [ |
1084 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1084 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1085 | 1085 | 'condition' => implode(' AND ', $conditions), |
1086 | 1086 | ]; |
1087 | 1087 | } else { |
@@ -1089,23 +1089,23 @@ discard block |
||
1089 | 1089 | } |
1090 | 1090 | |
1091 | 1091 | // Handle WITH clause |
1092 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1092 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1093 | 1093 | |
1094 | 1094 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
1095 | 1095 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1096 | 1096 | |
1097 | 1097 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1098 | 1098 | if ($withCondition) { |
1099 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1099 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1100 | 1100 | } else { |
1101 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1101 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1102 | 1102 | } |
1103 | 1103 | } else { |
1104 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1104 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | if ($withCondition) { |
1108 | - $sql .= ' AND ' . $withCondition; |
|
1108 | + $sql .= ' AND '.$withCondition; |
|
1109 | 1109 | } |
1110 | 1110 | |
1111 | 1111 | // Apply the indexes |
@@ -1138,7 +1138,7 @@ discard block |
||
1138 | 1138 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1139 | 1139 | } |
1140 | 1140 | |
1141 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1141 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1142 | 1142 | } |
1143 | 1143 | |
1144 | 1144 | /** |
@@ -1155,10 +1155,10 @@ discard block |
||
1155 | 1155 | $this->orderedColumnsMap[$sql] = $type; |
1156 | 1156 | |
1157 | 1157 | if ($expr instanceof AST\Subselect) { |
1158 | - return '(' . $sql . ') ' . $type; |
|
1158 | + return '('.$sql.') '.$type; |
|
1159 | 1159 | } |
1160 | 1160 | |
1161 | - return $sql . ' ' . $type; |
|
1161 | + return $sql.' '.$type; |
|
1162 | 1162 | } |
1163 | 1163 | |
1164 | 1164 | /** |
@@ -1166,7 +1166,7 @@ discard block |
||
1166 | 1166 | */ |
1167 | 1167 | public function walkHavingClause($havingClause) |
1168 | 1168 | { |
1169 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1169 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1170 | 1170 | } |
1171 | 1171 | |
1172 | 1172 | /** |
@@ -1189,7 +1189,7 @@ discard block |
||
1189 | 1189 | $conditions = []; |
1190 | 1190 | |
1191 | 1191 | if ($join->conditionalExpression) { |
1192 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1192 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1193 | 1193 | } |
1194 | 1194 | |
1195 | 1195 | $condExprConjunction = ($class->inheritanceType === InheritanceType::JOINED && $joinType !== AST\Join::JOIN_TYPE_LEFT && $joinType !== AST\Join::JOIN_TYPE_LEFTOUTER) |
@@ -1213,7 +1213,7 @@ discard block |
||
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | if ($conditions) { |
1216 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1216 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1217 | 1217 | } |
1218 | 1218 | |
1219 | 1219 | break; |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1244 | 1244 | } |
1245 | 1245 | |
1246 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1246 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1247 | 1247 | |
1248 | 1248 | return $sql; |
1249 | 1249 | } |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1266 | 1266 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1267 | 1267 | |
1268 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1268 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1269 | 1269 | } |
1270 | 1270 | |
1271 | 1271 | /** |
@@ -1280,11 +1280,11 @@ discard block |
||
1280 | 1280 | $sql = 'CASE'; |
1281 | 1281 | |
1282 | 1282 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1283 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1284 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1283 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1284 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1285 | 1285 | } |
1286 | 1286 | |
1287 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1287 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1288 | 1288 | |
1289 | 1289 | return $sql; |
1290 | 1290 | } |
@@ -1298,14 +1298,14 @@ discard block |
||
1298 | 1298 | */ |
1299 | 1299 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1300 | 1300 | { |
1301 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1301 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1302 | 1302 | |
1303 | 1303 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1304 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1305 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1304 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1305 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1306 | 1306 | } |
1307 | 1307 | |
1308 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1308 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1309 | 1309 | |
1310 | 1310 | return $sql; |
1311 | 1311 | } |
@@ -1367,7 +1367,7 @@ discard block |
||
1367 | 1367 | $columnAlias = $this->getSQLColumnAlias(); |
1368 | 1368 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1369 | 1369 | |
1370 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1370 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1371 | 1371 | |
1372 | 1372 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1373 | 1373 | |
@@ -1382,7 +1382,7 @@ discard block |
||
1382 | 1382 | $columnAlias = $this->getSQLColumnAlias(); |
1383 | 1383 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1384 | 1384 | |
1385 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1385 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1386 | 1386 | |
1387 | 1387 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1388 | 1388 | |
@@ -1393,7 +1393,7 @@ discard block |
||
1393 | 1393 | break; |
1394 | 1394 | |
1395 | 1395 | case ($expr instanceof AST\NewObjectExpression): |
1396 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1396 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1397 | 1397 | break; |
1398 | 1398 | |
1399 | 1399 | default: |
@@ -1422,7 +1422,7 @@ discard block |
||
1422 | 1422 | |
1423 | 1423 | // Select all fields from the queried class |
1424 | 1424 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1425 | - if (! ($property instanceof FieldMetadata)) { |
|
1425 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1426 | 1426 | continue; |
1427 | 1427 | } |
1428 | 1428 | |
@@ -1457,11 +1457,11 @@ discard block |
||
1457 | 1457 | $subClass = $this->em->getClassMetadata($subClassName); |
1458 | 1458 | |
1459 | 1459 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1460 | - if (! ($property instanceof FieldMetadata)) { |
|
1460 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1461 | 1461 | continue; |
1462 | 1462 | } |
1463 | 1463 | |
1464 | - if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
1464 | + if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
1465 | 1465 | continue; |
1466 | 1466 | } |
1467 | 1467 | |
@@ -1496,7 +1496,7 @@ discard block |
||
1496 | 1496 | */ |
1497 | 1497 | public function walkQuantifiedExpression($qExpr) |
1498 | 1498 | { |
1499 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1499 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | /** |
@@ -1536,7 +1536,7 @@ discard block |
||
1536 | 1536 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1537 | 1537 | } |
1538 | 1538 | |
1539 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1539 | + return ' FROM '.implode(', ', $sqlParts); |
|
1540 | 1540 | } |
1541 | 1541 | |
1542 | 1542 | /** |
@@ -1544,7 +1544,7 @@ discard block |
||
1544 | 1544 | */ |
1545 | 1545 | public function walkSimpleSelectClause($simpleSelectClause) |
1546 | 1546 | { |
1547 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1547 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1548 | 1548 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1549 | 1549 | } |
1550 | 1550 | |
@@ -1563,10 +1563,10 @@ discard block |
||
1563 | 1563 | * @param null|string $newObjectResultAlias |
1564 | 1564 | * @return string The SQL. |
1565 | 1565 | */ |
1566 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1566 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1567 | 1567 | { |
1568 | 1568 | $sqlSelectExpressions = []; |
1569 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
1569 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
1570 | 1570 | |
1571 | 1571 | foreach ($newObjectExpression->args as $argIndex => $e) { |
1572 | 1572 | $resultAlias = $this->scalarResultCounter++; |
@@ -1579,7 +1579,7 @@ discard block |
||
1579 | 1579 | break; |
1580 | 1580 | |
1581 | 1581 | case ($e instanceof AST\Subselect): |
1582 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1582 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1583 | 1583 | break; |
1584 | 1584 | |
1585 | 1585 | case ($e instanceof AST\PathExpression): |
@@ -1588,7 +1588,7 @@ discard block |
||
1588 | 1588 | $class = $qComp['metadata']; |
1589 | 1589 | $fieldType = $class->getProperty($e->field)->getType(); |
1590 | 1590 | |
1591 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1591 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1592 | 1592 | break; |
1593 | 1593 | |
1594 | 1594 | case ($e instanceof AST\Literal): |
@@ -1602,11 +1602,11 @@ discard block |
||
1602 | 1602 | break; |
1603 | 1603 | } |
1604 | 1604 | |
1605 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1605 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1606 | 1606 | break; |
1607 | 1607 | |
1608 | 1608 | default: |
1609 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1609 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1610 | 1610 | break; |
1611 | 1611 | } |
1612 | 1612 | |
@@ -1639,10 +1639,10 @@ discard block |
||
1639 | 1639 | case ($expr instanceof AST\Subselect): |
1640 | 1640 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1641 | 1641 | |
1642 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1642 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1643 | 1643 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1644 | 1644 | |
1645 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1645 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1646 | 1646 | break; |
1647 | 1647 | |
1648 | 1648 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1659,7 +1659,7 @@ discard block |
||
1659 | 1659 | $columnAlias = $this->getSQLColumnAlias(); |
1660 | 1660 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1661 | 1661 | |
1662 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1662 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1663 | 1663 | break; |
1664 | 1664 | |
1665 | 1665 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1679,8 +1679,8 @@ discard block |
||
1679 | 1679 | */ |
1680 | 1680 | public function walkAggregateExpression($aggExpression) |
1681 | 1681 | { |
1682 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1683 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1682 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1683 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1684 | 1684 | } |
1685 | 1685 | |
1686 | 1686 | /** |
@@ -1694,7 +1694,7 @@ discard block |
||
1694 | 1694 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1695 | 1695 | } |
1696 | 1696 | |
1697 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1697 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1698 | 1698 | } |
1699 | 1699 | |
1700 | 1700 | /** |
@@ -1757,7 +1757,7 @@ discard block |
||
1757 | 1757 | { |
1758 | 1758 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1759 | 1759 | $tableName = $class->getTableName(); |
1760 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1760 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
1761 | 1761 | |
1762 | 1762 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1763 | 1763 | |
@@ -1773,12 +1773,12 @@ discard block |
||
1773 | 1773 | { |
1774 | 1774 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1775 | 1775 | $tableName = $class->getTableName(); |
1776 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1776 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
1777 | 1777 | |
1778 | 1778 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1779 | 1779 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1780 | 1780 | |
1781 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1781 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1782 | 1782 | |
1783 | 1783 | return $sql; |
1784 | 1784 | } |
@@ -1791,7 +1791,7 @@ discard block |
||
1791 | 1791 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1792 | 1792 | $this->useSqlTableAliases = false; |
1793 | 1793 | |
1794 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1794 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1795 | 1795 | $newValue = $updateItem->newValue; |
1796 | 1796 | |
1797 | 1797 | switch (true) { |
@@ -1834,7 +1834,7 @@ discard block |
||
1834 | 1834 | |
1835 | 1835 | if (count($filterClauses)) { |
1836 | 1836 | if ($condSql) { |
1837 | - $condSql = '(' . $condSql . ') AND '; |
|
1837 | + $condSql = '('.$condSql.') AND '; |
|
1838 | 1838 | } |
1839 | 1839 | |
1840 | 1840 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1842,11 +1842,11 @@ discard block |
||
1842 | 1842 | } |
1843 | 1843 | |
1844 | 1844 | if ($condSql) { |
1845 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1845 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1846 | 1846 | } |
1847 | 1847 | |
1848 | 1848 | if ($discrSql) { |
1849 | - return ' WHERE ' . $discrSql; |
|
1849 | + return ' WHERE '.$discrSql; |
|
1850 | 1850 | } |
1851 | 1851 | |
1852 | 1852 | return ''; |
@@ -1889,7 +1889,7 @@ discard block |
||
1889 | 1889 | // if only one ConditionalPrimary is defined |
1890 | 1890 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1891 | 1891 | ? $this->walkConditionalPrimary($factor) |
1892 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1892 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1893 | 1893 | } |
1894 | 1894 | |
1895 | 1895 | /** |
@@ -1904,7 +1904,7 @@ discard block |
||
1904 | 1904 | if ($primary->isConditionalExpression()) { |
1905 | 1905 | $condExpr = $primary->conditionalExpression; |
1906 | 1906 | |
1907 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1907 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1908 | 1908 | } |
1909 | 1909 | } |
1910 | 1910 | |
@@ -1915,7 +1915,7 @@ discard block |
||
1915 | 1915 | { |
1916 | 1916 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1917 | 1917 | |
1918 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1918 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1919 | 1919 | |
1920 | 1920 | return $sql; |
1921 | 1921 | } |
@@ -1964,7 +1964,7 @@ discard block |
||
1964 | 1964 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1965 | 1965 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1966 | 1966 | |
1967 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
1967 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
1968 | 1968 | |
1969 | 1969 | $sqlParts = []; |
1970 | 1970 | |
@@ -1985,7 +1985,7 @@ discard block |
||
1985 | 1985 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1986 | 1986 | } |
1987 | 1987 | |
1988 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
1988 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
1989 | 1989 | } |
1990 | 1990 | |
1991 | 1991 | $sql .= implode(' AND ', $sqlParts); |
@@ -1999,7 +1999,7 @@ discard block |
||
1999 | 1999 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
2000 | 2000 | |
2001 | 2001 | // join to target table |
2002 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
2002 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
2003 | 2003 | |
2004 | 2004 | // join conditions |
2005 | 2005 | $joinSqlParts = []; |
@@ -2050,13 +2050,13 @@ discard block |
||
2050 | 2050 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2051 | 2051 | } |
2052 | 2052 | |
2053 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2053 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2054 | 2054 | } |
2055 | 2055 | |
2056 | 2056 | $sql .= implode(' AND ', $sqlParts); |
2057 | 2057 | } |
2058 | 2058 | |
2059 | - return $sql . ')'; |
|
2059 | + return $sql.')'; |
|
2060 | 2060 | } |
2061 | 2061 | |
2062 | 2062 | /** |
@@ -2067,7 +2067,7 @@ discard block |
||
2067 | 2067 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2068 | 2068 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2069 | 2069 | |
2070 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2070 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2071 | 2071 | } |
2072 | 2072 | |
2073 | 2073 | /** |
@@ -2076,19 +2076,19 @@ discard block |
||
2076 | 2076 | public function walkNullComparisonExpression($nullCompExpr) |
2077 | 2077 | { |
2078 | 2078 | $expression = $nullCompExpr->expression; |
2079 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2079 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2080 | 2080 | |
2081 | 2081 | // Handle ResultVariable |
2082 | 2082 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2083 | - return $this->walkResultVariable($expression) . $comparison; |
|
2083 | + return $this->walkResultVariable($expression).$comparison; |
|
2084 | 2084 | } |
2085 | 2085 | |
2086 | 2086 | // Handle InputParameter mapping inclusion to ParserResult |
2087 | 2087 | if ($expression instanceof AST\InputParameter) { |
2088 | - return $this->walkInputParameter($expression) . $comparison; |
|
2088 | + return $this->walkInputParameter($expression).$comparison; |
|
2089 | 2089 | } |
2090 | 2090 | |
2091 | - return $expression->dispatch($this) . $comparison; |
|
2091 | + return $expression->dispatch($this).$comparison; |
|
2092 | 2092 | } |
2093 | 2093 | |
2094 | 2094 | /** |
@@ -2096,7 +2096,7 @@ discard block |
||
2096 | 2096 | */ |
2097 | 2097 | public function walkInExpression($inExpr) |
2098 | 2098 | { |
2099 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2099 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2100 | 2100 | |
2101 | 2101 | $sql .= ($inExpr->subselect) |
2102 | 2102 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2119,7 +2119,7 @@ discard block |
||
2119 | 2119 | $discrColumnType = $discrColumn->getType(); |
2120 | 2120 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
2121 | 2121 | $sqlTableAlias = $this->useSqlTableAliases |
2122 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
2122 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
2123 | 2123 | : ''; |
2124 | 2124 | |
2125 | 2125 | $sqlParameterList = []; |
@@ -2149,7 +2149,7 @@ discard block |
||
2149 | 2149 | |
2150 | 2150 | return sprintf( |
2151 | 2151 | '%s %sIN (%s)', |
2152 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
2152 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
2153 | 2153 | ($instanceOfExpr->not ? 'NOT ' : ''), |
2154 | 2154 | implode(', ', $sqlParameterList) |
2155 | 2155 | ); |
@@ -2196,8 +2196,8 @@ discard block |
||
2196 | 2196 | $sql .= ' NOT'; |
2197 | 2197 | } |
2198 | 2198 | |
2199 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2200 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2199 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2200 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2201 | 2201 | |
2202 | 2202 | return $sql; |
2203 | 2203 | } |
@@ -2212,7 +2212,7 @@ discard block |
||
2212 | 2212 | ? $this->walkResultVariable($stringExpr) |
2213 | 2213 | : $stringExpr->dispatch($this); |
2214 | 2214 | |
2215 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2215 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2216 | 2216 | |
2217 | 2217 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2218 | 2218 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2225,7 +2225,7 @@ discard block |
||
2225 | 2225 | } |
2226 | 2226 | |
2227 | 2227 | if ($likeExpr->escapeChar) { |
2228 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2228 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2229 | 2229 | } |
2230 | 2230 | |
2231 | 2231 | return $sql; |
@@ -2252,7 +2252,7 @@ discard block |
||
2252 | 2252 | ? $leftExpr->dispatch($this) |
2253 | 2253 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2254 | 2254 | |
2255 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2255 | + $sql .= ' '.$compExpr->operator.' '; |
|
2256 | 2256 | |
2257 | 2257 | $sql .= ($rightExpr instanceof AST\Node) |
2258 | 2258 | ? $rightExpr->dispatch($this) |
@@ -2284,7 +2284,7 @@ discard block |
||
2284 | 2284 | { |
2285 | 2285 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2286 | 2286 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2287 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2287 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2288 | 2288 | } |
2289 | 2289 | |
2290 | 2290 | /** |
@@ -2338,7 +2338,7 @@ discard block |
||
2338 | 2338 | |
2339 | 2339 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2340 | 2340 | |
2341 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2341 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2342 | 2342 | } |
2343 | 2343 | |
2344 | 2344 | /** |
@@ -2351,7 +2351,7 @@ discard block |
||
2351 | 2351 | public function walkArithmeticPrimary($primary) |
2352 | 2352 | { |
2353 | 2353 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2354 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2354 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2355 | 2355 | } |
2356 | 2356 | |
2357 | 2357 | if ($primary instanceof AST\Node) { |
@@ -4,9 +4,7 @@ |
||
4 | 4 | |
5 | 5 | namespace Doctrine\Tests\Models\Company; |
6 | 6 | |
7 | -use Doctrine\DBAL\Types\Type; |
|
8 | 7 | use Doctrine\ORM\Annotation as ORM; |
9 | -use Doctrine\ORM\Mapping; |
|
10 | 8 | |
11 | 9 | /** |
12 | 10 | * @ORM\Entity |
@@ -5,9 +5,7 @@ |
||
5 | 5 | namespace Doctrine\Tests\Models\DDC3579; |
6 | 6 | |
7 | 7 | use Doctrine\Common\Collections\ArrayCollection; |
8 | -use Doctrine\DBAL\Types\Type; |
|
9 | 8 | use Doctrine\ORM\Annotation as ORM; |
10 | -use Doctrine\ORM\Mapping; |
|
11 | 9 | |
12 | 10 | /** |
13 | 11 | * @ORM\MappedSuperClass |
@@ -12,7 +12,6 @@ |
||
12 | 12 | use Doctrine\ORM\Mapping\ClassMetadata; |
13 | 13 | use Doctrine\ORM\Mapping\Driver\AnnotationDriver; |
14 | 14 | use Doctrine\ORM\Mapping\Driver\XmlDriver; |
15 | -use Doctrine\ORM\Mapping\Driver\PHPDriver; |
|
16 | 15 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
17 | 16 | use Doctrine\ORM\Mapping\OneToManyAssociationMetadata; |
18 | 17 | use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory; |
@@ -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\Mapping\Driver; |
6 | 6 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | return $this->classNames; |
186 | 186 | } |
187 | 187 | |
188 | - if (!$this->paths) { |
|
188 | + if ( ! $this->paths) { |
|
189 | 189 | throw Mapping\MappingException::pathRequired(); |
190 | 190 | } |
191 | 191 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
203 | 203 | \RecursiveIteratorIterator::LEAVES_ONLY |
204 | 204 | ), |
205 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
205 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
206 | 206 | \RecursiveRegexIterator::GET_MATCH |
207 | 207 | ); |
208 | 208 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | { |
255 | 255 | $reflectionClass = $metadata->getReflectionClass(); |
256 | 256 | |
257 | - if (! $reflectionClass) { |
|
257 | + if ( ! $reflectionClass) { |
|
258 | 258 | // this happens when running annotation driver in combination with |
259 | 259 | // static reflection services. This is not the nicest fix |
260 | 260 | $reflectionClass = new \ReflectionClass($metadata->getClassName()); |
@@ -354,11 +354,11 @@ discard block |
||
354 | 354 | $discriminatorColumn->setType(Type::getType($typeName)); |
355 | 355 | $discriminatorColumn->setColumnName($discriminatorColumnAnnotation->name); |
356 | 356 | |
357 | - if (! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
357 | + if ( ! empty($discriminatorColumnAnnotation->columnDefinition)) { |
|
358 | 358 | $discriminatorColumn->setColumnDefinition($discriminatorColumnAnnotation->columnDefinition); |
359 | 359 | } |
360 | 360 | |
361 | - if (! empty($discriminatorColumnAnnotation->length)) { |
|
361 | + if ( ! empty($discriminatorColumnAnnotation->length)) { |
|
362 | 362 | $discriminatorColumn->setLength($discriminatorColumnAnnotation->length); |
363 | 363 | } |
364 | 364 | } |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | if (isset($classAnnotations[Annotation\DiscriminatorMap::class])) { |
370 | 370 | $discriminatorMapAnnotation = $classAnnotations[Annotation\DiscriminatorMap::class]; |
371 | 371 | $discriminatorMap = array_map( |
372 | - function ($className) use ($classMetadata) { |
|
372 | + function($className) use ($classMetadata) { |
|
373 | 373 | return $classMetadata->fullyQualifiedClassName($className); |
374 | 374 | }, |
375 | 375 | $discriminatorMapAnnotation->value |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | foreach ($entityListenersAnnot->value as $item) { |
398 | 398 | $listenerClassName = $metadata->fullyQualifiedClassName($item); |
399 | 399 | |
400 | - if (! class_exists($listenerClassName)) { |
|
400 | + if ( ! class_exists($listenerClassName)) { |
|
401 | 401 | throw Mapping\MappingException::entityListenerClassNotFound( |
402 | 402 | $listenerClassName, |
403 | 403 | $classMetadata->getClassName() |
@@ -513,7 +513,7 @@ discard block |
||
513 | 513 | $fieldName = $associationOverride->name; |
514 | 514 | $property = $classMetadata->getProperty($fieldName); |
515 | 515 | |
516 | - if (! $property) { |
|
516 | + if ( ! $property) { |
|
517 | 517 | throw Mapping\MappingException::invalidOverrideFieldName($classMetadata->getClassName(), $fieldName); |
518 | 518 | } |
519 | 519 | |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | // Check for fetch |
548 | 548 | if ($associationOverride->fetch) { |
549 | 549 | $override->setFetchMode( |
550 | - constant(Mapping\FetchMode::class . '::' . $associationOverride->fetch) |
|
550 | + constant(Mapping\FetchMode::class.'::'.$associationOverride->fetch) |
|
551 | 551 | ); |
552 | 552 | } |
553 | 553 | |
@@ -625,7 +625,7 @@ discard block |
||
625 | 625 | ) |
626 | 626 | { |
627 | 627 | /** @var Annotation\Entity $entityAnnot */ |
628 | - $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
628 | + $entityAnnot = $classAnnotations[Annotation\Entity::class]; |
|
629 | 629 | |
630 | 630 | if ($entityAnnot->repositoryClass !== null) { |
631 | 631 | $metadata->setCustomRepositoryClassName( |
@@ -809,11 +809,11 @@ discard block |
||
809 | 809 | $assocMetadata->setOrphanRemoval($oneToOneAnnot->orphanRemoval); |
810 | 810 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToOneAnnot->fetch)); |
811 | 811 | |
812 | - if (! empty($oneToOneAnnot->mappedBy)) { |
|
812 | + if ( ! empty($oneToOneAnnot->mappedBy)) { |
|
813 | 813 | $assocMetadata->setMappedBy($oneToOneAnnot->mappedBy); |
814 | 814 | } |
815 | 815 | |
816 | - if (! empty($oneToOneAnnot->inversedBy)) { |
|
816 | + if ( ! empty($oneToOneAnnot->inversedBy)) { |
|
817 | 817 | $assocMetadata->setInversedBy($oneToOneAnnot->inversedBy); |
818 | 818 | } |
819 | 819 | |
@@ -866,13 +866,13 @@ discard block |
||
866 | 866 | $fieldName = $reflProperty->getName(); |
867 | 867 | $manyToOneAnnot = $propertyAnnotations[Annotation\ManyToOne::class]; |
868 | 868 | $assocMetadata = new Mapping\ManyToOneAssociationMetadata($fieldName); |
869 | - $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity); |
|
869 | + $targetEntity = $metadata->fullyQualifiedClassName($manyToOneAnnot->targetEntity); |
|
870 | 870 | |
871 | 871 | $assocMetadata->setTargetEntity($targetEntity); |
872 | 872 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $manyToOneAnnot->cascade)); |
873 | 873 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToOneAnnot->fetch)); |
874 | 874 | |
875 | - if (! empty($manyToOneAnnot->inversedBy)) { |
|
875 | + if ( ! empty($manyToOneAnnot->inversedBy)) { |
|
876 | 876 | $assocMetadata->setInversedBy($manyToOneAnnot->inversedBy); |
877 | 877 | } |
878 | 878 | |
@@ -925,18 +925,18 @@ discard block |
||
925 | 925 | $fieldName = $reflProperty->getName(); |
926 | 926 | $oneToManyAnnot = $propertyAnnotations[Annotation\OneToMany::class]; |
927 | 927 | $assocMetadata = new Mapping\OneToManyAssociationMetadata($fieldName); |
928 | - $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity); |
|
928 | + $targetEntity = $metadata->fullyQualifiedClassName($oneToManyAnnot->targetEntity); |
|
929 | 929 | |
930 | 930 | $assocMetadata->setTargetEntity($targetEntity); |
931 | 931 | $assocMetadata->setCascade($this->getCascade($className, $fieldName, $oneToManyAnnot->cascade)); |
932 | 932 | $assocMetadata->setOrphanRemoval($oneToManyAnnot->orphanRemoval); |
933 | 933 | $assocMetadata->setFetchMode($this->getFetchMode($className, $oneToManyAnnot->fetch)); |
934 | 934 | |
935 | - if (! empty($oneToManyAnnot->mappedBy)) { |
|
935 | + if ( ! empty($oneToManyAnnot->mappedBy)) { |
|
936 | 936 | $assocMetadata->setMappedBy($oneToManyAnnot->mappedBy); |
937 | 937 | } |
938 | 938 | |
939 | - if (! empty($oneToManyAnnot->indexBy)) { |
|
939 | + if ( ! empty($oneToManyAnnot->indexBy)) { |
|
940 | 940 | $assocMetadata->setIndexedBy($oneToManyAnnot->indexBy); |
941 | 941 | } |
942 | 942 | |
@@ -980,15 +980,15 @@ discard block |
||
980 | 980 | $assocMetadata->setOrphanRemoval($manyToManyAnnot->orphanRemoval); |
981 | 981 | $assocMetadata->setFetchMode($this->getFetchMode($className, $manyToManyAnnot->fetch)); |
982 | 982 | |
983 | - if (! empty($manyToManyAnnot->mappedBy)) { |
|
983 | + if ( ! empty($manyToManyAnnot->mappedBy)) { |
|
984 | 984 | $assocMetadata->setMappedBy($manyToManyAnnot->mappedBy); |
985 | 985 | } |
986 | 986 | |
987 | - if (! empty($manyToManyAnnot->inversedBy)) { |
|
987 | + if ( ! empty($manyToManyAnnot->inversedBy)) { |
|
988 | 988 | $assocMetadata->setInversedBy($manyToManyAnnot->inversedBy); |
989 | 989 | } |
990 | 990 | |
991 | - if (! empty($manyToManyAnnot->indexBy)) { |
|
991 | + if ( ! empty($manyToManyAnnot->indexBy)) { |
|
992 | 992 | $assocMetadata->setIndexedBy($manyToManyAnnot->indexBy); |
993 | 993 | } |
994 | 994 | |
@@ -1045,15 +1045,15 @@ discard block |
||
1045 | 1045 | |
1046 | 1046 | $fieldMetadata->setType(Type::getType($columnAnnot->type)); |
1047 | 1047 | |
1048 | - if (! empty($columnAnnot->name)) { |
|
1048 | + if ( ! empty($columnAnnot->name)) { |
|
1049 | 1049 | $fieldMetadata->setColumnName($columnAnnot->name); |
1050 | 1050 | } |
1051 | 1051 | |
1052 | - if (! empty($columnAnnot->columnDefinition)) { |
|
1052 | + if ( ! empty($columnAnnot->columnDefinition)) { |
|
1053 | 1053 | $fieldMetadata->setColumnDefinition($columnAnnot->columnDefinition); |
1054 | 1054 | } |
1055 | 1055 | |
1056 | - if (! empty($columnAnnot->length)) { |
|
1056 | + if ( ! empty($columnAnnot->length)) { |
|
1057 | 1057 | $fieldMetadata->setLength($columnAnnot->length); |
1058 | 1058 | } |
1059 | 1059 | |
@@ -1082,11 +1082,11 @@ discard block |
||
1082 | 1082 | { |
1083 | 1083 | $table = new Mapping\TableMetadata(); |
1084 | 1084 | |
1085 | - if (! empty($tableAnnot->name)) { |
|
1085 | + if ( ! empty($tableAnnot->name)) { |
|
1086 | 1086 | $table->setName($tableAnnot->name); |
1087 | 1087 | } |
1088 | 1088 | |
1089 | - if (! empty($tableAnnot->schema)) { |
|
1089 | + if ( ! empty($tableAnnot->schema)) { |
|
1090 | 1090 | $table->setSchema($tableAnnot->schema); |
1091 | 1091 | } |
1092 | 1092 | |
@@ -1129,11 +1129,11 @@ discard block |
||
1129 | 1129 | { |
1130 | 1130 | $joinTable = new Mapping\JoinTableMetadata(); |
1131 | 1131 | |
1132 | - if (! empty($joinTableAnnot->name)) { |
|
1132 | + if ( ! empty($joinTableAnnot->name)) { |
|
1133 | 1133 | $joinTable->setName($joinTableAnnot->name); |
1134 | 1134 | } |
1135 | 1135 | |
1136 | - if (! empty($joinTableAnnot->schema)) { |
|
1136 | + if ( ! empty($joinTableAnnot->schema)) { |
|
1137 | 1137 | $joinTable->setSchema($joinTableAnnot->schema); |
1138 | 1138 | } |
1139 | 1139 | |
@@ -1166,22 +1166,22 @@ discard block |
||
1166 | 1166 | $joinColumn = new Mapping\JoinColumnMetadata(); |
1167 | 1167 | |
1168 | 1168 | // @todo Remove conditionals for name and referencedColumnName once naming strategy is brought into drivers |
1169 | - if (! empty($joinColumnAnnot->name)) { |
|
1169 | + if ( ! empty($joinColumnAnnot->name)) { |
|
1170 | 1170 | $joinColumn->setColumnName($joinColumnAnnot->name); |
1171 | 1171 | } |
1172 | 1172 | |
1173 | - if (! empty($joinColumnAnnot->referencedColumnName)) { |
|
1173 | + if ( ! empty($joinColumnAnnot->referencedColumnName)) { |
|
1174 | 1174 | $joinColumn->setReferencedColumnName($joinColumnAnnot->referencedColumnName); |
1175 | 1175 | } |
1176 | 1176 | |
1177 | 1177 | $joinColumn->setNullable($joinColumnAnnot->nullable); |
1178 | 1178 | $joinColumn->setUnique($joinColumnAnnot->unique); |
1179 | 1179 | |
1180 | - if (! empty($joinColumnAnnot->fieldName)) { |
|
1180 | + if ( ! empty($joinColumnAnnot->fieldName)) { |
|
1181 | 1181 | $joinColumn->setAliasedName($joinColumnAnnot->fieldName); |
1182 | 1182 | } |
1183 | 1183 | |
1184 | - if (! empty($joinColumnAnnot->columnDefinition)) { |
|
1184 | + if ( ! empty($joinColumnAnnot->columnDefinition)) { |
|
1185 | 1185 | $joinColumn->setColumnDefinition($joinColumnAnnot->columnDefinition); |
1186 | 1186 | } |
1187 | 1187 | |
@@ -1208,7 +1208,7 @@ discard block |
||
1208 | 1208 | ) : Mapping\CacheMetadata |
1209 | 1209 | { |
1210 | 1210 | $baseRegion = strtolower(str_replace('\\', '_', $metadata->getRootClassName())); |
1211 | - $defaultRegion = $baseRegion . ($fieldName ? '__' . $fieldName : ''); |
|
1211 | + $defaultRegion = $baseRegion.($fieldName ? '__'.$fieldName : ''); |
|
1212 | 1212 | |
1213 | 1213 | $usage = constant(sprintf('%s::%s', Mapping\CacheUsage::class, $cacheAnnot->usage)); |
1214 | 1214 | $region = $cacheAnnot->region ?: $defaultRegion; |
@@ -1309,7 +1309,7 @@ discard block |
||
1309 | 1309 | $classAnnotations = $this->reader->getClassAnnotations($reflectionClass); |
1310 | 1310 | |
1311 | 1311 | foreach ($classAnnotations as $key => $annot) { |
1312 | - if (! is_numeric($key)) { |
|
1312 | + if ( ! is_numeric($key)) { |
|
1313 | 1313 | continue; |
1314 | 1314 | } |
1315 | 1315 | |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | $propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty); |
1330 | 1330 | |
1331 | 1331 | foreach ($propertyAnnotations as $key => $annot) { |
1332 | - if (! is_numeric($key)) { |
|
1332 | + if ( ! is_numeric($key)) { |
|
1333 | 1333 | continue; |
1334 | 1334 | } |
1335 | 1335 | |
@@ -1349,7 +1349,7 @@ discard block |
||
1349 | 1349 | $methodAnnotations = $this->reader->getMethodAnnotations($reflectionMethod); |
1350 | 1350 | |
1351 | 1351 | foreach ($methodAnnotations as $key => $annot) { |
1352 | - if (! is_numeric($key)) { |
|
1352 | + if ( ! is_numeric($key)) { |
|
1353 | 1353 | continue; |
1354 | 1354 | } |
1355 | 1355 |
@@ -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 | |
@@ -683,13 +683,13 @@ discard block |
||
683 | 683 | |
684 | 684 | $findByIdQuery = $class->getNamedNativeQuery('find-by-id'); |
685 | 685 | |
686 | - self::assertEquals(CmsAddress::class,$findByIdQuery['resultClass']); |
|
687 | - self::assertEquals('SELECT * FROM cms_addresses WHERE id = ?', $findByIdQuery['query']); |
|
686 | + self::assertEquals(CmsAddress::class, $findByIdQuery['resultClass']); |
|
687 | + self::assertEquals('SELECT * FROM cms_addresses WHERE id = ?', $findByIdQuery['query']); |
|
688 | 688 | |
689 | 689 | $countQuery = $class->getNamedNativeQuery('count'); |
690 | 690 | |
691 | 691 | self::assertEquals('mapping-count', $countQuery['resultSetMapping']); |
692 | - self::assertEquals('SELECT COUNT(*) AS count FROM cms_addresses', $countQuery['query']); |
|
692 | + self::assertEquals('SELECT COUNT(*) AS count FROM cms_addresses', $countQuery['query']); |
|
693 | 693 | |
694 | 694 | // result set mapping |
695 | 695 | self::assertCount(3, $class->sqlResultSetMappings); |
@@ -700,9 +700,9 @@ discard block |
||
700 | 700 | $findAllMapping = $class->getSqlResultSetMapping('mapping-find-all'); |
701 | 701 | |
702 | 702 | self::assertEquals(CmsAddress::class, $findAllMapping['entities'][0]['entityClass']); |
703 | - self::assertEquals(['name'=>'id','column'=>'id'], $findAllMapping['entities'][0]['fields'][0]); |
|
704 | - self::assertEquals(['name'=>'city','column'=>'city'], $findAllMapping['entities'][0]['fields'][1]); |
|
705 | - self::assertEquals(['name'=>'country','column'=>'country'], $findAllMapping['entities'][0]['fields'][2]); |
|
703 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $findAllMapping['entities'][0]['fields'][0]); |
|
704 | + self::assertEquals(['name'=>'city', 'column'=>'city'], $findAllMapping['entities'][0]['fields'][1]); |
|
705 | + self::assertEquals(['name'=>'country', 'column'=>'country'], $findAllMapping['entities'][0]['fields'][2]); |
|
706 | 706 | |
707 | 707 | $withoutFieldsMapping = $class->getSqlResultSetMapping('mapping-without-fields'); |
708 | 708 | |
@@ -728,63 +728,63 @@ discard block |
||
728 | 728 | |
729 | 729 | $mapping = $userMetadata->getSqlResultSetMapping('mappingJoinedAddress'); |
730 | 730 | |
731 | - self::assertEquals([],$mapping['columns']); |
|
731 | + self::assertEquals([], $mapping['columns']); |
|
732 | 732 | self::assertEquals('mappingJoinedAddress', $mapping['name']); |
733 | 733 | |
734 | 734 | self::assertNull($mapping['entities'][0]['discriminatorColumn']); |
735 | 735 | |
736 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
737 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
738 | - self::assertEquals(['name'=>'status','column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
739 | - self::assertEquals(['name'=>'address.zip','column'=>'zip'], $mapping['entities'][0]['fields'][3]); |
|
740 | - self::assertEquals(['name'=>'address.city','column'=>'city'], $mapping['entities'][0]['fields'][4]); |
|
741 | - self::assertEquals(['name'=>'address.country','column'=>'country'], $mapping['entities'][0]['fields'][5]); |
|
742 | - self::assertEquals(['name'=>'address.id','column'=>'a_id'], $mapping['entities'][0]['fields'][6]); |
|
743 | - self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
736 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
737 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
738 | + self::assertEquals(['name'=>'status', 'column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
739 | + self::assertEquals(['name'=>'address.zip', 'column'=>'zip'], $mapping['entities'][0]['fields'][3]); |
|
740 | + self::assertEquals(['name'=>'address.city', 'column'=>'city'], $mapping['entities'][0]['fields'][4]); |
|
741 | + self::assertEquals(['name'=>'address.country', 'column'=>'country'], $mapping['entities'][0]['fields'][5]); |
|
742 | + self::assertEquals(['name'=>'address.id', 'column'=>'a_id'], $mapping['entities'][0]['fields'][6]); |
|
743 | + self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
744 | 744 | |
745 | 745 | $mapping = $userMetadata->getSqlResultSetMapping('mappingJoinedPhonenumber'); |
746 | 746 | |
747 | - self::assertEquals([],$mapping['columns']); |
|
747 | + self::assertEquals([], $mapping['columns']); |
|
748 | 748 | self::assertEquals('mappingJoinedPhonenumber', $mapping['name']); |
749 | 749 | |
750 | 750 | self::assertNull($mapping['entities'][0]['discriminatorColumn']); |
751 | 751 | |
752 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
753 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
754 | - self::assertEquals(['name'=>'status','column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
755 | - self::assertEquals(['name'=>'phonenumbers.phonenumber','column'=>'number'], $mapping['entities'][0]['fields'][3]); |
|
756 | - self::assertEquals($userMetadata->getClassName(), $mapping['entities'][0]['entityClass']); |
|
752 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
753 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
754 | + self::assertEquals(['name'=>'status', 'column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
755 | + self::assertEquals(['name'=>'phonenumbers.phonenumber', 'column'=>'number'], $mapping['entities'][0]['fields'][3]); |
|
756 | + self::assertEquals($userMetadata->getClassName(), $mapping['entities'][0]['entityClass']); |
|
757 | 757 | |
758 | 758 | $mapping = $userMetadata->getSqlResultSetMapping('mappingUserPhonenumberCount'); |
759 | 759 | |
760 | - self::assertEquals(['name'=>'numphones'],$mapping['columns'][0]); |
|
760 | + self::assertEquals(['name'=>'numphones'], $mapping['columns'][0]); |
|
761 | 761 | self::assertEquals('mappingUserPhonenumberCount', $mapping['name']); |
762 | 762 | |
763 | 763 | self::assertNull($mapping['entities'][0]['discriminatorColumn']); |
764 | 764 | |
765 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
766 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
767 | - self::assertEquals(['name'=>'status','column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
768 | - self::assertEquals($userMetadata->getClassName(), $mapping['entities'][0]['entityClass']); |
|
765 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
766 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
767 | + self::assertEquals(['name'=>'status', 'column'=>'status'], $mapping['entities'][0]['fields'][2]); |
|
768 | + self::assertEquals($userMetadata->getClassName(), $mapping['entities'][0]['entityClass']); |
|
769 | 769 | |
770 | 770 | $mapping = $userMetadata->getSqlResultSetMapping('mappingMultipleJoinsEntityResults'); |
771 | 771 | |
772 | - self::assertEquals(['name'=>'numphones'],$mapping['columns'][0]); |
|
772 | + self::assertEquals(['name'=>'numphones'], $mapping['columns'][0]); |
|
773 | 773 | self::assertEquals('mappingMultipleJoinsEntityResults', $mapping['name']); |
774 | 774 | |
775 | 775 | self::assertNull($mapping['entities'][0]['discriminatorColumn']); |
776 | 776 | |
777 | - self::assertEquals(['name'=>'id','column'=>'u_id'], $mapping['entities'][0]['fields'][0]); |
|
778 | - self::assertEquals(['name'=>'name','column'=>'u_name'], $mapping['entities'][0]['fields'][1]); |
|
779 | - self::assertEquals(['name'=>'status','column'=>'u_status'], $mapping['entities'][0]['fields'][2]); |
|
780 | - self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
777 | + self::assertEquals(['name'=>'id', 'column'=>'u_id'], $mapping['entities'][0]['fields'][0]); |
|
778 | + self::assertEquals(['name'=>'name', 'column'=>'u_name'], $mapping['entities'][0]['fields'][1]); |
|
779 | + self::assertEquals(['name'=>'status', 'column'=>'u_status'], $mapping['entities'][0]['fields'][2]); |
|
780 | + self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
781 | 781 | |
782 | 782 | self::assertNull($mapping['entities'][1]['discriminatorColumn']); |
783 | 783 | |
784 | - self::assertEquals(['name'=>'id','column'=>'a_id'], $mapping['entities'][1]['fields'][0]); |
|
785 | - self::assertEquals(['name'=>'zip','column'=>'a_zip'], $mapping['entities'][1]['fields'][1]); |
|
786 | - self::assertEquals(['name'=>'country','column'=>'a_country'], $mapping['entities'][1]['fields'][2]); |
|
787 | - self::assertEquals(CmsAddress::class, $mapping['entities'][1]['entityClass']); |
|
784 | + self::assertEquals(['name'=>'id', 'column'=>'a_id'], $mapping['entities'][1]['fields'][0]); |
|
785 | + self::assertEquals(['name'=>'zip', 'column'=>'a_zip'], $mapping['entities'][1]['fields'][1]); |
|
786 | + self::assertEquals(['name'=>'country', 'column'=>'a_country'], $mapping['entities'][1]['fields'][2]); |
|
787 | + self::assertEquals(CmsAddress::class, $mapping['entities'][1]['entityClass']); |
|
788 | 788 | |
789 | 789 | //person asserts |
790 | 790 | self::assertCount(1, $personMetadata->getSqlResultSetMappings()); |
@@ -796,9 +796,9 @@ discard block |
||
796 | 796 | |
797 | 797 | self::assertEquals('discriminator', $mapping['entities'][0]['discriminatorColumn']); |
798 | 798 | |
799 | - self::assertEquals(['name'=>'id','column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
800 | - self::assertEquals(['name'=>'name','column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
801 | - self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
799 | + self::assertEquals(['name'=>'id', 'column'=>'id'], $mapping['entities'][0]['fields'][0]); |
|
800 | + self::assertEquals(['name'=>'name', 'column'=>'name'], $mapping['entities'][0]['fields'][1]); |
|
801 | + self::assertEquals('__CLASS__', $mapping['entities'][0]['entityClass']); |
|
802 | 802 | } |
803 | 803 | |
804 | 804 | /* |
@@ -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\Models\Cache; |
6 | 6 |