@@ -444,7 +444,9 @@ discard block |
||
444 | 444 | foreach ($dqlAliases as $dqlAlias) { |
445 | 445 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
446 | 446 | |
447 | - if ( ! $class->isInheritanceTypeSingleTable()) continue; |
|
447 | + if ( ! $class->isInheritanceTypeSingleTable()) { |
|
448 | + continue; |
|
449 | + } |
|
448 | 450 | |
449 | 451 | $conn = $this->em->getConnection(); |
450 | 452 | $values = []; |
@@ -782,7 +784,9 @@ discard block |
||
782 | 784 | |
783 | 785 | foreach ($subClass->associationMappings as $assoc) { |
784 | 786 | // Skip if association is inherited |
785 | - if (isset($assoc['inherited'])) continue; |
|
787 | + if (isset($assoc['inherited'])) { |
|
788 | + continue; |
|
789 | + } |
|
786 | 790 | |
787 | 791 | if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { |
788 | 792 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
@@ -289,11 +289,11 @@ discard block |
||
289 | 289 | */ |
290 | 290 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
291 | 291 | { |
292 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
292 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
293 | 293 | |
294 | 294 | if ( ! isset($this->tableAliasMap[$tableName])) { |
295 | 295 | $this->tableAliasMap[$tableName] = (preg_match('/[a-z]/i', $tableName[0]) ? strtolower($tableName[0]) : 't') |
296 | - . $this->tableAliasCounter++ . '_'; |
|
296 | + . $this->tableAliasCounter++.'_'; |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | return $this->tableAliasMap[$tableName]; |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
313 | 313 | { |
314 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
314 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
315 | 315 | |
316 | 316 | $this->tableAliasMap[$tableName] = $alias; |
317 | 317 | |
@@ -352,12 +352,12 @@ discard block |
||
352 | 352 | |
353 | 353 | // If this is a joined association we must use left joins to preserve the correct result. |
354 | 354 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
355 | - $sql .= 'JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
355 | + $sql .= 'JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
356 | 356 | |
357 | 357 | $sqlParts = []; |
358 | 358 | |
359 | 359 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
360 | - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; |
|
360 | + $sqlParts[] = $baseTableAlias.'.'.$columnName.' = '.$tableAlias.'.'.$columnName; |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | // Add filters on the root class |
@@ -378,12 +378,12 @@ discard block |
||
378 | 378 | $subClass = $this->em->getClassMetadata($subClassName); |
379 | 379 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
380 | 380 | |
381 | - $sql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
381 | + $sql .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON '; |
|
382 | 382 | |
383 | 383 | $sqlParts = []; |
384 | 384 | |
385 | 385 | foreach ($this->quoteStrategy->getIdentifierColumnNames($subClass, $this->platform) as $columnName) { |
386 | - $sqlParts[] = $baseTableAlias . '.' . $columnName . ' = ' . $tableAlias . '.' . $columnName; |
|
386 | + $sqlParts[] = $baseTableAlias.'.'.$columnName.' = '.$tableAlias.'.'.$columnName; |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | $sql .= implode(' AND ', $sqlParts); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ? $persister->getOwningTable($fieldName) |
416 | 416 | : $qComp['metadata']->getTableName(); |
417 | 417 | |
418 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
418 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
419 | 419 | |
420 | 420 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
421 | 421 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -423,7 +423,7 @@ discard block |
||
423 | 423 | } |
424 | 424 | |
425 | 425 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
426 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
426 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
427 | 427 | } |
428 | 428 | } |
429 | 429 | |
@@ -458,15 +458,15 @@ discard block |
||
458 | 458 | } |
459 | 459 | |
460 | 460 | $sqlTableAlias = ($this->useSqlTableAliases) |
461 | - ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.' |
|
461 | + ? $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.' |
|
462 | 462 | : ''; |
463 | 463 | |
464 | - $sqlParts[] = $sqlTableAlias . $class->discriminatorColumn['name'] . ' IN (' . implode(', ', $values) . ')'; |
|
464 | + $sqlParts[] = $sqlTableAlias.$class->discriminatorColumn['name'].' IN ('.implode(', ', $values).')'; |
|
465 | 465 | } |
466 | 466 | |
467 | 467 | $sql = implode(' AND ', $sqlParts); |
468 | 468 | |
469 | - return (count($sqlParts) > 1) ? '(' . $sql . ')' : $sql; |
|
469 | + return (count($sqlParts) > 1) ? '('.$sql.')' : $sql; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
@@ -479,11 +479,11 @@ discard block |
||
479 | 479 | */ |
480 | 480 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
481 | 481 | { |
482 | - if (!$this->em->hasFilters()) { |
|
482 | + if ( ! $this->em->hasFilters()) { |
|
483 | 483 | return ''; |
484 | 484 | } |
485 | 485 | |
486 | - switch($targetEntity->inheritanceType) { |
|
486 | + switch ($targetEntity->inheritanceType) { |
|
487 | 487 | case ClassMetadata::INHERITANCE_TYPE_NONE: |
488 | 488 | break; |
489 | 489 | case ClassMetadata::INHERITANCE_TYPE_JOINED: |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | $filterClauses = []; |
507 | 507 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
508 | 508 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
509 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
509 | + $filterClauses[] = '('.$filterExpr.')'; |
|
510 | 510 | } |
511 | 511 | } |
512 | 512 | |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | |
540 | 540 | if ( ! $AST->orderByClause && ($orderBySql = $this->_generateOrderedCollectionOrderByItems())) { |
541 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
541 | + $sql .= ' ORDER BY '.$orderBySql; |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | if ($limit !== null || $offset !== null) { |
@@ -550,11 +550,11 @@ discard block |
||
550 | 550 | } |
551 | 551 | |
552 | 552 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
553 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
553 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
554 | 554 | } |
555 | 555 | |
556 | 556 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
557 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
557 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
558 | 558 | } |
559 | 559 | |
560 | 560 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | $sqlParts = []; |
610 | 610 | |
611 | 611 | foreach ($this->quoteStrategy->getIdentifierColumnNames($class, $this->platform) as $columnName) { |
612 | - $sqlParts[] = $tableAlias . '.' . $columnName; |
|
612 | + $sqlParts[] = $tableAlias.'.'.$columnName; |
|
613 | 613 | } |
614 | 614 | |
615 | 615 | return implode(', ', $sqlParts); |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
653 | 653 | |
654 | 654 | if ($this->useSqlTableAliases) { |
655 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
655 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
656 | 656 | } |
657 | 657 | |
658 | 658 | $sql .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | } |
682 | 682 | |
683 | 683 | if ($this->useSqlTableAliases) { |
684 | - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; |
|
684 | + $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.'; |
|
685 | 685 | } |
686 | 686 | |
687 | 687 | $sql .= reset($assoc['targetToSourceKeyColumns']); |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | */ |
700 | 700 | public function walkSelectClause($selectClause) |
701 | 701 | { |
702 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
702 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
703 | 703 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
704 | 704 | |
705 | 705 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -736,7 +736,7 @@ discard block |
||
736 | 736 | $discrColumn = $rootClass->discriminatorColumn; |
737 | 737 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
738 | 738 | |
739 | - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
739 | + $sqlSelectExpressions[] = $tblAlias.'.'.$discrColumn['name'].' AS '.$columnAlias; |
|
740 | 740 | |
741 | 741 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
742 | 742 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName'], false, $discrColumn['type']); |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | // Add foreign key columns of class and also parent classes |
751 | 751 | foreach ($class->associationMappings as $assoc) { |
752 | 752 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) |
753 | - || ( ! $addMetaColumns && !isset($assoc['id']))) { |
|
753 | + || ( ! $addMetaColumns && ! isset($assoc['id']))) { |
|
754 | 754 | continue; |
755 | 755 | } |
756 | 756 | |
@@ -765,7 +765,7 @@ discard block |
||
765 | 765 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
766 | 766 | |
767 | 767 | $quotedColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
768 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
768 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
769 | 769 | |
770 | 770 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $isIdentifier, $columnType); |
771 | 771 | } |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
795 | 795 | |
796 | 796 | $quotedColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $subClass, $this->platform); |
797 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $quotedColumnName . ' AS ' . $columnAlias; |
|
797 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$quotedColumnName.' AS '.$columnAlias; |
|
798 | 798 | |
799 | 799 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $subClass->isIdentifier($columnName), $columnType); |
800 | 800 | } |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
821 | 821 | } |
822 | 822 | |
823 | - return ' FROM ' . implode(', ', $sqlParts); |
|
823 | + return ' FROM '.implode(', ', $sqlParts); |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | /** |
@@ -897,14 +897,14 @@ discard block |
||
897 | 897 | } |
898 | 898 | |
899 | 899 | $sql = $this->platform->appendLockHint( |
900 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
900 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
901 | 901 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
902 | 902 | $this->query->getHint(Query::HINT_LOCK_MODE) |
903 | 903 | ); |
904 | 904 | |
905 | 905 | if ($class->isInheritanceTypeJoined()) { |
906 | 906 | if ($buildNestedJoins) { |
907 | - $sql = '(' . $sql . $this->_generateClassTableInheritanceJoins($class, $dqlAlias) . ')'; |
|
907 | + $sql = '('.$sql.$this->_generateClassTableInheritanceJoins($class, $dqlAlias).')'; |
|
908 | 908 | } else { |
909 | 909 | $sql .= $this->_generateClassTableInheritanceJoins($class, $dqlAlias); |
910 | 910 | } |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | // Ensure we got the owning side, since it has all mapping info |
944 | 944 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
945 | 945 | |
946 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
946 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
947 | 947 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
948 | 948 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
949 | 949 | } |
@@ -963,12 +963,12 @@ discard block |
||
963 | 963 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
964 | 964 | |
965 | 965 | if ($relation['isOwningSide']) { |
966 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
966 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
967 | 967 | |
968 | 968 | continue; |
969 | 969 | } |
970 | 970 | |
971 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
971 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
972 | 972 | } |
973 | 973 | |
974 | 974 | // Apply remaining inheritance restrictions |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | } |
987 | 987 | |
988 | 988 | $targetTableJoin = [ |
989 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
989 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
990 | 990 | 'condition' => implode(' AND ', $conditions), |
991 | 991 | ]; |
992 | 992 | break; |
@@ -1006,10 +1006,10 @@ discard block |
||
1006 | 1006 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1007 | 1007 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1008 | 1008 | |
1009 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1009 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1012 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1013 | 1013 | |
1014 | 1014 | // Join target table |
1015 | 1015 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1023,7 +1023,7 @@ discard block |
||
1023 | 1023 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
1024 | 1024 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
1025 | 1025 | |
1026 | - $conditions[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1026 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1027 | 1027 | } |
1028 | 1028 | |
1029 | 1029 | // Apply remaining inheritance restrictions |
@@ -1041,7 +1041,7 @@ discard block |
||
1041 | 1041 | } |
1042 | 1042 | |
1043 | 1043 | $targetTableJoin = [ |
1044 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1044 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1045 | 1045 | 'condition' => implode(' AND ', $conditions), |
1046 | 1046 | ]; |
1047 | 1047 | break; |
@@ -1051,22 +1051,22 @@ discard block |
||
1051 | 1051 | } |
1052 | 1052 | |
1053 | 1053 | // Handle WITH clause |
1054 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1054 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1055 | 1055 | |
1056 | 1056 | if ($targetClass->isInheritanceTypeJoined()) { |
1057 | 1057 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1058 | 1058 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1059 | 1059 | if ($withCondition) { |
1060 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1060 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1061 | 1061 | } else { |
1062 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1062 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1063 | 1063 | } |
1064 | 1064 | } else { |
1065 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1065 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1066 | 1066 | } |
1067 | 1067 | |
1068 | 1068 | if ($withCondition) { |
1069 | - $sql .= ' AND ' . $withCondition; |
|
1069 | + $sql .= ' AND '.$withCondition; |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | // Apply the indexes |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1100 | 1100 | } |
1101 | 1101 | |
1102 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1102 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1103 | 1103 | } |
1104 | 1104 | |
1105 | 1105 | /** |
@@ -1116,10 +1116,10 @@ discard block |
||
1116 | 1116 | $this->orderedColumnsMap[$sql] = $type; |
1117 | 1117 | |
1118 | 1118 | if ($expr instanceof AST\Subselect) { |
1119 | - return '(' . $sql . ') ' . $type; |
|
1119 | + return '('.$sql.') '.$type; |
|
1120 | 1120 | } |
1121 | 1121 | |
1122 | - return $sql . ' ' . $type; |
|
1122 | + return $sql.' '.$type; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | /** |
@@ -1127,7 +1127,7 @@ discard block |
||
1127 | 1127 | */ |
1128 | 1128 | public function walkHavingClause($havingClause) |
1129 | 1129 | { |
1130 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1130 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1131 | 1131 | } |
1132 | 1132 | |
1133 | 1133 | /** |
@@ -1150,7 +1150,7 @@ discard block |
||
1150 | 1150 | $conditions = []; |
1151 | 1151 | |
1152 | 1152 | if ($join->conditionalExpression) { |
1153 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1153 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1154 | 1154 | } |
1155 | 1155 | |
1156 | 1156 | $isUnconditionalJoin = empty($conditions); |
@@ -1158,7 +1158,7 @@ discard block |
||
1158 | 1158 | ? ' AND ' |
1159 | 1159 | : ' ON '; |
1160 | 1160 | |
1161 | - $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, !$isUnconditionalJoin); |
|
1161 | + $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, ! $isUnconditionalJoin); |
|
1162 | 1162 | |
1163 | 1163 | // Apply remaining inheritance restrictions |
1164 | 1164 | $discrSql = $this->_generateDiscriminatorColumnConditionSQL([$dqlAlias]); |
@@ -1175,7 +1175,7 @@ discard block |
||
1175 | 1175 | } |
1176 | 1176 | |
1177 | 1177 | if ($conditions) { |
1178 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1178 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1179 | 1179 | } |
1180 | 1180 | |
1181 | 1181 | break; |
@@ -1205,7 +1205,7 @@ discard block |
||
1205 | 1205 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1206 | 1206 | } |
1207 | 1207 | |
1208 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1208 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1209 | 1209 | |
1210 | 1210 | return $sql; |
1211 | 1211 | } |
@@ -1227,7 +1227,7 @@ discard block |
||
1227 | 1227 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1228 | 1228 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1229 | 1229 | |
1230 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1230 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1231 | 1231 | } |
1232 | 1232 | |
1233 | 1233 | /** |
@@ -1242,11 +1242,11 @@ discard block |
||
1242 | 1242 | $sql = 'CASE'; |
1243 | 1243 | |
1244 | 1244 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1245 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1246 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1245 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1246 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1247 | 1247 | } |
1248 | 1248 | |
1249 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1249 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1250 | 1250 | |
1251 | 1251 | return $sql; |
1252 | 1252 | } |
@@ -1260,14 +1260,14 @@ discard block |
||
1260 | 1260 | */ |
1261 | 1261 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1262 | 1262 | { |
1263 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1263 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1264 | 1264 | |
1265 | 1265 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1266 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1267 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1266 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1267 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1268 | 1268 | } |
1269 | 1269 | |
1270 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1270 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1271 | 1271 | |
1272 | 1272 | return $sql; |
1273 | 1273 | } |
@@ -1301,14 +1301,14 @@ discard block |
||
1301 | 1301 | $fieldMapping = $class->fieldMappings[$fieldName]; |
1302 | 1302 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1303 | 1303 | $columnAlias = $this->getSQLColumnAlias($fieldMapping['columnName']); |
1304 | - $col = $sqlTableAlias . '.' . $columnName; |
|
1304 | + $col = $sqlTableAlias.'.'.$columnName; |
|
1305 | 1305 | |
1306 | 1306 | if (isset($fieldMapping['requireSQLConversion'])) { |
1307 | 1307 | $type = Type::getType($fieldMapping['type']); |
1308 | 1308 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
1309 | 1309 | } |
1310 | 1310 | |
1311 | - $sql .= $col . ' AS ' . $columnAlias; |
|
1311 | + $sql .= $col.' AS '.$columnAlias; |
|
1312 | 1312 | |
1313 | 1313 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1314 | 1314 | |
@@ -1333,7 +1333,7 @@ discard block |
||
1333 | 1333 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1334 | 1334 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1335 | 1335 | |
1336 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1336 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1337 | 1337 | |
1338 | 1338 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1339 | 1339 | |
@@ -1347,7 +1347,7 @@ discard block |
||
1347 | 1347 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1348 | 1348 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1349 | 1349 | |
1350 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1350 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1351 | 1351 | |
1352 | 1352 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1353 | 1353 | |
@@ -1358,7 +1358,7 @@ discard block |
||
1358 | 1358 | break; |
1359 | 1359 | |
1360 | 1360 | case ($expr instanceof AST\NewObjectExpression): |
1361 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1361 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1362 | 1362 | break; |
1363 | 1363 | |
1364 | 1364 | default: |
@@ -1399,14 +1399,14 @@ discard block |
||
1399 | 1399 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1400 | 1400 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1401 | 1401 | |
1402 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1402 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1403 | 1403 | |
1404 | 1404 | if (isset($mapping['requireSQLConversion'])) { |
1405 | 1405 | $type = Type::getType($mapping['type']); |
1406 | 1406 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1407 | 1407 | } |
1408 | 1408 | |
1409 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
1409 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1410 | 1410 | |
1411 | 1411 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1412 | 1412 | |
@@ -1423,21 +1423,21 @@ discard block |
||
1423 | 1423 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
1424 | 1424 | |
1425 | 1425 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
1426 | - if (isset($mapping['inherited']) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
1426 | + if (isset($mapping['inherited']) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
1427 | 1427 | continue; |
1428 | 1428 | } |
1429 | 1429 | |
1430 | 1430 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1431 | 1431 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
1432 | 1432 | |
1433 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1433 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1434 | 1434 | |
1435 | 1435 | if (isset($mapping['requireSQLConversion'])) { |
1436 | 1436 | $type = Type::getType($mapping['type']); |
1437 | 1437 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1438 | 1438 | } |
1439 | 1439 | |
1440 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
1440 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1441 | 1441 | |
1442 | 1442 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1443 | 1443 | |
@@ -1457,7 +1457,7 @@ discard block |
||
1457 | 1457 | */ |
1458 | 1458 | public function walkQuantifiedExpression($qExpr) |
1459 | 1459 | { |
1460 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1460 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1461 | 1461 | } |
1462 | 1462 | |
1463 | 1463 | /** |
@@ -1497,7 +1497,7 @@ discard block |
||
1497 | 1497 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1498 | 1498 | } |
1499 | 1499 | |
1500 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1500 | + return ' FROM '.implode(', ', $sqlParts); |
|
1501 | 1501 | } |
1502 | 1502 | |
1503 | 1503 | /** |
@@ -1505,7 +1505,7 @@ discard block |
||
1505 | 1505 | */ |
1506 | 1506 | public function walkSimpleSelectClause($simpleSelectClause) |
1507 | 1507 | { |
1508 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1508 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1509 | 1509 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1510 | 1510 | } |
1511 | 1511 | |
@@ -1524,10 +1524,10 @@ discard block |
||
1524 | 1524 | * @param null|string $newObjectResultAlias |
1525 | 1525 | * @return string The SQL. |
1526 | 1526 | */ |
1527 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1527 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1528 | 1528 | { |
1529 | 1529 | $sqlSelectExpressions = []; |
1530 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
1530 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
1531 | 1531 | |
1532 | 1532 | foreach ($newObjectExpression->args as $argIndex => $e) { |
1533 | 1533 | $resultAlias = $this->scalarResultCounter++; |
@@ -1540,7 +1540,7 @@ discard block |
||
1540 | 1540 | break; |
1541 | 1541 | |
1542 | 1542 | case ($e instanceof AST\Subselect): |
1543 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1543 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1544 | 1544 | break; |
1545 | 1545 | |
1546 | 1546 | case ($e instanceof AST\PathExpression): |
@@ -1549,7 +1549,7 @@ discard block |
||
1549 | 1549 | $class = $qComp['metadata']; |
1550 | 1550 | $fieldType = $class->fieldMappings[$e->field]['type']; |
1551 | 1551 | |
1552 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1552 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1553 | 1553 | break; |
1554 | 1554 | |
1555 | 1555 | case ($e instanceof AST\Literal): |
@@ -1563,11 +1563,11 @@ discard block |
||
1563 | 1563 | break; |
1564 | 1564 | } |
1565 | 1565 | |
1566 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1566 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1567 | 1567 | break; |
1568 | 1568 | |
1569 | 1569 | default: |
1570 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1570 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1571 | 1571 | break; |
1572 | 1572 | } |
1573 | 1573 | |
@@ -1600,10 +1600,10 @@ discard block |
||
1600 | 1600 | case ($expr instanceof AST\Subselect): |
1601 | 1601 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1602 | 1602 | |
1603 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1603 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1604 | 1604 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1605 | 1605 | |
1606 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1606 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1607 | 1607 | break; |
1608 | 1608 | |
1609 | 1609 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1620,7 +1620,7 @@ discard block |
||
1620 | 1620 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1621 | 1621 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1622 | 1622 | |
1623 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1623 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1624 | 1624 | break; |
1625 | 1625 | |
1626 | 1626 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1640,8 +1640,8 @@ discard block |
||
1640 | 1640 | */ |
1641 | 1641 | public function walkAggregateExpression($aggExpression) |
1642 | 1642 | { |
1643 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1644 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1643 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1644 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1645 | 1645 | } |
1646 | 1646 | |
1647 | 1647 | /** |
@@ -1655,7 +1655,7 @@ discard block |
||
1655 | 1655 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1656 | 1656 | } |
1657 | 1657 | |
1658 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1658 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1659 | 1659 | } |
1660 | 1660 | |
1661 | 1661 | /** |
@@ -1712,7 +1712,7 @@ discard block |
||
1712 | 1712 | { |
1713 | 1713 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1714 | 1714 | $tableName = $class->getTableName(); |
1715 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1715 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1716 | 1716 | |
1717 | 1717 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1718 | 1718 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1727,12 +1727,12 @@ discard block |
||
1727 | 1727 | { |
1728 | 1728 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1729 | 1729 | $tableName = $class->getTableName(); |
1730 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1730 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1731 | 1731 | |
1732 | 1732 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1733 | 1733 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1734 | 1734 | |
1735 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1735 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1736 | 1736 | |
1737 | 1737 | return $sql; |
1738 | 1738 | } |
@@ -1745,7 +1745,7 @@ discard block |
||
1745 | 1745 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1746 | 1746 | $this->useSqlTableAliases = false; |
1747 | 1747 | |
1748 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1748 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1749 | 1749 | $newValue = $updateItem->newValue; |
1750 | 1750 | |
1751 | 1751 | switch (true) { |
@@ -1788,7 +1788,7 @@ discard block |
||
1788 | 1788 | |
1789 | 1789 | if (count($filterClauses)) { |
1790 | 1790 | if ($condSql) { |
1791 | - $condSql = '(' . $condSql . ') AND '; |
|
1791 | + $condSql = '('.$condSql.') AND '; |
|
1792 | 1792 | } |
1793 | 1793 | |
1794 | 1794 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1796,11 +1796,11 @@ discard block |
||
1796 | 1796 | } |
1797 | 1797 | |
1798 | 1798 | if ($condSql) { |
1799 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1799 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1800 | 1800 | } |
1801 | 1801 | |
1802 | 1802 | if ($discrSql) { |
1803 | - return ' WHERE ' . $discrSql; |
|
1803 | + return ' WHERE '.$discrSql; |
|
1804 | 1804 | } |
1805 | 1805 | |
1806 | 1806 | return ''; |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | // if only one ConditionalPrimary is defined |
1844 | 1844 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1845 | 1845 | ? $this->walkConditionalPrimary($factor) |
1846 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1846 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1847 | 1847 | } |
1848 | 1848 | |
1849 | 1849 | /** |
@@ -1858,7 +1858,7 @@ discard block |
||
1858 | 1858 | if ($primary->isConditionalExpression()) { |
1859 | 1859 | $condExpr = $primary->conditionalExpression; |
1860 | 1860 | |
1861 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1861 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1862 | 1862 | } |
1863 | 1863 | } |
1864 | 1864 | |
@@ -1869,7 +1869,7 @@ discard block |
||
1869 | 1869 | { |
1870 | 1870 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1871 | 1871 | |
1872 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1872 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1873 | 1873 | |
1874 | 1874 | return $sql; |
1875 | 1875 | } |
@@ -1913,7 +1913,7 @@ discard block |
||
1913 | 1913 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1914 | 1914 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1915 | 1915 | |
1916 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
1916 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
1917 | 1917 | |
1918 | 1918 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
1919 | 1919 | $sqlParts = []; |
@@ -1921,7 +1921,7 @@ discard block |
||
1921 | 1921 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
1922 | 1922 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
1923 | 1923 | |
1924 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
1924 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
1925 | 1925 | } |
1926 | 1926 | |
1927 | 1927 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1929,7 +1929,7 @@ discard block |
||
1929 | 1929 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1930 | 1930 | } |
1931 | 1931 | |
1932 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
1932 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
1933 | 1933 | } |
1934 | 1934 | |
1935 | 1935 | $sql .= implode(' AND ', $sqlParts); |
@@ -1945,8 +1945,8 @@ discard block |
||
1945 | 1945 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1946 | 1946 | |
1947 | 1947 | // join to target table |
1948 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
1949 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
1948 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
1949 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
1950 | 1950 | |
1951 | 1951 | // join conditions |
1952 | 1952 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1955,7 +1955,7 @@ discard block |
||
1955 | 1955 | foreach ($joinColumns as $joinColumn) { |
1956 | 1956 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
1957 | 1957 | |
1958 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
1958 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
1959 | 1959 | } |
1960 | 1960 | |
1961 | 1961 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -1967,7 +1967,7 @@ discard block |
||
1967 | 1967 | foreach ($joinColumns as $joinColumn) { |
1968 | 1968 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
1969 | 1969 | |
1970 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
1970 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
1971 | 1971 | } |
1972 | 1972 | |
1973 | 1973 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1975,13 +1975,13 @@ discard block |
||
1975 | 1975 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1976 | 1976 | } |
1977 | 1977 | |
1978 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
1978 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
1979 | 1979 | } |
1980 | 1980 | |
1981 | 1981 | $sql .= implode(' AND ', $sqlParts); |
1982 | 1982 | } |
1983 | 1983 | |
1984 | - return $sql . ')'; |
|
1984 | + return $sql.')'; |
|
1985 | 1985 | } |
1986 | 1986 | |
1987 | 1987 | /** |
@@ -1992,7 +1992,7 @@ discard block |
||
1992 | 1992 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
1993 | 1993 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
1994 | 1994 | |
1995 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
1995 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
1996 | 1996 | } |
1997 | 1997 | |
1998 | 1998 | /** |
@@ -2001,19 +2001,19 @@ discard block |
||
2001 | 2001 | public function walkNullComparisonExpression($nullCompExpr) |
2002 | 2002 | { |
2003 | 2003 | $expression = $nullCompExpr->expression; |
2004 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2004 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2005 | 2005 | |
2006 | 2006 | // Handle ResultVariable |
2007 | 2007 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2008 | - return $this->walkResultVariable($expression) . $comparison; |
|
2008 | + return $this->walkResultVariable($expression).$comparison; |
|
2009 | 2009 | } |
2010 | 2010 | |
2011 | 2011 | // Handle InputParameter mapping inclusion to ParserResult |
2012 | 2012 | if ($expression instanceof AST\InputParameter) { |
2013 | - return $this->walkInputParameter($expression) . $comparison; |
|
2013 | + return $this->walkInputParameter($expression).$comparison; |
|
2014 | 2014 | } |
2015 | 2015 | |
2016 | - return $expression->dispatch($this) . $comparison; |
|
2016 | + return $expression->dispatch($this).$comparison; |
|
2017 | 2017 | } |
2018 | 2018 | |
2019 | 2019 | /** |
@@ -2021,7 +2021,7 @@ discard block |
||
2021 | 2021 | */ |
2022 | 2022 | public function walkInExpression($inExpr) |
2023 | 2023 | { |
2024 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2024 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2025 | 2025 | |
2026 | 2026 | $sql .= ($inExpr->subselect) |
2027 | 2027 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2048,10 +2048,10 @@ discard block |
||
2048 | 2048 | } |
2049 | 2049 | |
2050 | 2050 | if ($this->useSqlTableAliases) { |
2051 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
2051 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
2052 | 2052 | } |
2053 | 2053 | |
2054 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2054 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2055 | 2055 | $sql .= $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr); |
2056 | 2056 | |
2057 | 2057 | return $sql; |
@@ -2098,8 +2098,8 @@ discard block |
||
2098 | 2098 | $sql .= ' NOT'; |
2099 | 2099 | } |
2100 | 2100 | |
2101 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2102 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2101 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2102 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2103 | 2103 | |
2104 | 2104 | return $sql; |
2105 | 2105 | } |
@@ -2114,7 +2114,7 @@ discard block |
||
2114 | 2114 | ? $this->walkResultVariable($stringExpr) |
2115 | 2115 | : $stringExpr->dispatch($this); |
2116 | 2116 | |
2117 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2117 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2118 | 2118 | |
2119 | 2119 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2120 | 2120 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2127,7 +2127,7 @@ discard block |
||
2127 | 2127 | } |
2128 | 2128 | |
2129 | 2129 | if ($likeExpr->escapeChar) { |
2130 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2130 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2131 | 2131 | } |
2132 | 2132 | |
2133 | 2133 | return $sql; |
@@ -2154,7 +2154,7 @@ discard block |
||
2154 | 2154 | ? $leftExpr->dispatch($this) |
2155 | 2155 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2156 | 2156 | |
2157 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2157 | + $sql .= ' '.$compExpr->operator.' '; |
|
2158 | 2158 | |
2159 | 2159 | $sql .= ($rightExpr instanceof AST\Node) |
2160 | 2160 | ? $rightExpr->dispatch($this) |
@@ -2186,7 +2186,7 @@ discard block |
||
2186 | 2186 | { |
2187 | 2187 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2188 | 2188 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2189 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2189 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2190 | 2190 | } |
2191 | 2191 | |
2192 | 2192 | /** |
@@ -2240,7 +2240,7 @@ discard block |
||
2240 | 2240 | |
2241 | 2241 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2242 | 2242 | |
2243 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2243 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2244 | 2244 | } |
2245 | 2245 | |
2246 | 2246 | /** |
@@ -2253,7 +2253,7 @@ discard block |
||
2253 | 2253 | public function walkArithmeticPrimary($primary) |
2254 | 2254 | { |
2255 | 2255 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2256 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2256 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2257 | 2257 | } |
2258 | 2258 | |
2259 | 2259 | if ($primary instanceof AST\Node) { |
@@ -2317,6 +2317,6 @@ discard block |
||
2317 | 2317 | $sqlParameterList[] = $this->conn->quote($dis); |
2318 | 2318 | } |
2319 | 2319 | |
2320 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
2320 | + return '('.implode(', ', $sqlParameterList).')'; |
|
2321 | 2321 | } |
2322 | 2322 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | /** |
34 | 34 | * @var string |
35 | 35 | */ |
36 | - protected $preSeparator = ''; |
|
36 | + protected $preSeparator = ''; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @var string |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | public function setParameter($key, $value, $type = null) |
534 | 534 | { |
535 | 535 | $filteredParameters = $this->parameters->filter( |
536 | - function ($parameter) use ($key) |
|
536 | + function($parameter) use ($key) |
|
537 | 537 | { |
538 | 538 | /* @var Query\Parameter $parameter */ |
539 | 539 | // Must not be identical because of string to integer conversion |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | public function getParameter($key) |
615 | 615 | { |
616 | 616 | $filteredParameters = $this->parameters->filter( |
617 | - function ($parameter) use ($key) |
|
617 | + function($parameter) use ($key) |
|
618 | 618 | { |
619 | 619 | /* @var Query\Parameter $parameter */ |
620 | 620 | // Must not be identical because of string to integer conversion |
@@ -697,7 +697,7 @@ discard block |
||
697 | 697 | } |
698 | 698 | |
699 | 699 | $isMultiple = is_array($this->_dqlParts[$dqlPartName]) |
700 | - && !($dqlPartName == 'join' && !$append); |
|
700 | + && ! ($dqlPartName == 'join' && ! $append); |
|
701 | 701 | |
702 | 702 | // Allow adding any part retrieved from self::getDQLParts(). |
703 | 703 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -914,7 +914,7 @@ discard block |
||
914 | 914 | { |
915 | 915 | $rootAliases = $this->getRootAliases(); |
916 | 916 | |
917 | - if (!in_array($alias, $rootAliases)) { |
|
917 | + if ( ! in_array($alias, $rootAliases)) { |
|
918 | 918 | throw new Query\QueryException( |
919 | 919 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
920 | 920 | ); |
@@ -1316,15 +1316,15 @@ discard block |
||
1316 | 1316 | foreach ($criteria->getOrderings() as $sort => $order) { |
1317 | 1317 | |
1318 | 1318 | $hasValidAlias = false; |
1319 | - foreach($allAliases as $alias) { |
|
1320 | - if(strpos($sort . '.', $alias . '.') === 0) { |
|
1319 | + foreach ($allAliases as $alias) { |
|
1320 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1321 | 1321 | $hasValidAlias = true; |
1322 | 1322 | break; |
1323 | 1323 | } |
1324 | 1324 | } |
1325 | 1325 | |
1326 | - if(!$hasValidAlias) { |
|
1327 | - $sort = $allAliases[0] . '.' . $sort; |
|
1326 | + if ( ! $hasValidAlias) { |
|
1327 | + $sort = $allAliases[0].'.'.$sort; |
|
1328 | 1328 | } |
1329 | 1329 | |
1330 | 1330 | $this->addOrderBy($sort, $order); |
@@ -1397,7 +1397,7 @@ discard block |
||
1397 | 1397 | private function _getDQLForSelect() |
1398 | 1398 | { |
1399 | 1399 | $dql = 'SELECT' |
1400 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1400 | + . ($this->_dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1401 | 1401 | . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
1402 | 1402 | |
1403 | 1403 | $fromParts = $this->getDQLPart('from'); |
@@ -1413,7 +1413,7 @@ discard block |
||
1413 | 1413 | |
1414 | 1414 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1415 | 1415 | foreach ($joinParts[$from->getAlias()] as $join) { |
1416 | - $fromClause .= ' ' . ((string) $join); |
|
1416 | + $fromClause .= ' '.((string) $join); |
|
1417 | 1417 | } |
1418 | 1418 | } |
1419 | 1419 |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | */ |
119 | 119 | private $joinRootAliases = []; |
120 | 120 | |
121 | - /** |
|
122 | - * Whether to use second level cache, if available. |
|
123 | - * |
|
124 | - * @var boolean |
|
125 | - */ |
|
121 | + /** |
|
122 | + * Whether to use second level cache, if available. |
|
123 | + * |
|
124 | + * @var boolean |
|
125 | + */ |
|
126 | 126 | protected $cacheable = false; |
127 | 127 | |
128 | 128 | /** |
@@ -213,10 +213,10 @@ discard block |
||
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
216 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
217 | - * |
|
218 | - * @return string|null The cache region name; NULL indicates the default region. |
|
219 | - */ |
|
216 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
217 | + * |
|
218 | + * @return string|null The cache region name; NULL indicates the default region. |
|
219 | + */ |
|
220 | 220 | public function getCacheRegion() |
221 | 221 | { |
222 | 222 | return $this->cacheRegion; |
@@ -1373,10 +1373,10 @@ discard block |
||
1373 | 1373 | */ |
1374 | 1374 | private function _getDQLForDelete() |
1375 | 1375 | { |
1376 | - return 'DELETE' |
|
1377 | - . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1378 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1379 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1376 | + return 'DELETE' |
|
1377 | + . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1378 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1379 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1380 | 1380 | } |
1381 | 1381 | |
1382 | 1382 | /** |
@@ -1384,11 +1384,11 @@ discard block |
||
1384 | 1384 | */ |
1385 | 1385 | private function _getDQLForUpdate() |
1386 | 1386 | { |
1387 | - return 'UPDATE' |
|
1388 | - . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1389 | - . $this->_getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1390 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1391 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1387 | + return 'UPDATE' |
|
1388 | + . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1389 | + . $this->_getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1390 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1391 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1392 | 1392 | } |
1393 | 1393 | |
1394 | 1394 | /** |
@@ -1397,8 +1397,8 @@ discard block |
||
1397 | 1397 | private function _getDQLForSelect() |
1398 | 1398 | { |
1399 | 1399 | $dql = 'SELECT' |
1400 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1401 | - . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1400 | + . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1401 | + . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1402 | 1402 | |
1403 | 1403 | $fromParts = $this->getDQLPart('from'); |
1404 | 1404 | $joinParts = $this->getDQLPart('join'); |
@@ -1422,10 +1422,10 @@ discard block |
||
1422 | 1422 | } |
1423 | 1423 | |
1424 | 1424 | $dql .= implode(', ', $fromClauses) |
1425 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1426 | - . $this->_getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1427 | - . $this->_getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1428 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1425 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1426 | + . $this->_getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1427 | + . $this->_getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1428 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1429 | 1429 | |
1430 | 1430 | return $dql; |
1431 | 1431 | } |
@@ -1445,8 +1445,8 @@ discard block |
||
1445 | 1445 | } |
1446 | 1446 | |
1447 | 1447 | return ($options['pre'] ?? '') |
1448 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1449 | - . ($options['post'] ?? ''); |
|
1448 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1449 | + . ($options['post'] ?? ''); |
|
1450 | 1450 | } |
1451 | 1451 | |
1452 | 1452 | /** |
@@ -102,7 +102,7 @@ |
||
102 | 102 | [$pathExpression] |
103 | 103 | ); |
104 | 104 | $expression = new InExpression($arithmeticExpression); |
105 | - $expression->literals[] = new InputParameter(":" . self::PAGINATOR_ID_ALIAS); |
|
105 | + $expression->literals[] = new InputParameter(":".self::PAGINATOR_ID_ALIAS); |
|
106 | 106 | |
107 | 107 | } else { |
108 | 108 | $expression = new NullComparisonExpression($pathExpression); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $schema = []; |
76 | 76 | foreach ($this->from as $path) { |
77 | 77 | if (is_dir($path)) { |
78 | - $files = glob($path . '/*.yml'); |
|
78 | + $files = glob($path.'/*.yml'); |
|
79 | 79 | foreach ($files as $file) { |
80 | 80 | $schema = array_merge($schema, (array) Yaml::parse(file_get_contents($file))); |
81 | 81 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE); |
239 | 239 | |
240 | 240 | $definition = [ |
241 | - 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name']:$column['sequence'] |
|
241 | + 'sequenceName' => is_array($column['sequence']) ? $column['sequence']['name'] : $column['sequence'] |
|
242 | 242 | ]; |
243 | 243 | |
244 | 244 | if (isset($column['sequence']['size'])) { |
@@ -1291,7 +1291,7 @@ discard block |
||
1291 | 1291 | |
1292 | 1292 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1293 | 1293 | $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
1294 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1294 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1295 | 1295 | } |
1296 | 1296 | |
1297 | 1297 | return implode("\n", $lines); |
@@ -1319,7 +1319,7 @@ discard block |
||
1319 | 1319 | |
1320 | 1320 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1321 | 1321 | $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
1322 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1322 | + . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1323 | 1323 | } |
1324 | 1324 | |
1325 | 1325 | return implode("\n", $lines); |
@@ -1382,14 +1382,14 @@ discard block |
||
1382 | 1382 | } |
1383 | 1383 | |
1384 | 1384 | $replacements = [ |
1385 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1386 | - '<methodTypeHint>' => $methodTypeHint, |
|
1387 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1388 | - '<variableName>' => $variableName, |
|
1389 | - '<methodName>' => $methodName, |
|
1390 | - '<fieldName>' => $fieldName, |
|
1391 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1392 | - '<entity>' => $this->getClassName($metadata) |
|
1385 | + '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1386 | + '<methodTypeHint>' => $methodTypeHint, |
|
1387 | + '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1388 | + '<variableName>' => $variableName, |
|
1389 | + '<methodName>' => $methodName, |
|
1390 | + '<fieldName>' => $fieldName, |
|
1391 | + '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1392 | + '<entity>' => $this->getClassName($metadata) |
|
1393 | 1393 | ]; |
1394 | 1394 | |
1395 | 1395 | $method = str_replace( |
@@ -1525,11 +1525,21 @@ |
||
1525 | 1525 | if ($associationMapping['cascade']) { |
1526 | 1526 | $cascades = []; |
1527 | 1527 | |
1528 | - if ($associationMapping['isCascadePersist']) $cascades[] = '"persist"'; |
|
1529 | - if ($associationMapping['isCascadeRemove']) $cascades[] = '"remove"'; |
|
1530 | - if ($associationMapping['isCascadeDetach']) $cascades[] = '"detach"'; |
|
1531 | - if ($associationMapping['isCascadeMerge']) $cascades[] = '"merge"'; |
|
1532 | - if ($associationMapping['isCascadeRefresh']) $cascades[] = '"refresh"'; |
|
1528 | + if ($associationMapping['isCascadePersist']) { |
|
1529 | + $cascades[] = '"persist"'; |
|
1530 | + } |
|
1531 | + if ($associationMapping['isCascadeRemove']) { |
|
1532 | + $cascades[] = '"remove"'; |
|
1533 | + } |
|
1534 | + if ($associationMapping['isCascadeDetach']) { |
|
1535 | + $cascades[] = '"detach"'; |
|
1536 | + } |
|
1537 | + if ($associationMapping['isCascadeMerge']) { |
|
1538 | + $cascades[] = '"merge"'; |
|
1539 | + } |
|
1540 | + if ($associationMapping['isCascadeRefresh']) { |
|
1541 | + $cascades[] = '"refresh"'; |
|
1542 | + } |
|
1533 | 1543 | |
1534 | 1544 | if (count($cascades) === 5) { |
1535 | 1545 | $cascades = ['"all"']; |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | */ |
366 | 366 | public function writeEntityClass(ClassMetadataInfo $metadata, $outputDirectory) |
367 | 367 | { |
368 | - $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name) . $this->extension; |
|
368 | + $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->name).$this->extension; |
|
369 | 369 | $dir = dirname($path); |
370 | 370 | |
371 | 371 | if ( ! is_dir($dir)) { |
@@ -381,8 +381,8 @@ discard block |
||
381 | 381 | } |
382 | 382 | |
383 | 383 | if ($this->backupExisting && file_exists($path)) { |
384 | - $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~"; |
|
385 | - if (!copy($path, $backupPath)) { |
|
384 | + $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~"; |
|
385 | + if ( ! copy($path, $backupPath)) { |
|
386 | 386 | throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed."); |
387 | 387 | } |
388 | 388 | } |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | $body = str_replace('<spaces>', $this->spaces, $body); |
444 | 444 | $last = strrpos($currentCode, '}'); |
445 | 445 | |
446 | - return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n"; |
|
446 | + return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n"; |
|
447 | 447 | } |
448 | 448 | |
449 | 449 | /** |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | public function setFieldVisibility($visibility) |
508 | 508 | { |
509 | 509 | if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) { |
510 | - throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility); |
|
510 | + throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility); |
|
511 | 511 | } |
512 | 512 | |
513 | 513 | $this->fieldVisibility = $visibility; |
@@ -604,11 +604,11 @@ discard block |
||
604 | 604 | */ |
605 | 605 | protected function generateEntityNamespace(ClassMetadataInfo $metadata) |
606 | 606 | { |
607 | - if (! $this->hasNamespace($metadata)) { |
|
607 | + if ( ! $this->hasNamespace($metadata)) { |
|
608 | 608 | return ''; |
609 | 609 | } |
610 | 610 | |
611 | - return 'namespace ' . $this->getNamespace($metadata) .';'; |
|
611 | + return 'namespace '.$this->getNamespace($metadata).';'; |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | /** |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | */ |
617 | 617 | protected function generateEntityUse() |
618 | 618 | { |
619 | - if (! $this->generateAnnotations) { |
|
619 | + if ( ! $this->generateAnnotations) { |
|
620 | 620 | return ''; |
621 | 621 | } |
622 | 622 | |
@@ -630,8 +630,8 @@ discard block |
||
630 | 630 | */ |
631 | 631 | protected function generateEntityClassName(ClassMetadataInfo $metadata) |
632 | 632 | { |
633 | - return 'class ' . $this->getClassName($metadata) . |
|
634 | - ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null); |
|
633 | + return 'class '.$this->getClassName($metadata). |
|
634 | + ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null); |
|
635 | 635 | } |
636 | 636 | |
637 | 637 | /** |
@@ -733,13 +733,13 @@ discard block |
||
733 | 733 | $fieldMappings = array_merge($requiredFields, $optionalFields); |
734 | 734 | |
735 | 735 | foreach ($metadata->embeddedClasses as $fieldName => $embeddedClass) { |
736 | - $paramType = '\\' . ltrim($embeddedClass['class'], '\\'); |
|
737 | - $paramVariable = '$' . $fieldName; |
|
736 | + $paramType = '\\'.ltrim($embeddedClass['class'], '\\'); |
|
737 | + $paramVariable = '$'.$fieldName; |
|
738 | 738 | |
739 | 739 | $paramTypes[] = $paramType; |
740 | 740 | $paramVariables[] = $paramVariable; |
741 | - $params[] = $paramType . ' ' . $paramVariable; |
|
742 | - $fields[] = '$this->' . $fieldName . ' = ' . $paramVariable . ';'; |
|
741 | + $params[] = $paramType.' '.$paramVariable; |
|
742 | + $fields[] = '$this->'.$fieldName.' = '.$paramVariable.';'; |
|
743 | 743 | } |
744 | 744 | |
745 | 745 | foreach ($fieldMappings as $fieldMapping) { |
@@ -747,27 +747,27 @@ discard block |
||
747 | 747 | continue; |
748 | 748 | } |
749 | 749 | |
750 | - $paramTypes[] = $this->getType($fieldMapping['type']) . (!empty($fieldMapping['nullable']) ? '|null' : ''); |
|
751 | - $param = '$' . $fieldMapping['fieldName']; |
|
750 | + $paramTypes[] = $this->getType($fieldMapping['type']).( ! empty($fieldMapping['nullable']) ? '|null' : ''); |
|
751 | + $param = '$'.$fieldMapping['fieldName']; |
|
752 | 752 | $paramVariables[] = $param; |
753 | 753 | |
754 | 754 | if ($fieldMapping['type'] === 'datetime') { |
755 | - $param = $this->getType($fieldMapping['type']) . ' ' . $param; |
|
755 | + $param = $this->getType($fieldMapping['type']).' '.$param; |
|
756 | 756 | } |
757 | 757 | |
758 | - if (!empty($fieldMapping['nullable'])) { |
|
758 | + if ( ! empty($fieldMapping['nullable'])) { |
|
759 | 759 | $param .= ' = null'; |
760 | 760 | } |
761 | 761 | |
762 | 762 | $params[] = $param; |
763 | 763 | |
764 | - $fields[] = '$this->' . $fieldMapping['fieldName'] . ' = $' . $fieldMapping['fieldName'] . ';'; |
|
764 | + $fields[] = '$this->'.$fieldMapping['fieldName'].' = $'.$fieldMapping['fieldName'].';'; |
|
765 | 765 | } |
766 | 766 | |
767 | 767 | $maxParamTypeLength = max(array_map('strlen', $paramTypes)); |
768 | 768 | $paramTags = array_map( |
769 | - function ($type, $variable) use ($maxParamTypeLength) { |
|
770 | - return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable; |
|
769 | + function($type, $variable) use ($maxParamTypeLength) { |
|
770 | + return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable; |
|
771 | 771 | }, |
772 | 772 | $paramTypes, |
773 | 773 | $paramVariables |
@@ -775,8 +775,8 @@ discard block |
||
775 | 775 | |
776 | 776 | // Generate multi line constructor if the signature exceeds 120 characters. |
777 | 777 | if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) { |
778 | - $delimiter = "\n" . $this->spaces; |
|
779 | - $params = $delimiter . implode(',' . $delimiter, $params) . "\n"; |
|
778 | + $delimiter = "\n".$this->spaces; |
|
779 | + $params = $delimiter.implode(','.$delimiter, $params)."\n"; |
|
780 | 780 | } else { |
781 | 781 | $params = implode(', ', $params); |
782 | 782 | } |
@@ -784,7 +784,7 @@ discard block |
||
784 | 784 | $replacements = [ |
785 | 785 | '<paramTags>' => implode("\n * ", $paramTags), |
786 | 786 | '<params>' => $params, |
787 | - '<fields>' => implode("\n" . $this->spaces, $fields), |
|
787 | + '<fields>' => implode("\n".$this->spaces, $fields), |
|
788 | 788 | ]; |
789 | 789 | |
790 | 790 | $constructor = str_replace( |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | |
830 | 830 | if ($inClass) { |
831 | 831 | $inClass = false; |
832 | - $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1]; |
|
832 | + $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1]; |
|
833 | 833 | $this->staticReflection[$lastSeenClass]['properties'] = []; |
834 | 834 | $this->staticReflection[$lastSeenClass]['methods'] = []; |
835 | 835 | } |
@@ -837,16 +837,16 @@ discard block |
||
837 | 837 | if (T_NAMESPACE === $token[0]) { |
838 | 838 | $lastSeenNamespace = ''; |
839 | 839 | $inNamespace = true; |
840 | - } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) { |
|
840 | + } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) { |
|
841 | 841 | $inClass = true; |
842 | 842 | } elseif (T_FUNCTION === $token[0]) { |
843 | - if (T_STRING === $tokens[$i+2][0]) { |
|
844 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]); |
|
845 | - } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) { |
|
846 | - $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]); |
|
843 | + if (T_STRING === $tokens[$i + 2][0]) { |
|
844 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]); |
|
845 | + } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) { |
|
846 | + $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]); |
|
847 | 847 | } |
848 | - } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) { |
|
849 | - $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1); |
|
848 | + } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) { |
|
849 | + $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1); |
|
850 | 850 | } |
851 | 851 | } |
852 | 852 | } |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | */ |
860 | 860 | protected function hasProperty($property, ClassMetadataInfo $metadata) |
861 | 861 | { |
862 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
862 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
863 | 863 | // don't generate property if its already on the base class. |
864 | 864 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
865 | 865 | if ($reflClass->hasProperty($property)) { |
@@ -888,7 +888,7 @@ discard block |
||
888 | 888 | */ |
889 | 889 | protected function hasMethod($method, ClassMetadataInfo $metadata) |
890 | 890 | { |
891 | - if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->name))) { |
|
891 | + if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->name))) { |
|
892 | 892 | // don't generate method if its already on the base class. |
893 | 893 | $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->name); |
894 | 894 | |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | */ |
920 | 920 | protected function getTraits(ClassMetadataInfo $metadata) |
921 | 921 | { |
922 | - if (! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
922 | + if ( ! ($metadata->reflClass !== null || class_exists($metadata->name))) { |
|
923 | 923 | return []; |
924 | 924 | } |
925 | 925 | |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | { |
970 | 970 | $refl = new \ReflectionClass($this->getClassToExtend()); |
971 | 971 | |
972 | - return '\\' . $refl->getName(); |
|
972 | + return '\\'.$refl->getName(); |
|
973 | 973 | } |
974 | 974 | |
975 | 975 | /** |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | { |
1003 | 1003 | $lines = []; |
1004 | 1004 | $lines[] = '/**'; |
1005 | - $lines[] = ' * ' . $this->getClassName($metadata); |
|
1005 | + $lines[] = ' * '.$this->getClassName($metadata); |
|
1006 | 1006 | |
1007 | 1007 | if ($this->generateAnnotations) { |
1008 | 1008 | $lines[] = ' *'; |
@@ -1018,12 +1018,12 @@ discard block |
||
1018 | 1018 | |
1019 | 1019 | foreach ($methods as $method) { |
1020 | 1020 | if ($code = $this->$method($metadata)) { |
1021 | - $lines[] = ' * ' . $code; |
|
1021 | + $lines[] = ' * '.$code; |
|
1022 | 1022 | } |
1023 | 1023 | } |
1024 | 1024 | |
1025 | 1025 | if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) { |
1026 | - $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks'; |
|
1026 | + $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks'; |
|
1027 | 1027 | } |
1028 | 1028 | } |
1029 | 1029 | |
@@ -1039,17 +1039,17 @@ discard block |
||
1039 | 1039 | */ |
1040 | 1040 | protected function generateEntityAnnotation(ClassMetadataInfo $metadata) |
1041 | 1041 | { |
1042 | - $prefix = '@' . $this->annotationsPrefix; |
|
1042 | + $prefix = '@'.$this->annotationsPrefix; |
|
1043 | 1043 | |
1044 | 1044 | if ($metadata->isEmbeddedClass) { |
1045 | - return $prefix . 'Embeddable'; |
|
1045 | + return $prefix.'Embeddable'; |
|
1046 | 1046 | } |
1047 | 1047 | |
1048 | 1048 | $customRepository = $metadata->customRepositoryClassName |
1049 | - ? '(repositoryClass="' . $metadata->customRepositoryClassName . '")' |
|
1049 | + ? '(repositoryClass="'.$metadata->customRepositoryClassName.'")' |
|
1050 | 1050 | : ''; |
1051 | 1051 | |
1052 | - return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository; |
|
1052 | + return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository; |
|
1053 | 1053 | } |
1054 | 1054 | |
1055 | 1055 | /** |
@@ -1066,28 +1066,28 @@ discard block |
||
1066 | 1066 | $table = []; |
1067 | 1067 | |
1068 | 1068 | if (isset($metadata->table['schema'])) { |
1069 | - $table[] = 'schema="' . $metadata->table['schema'] . '"'; |
|
1069 | + $table[] = 'schema="'.$metadata->table['schema'].'"'; |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | if (isset($metadata->table['name'])) { |
1073 | - $table[] = 'name="' . $metadata->table['name'] . '"'; |
|
1073 | + $table[] = 'name="'.$metadata->table['name'].'"'; |
|
1074 | 1074 | } |
1075 | 1075 | |
1076 | 1076 | if (isset($metadata->table['options']) && $metadata->table['options']) { |
1077 | - $table[] = 'options={' . $this->exportTableOptions((array) $metadata->table['options']) . '}'; |
|
1077 | + $table[] = 'options={'.$this->exportTableOptions((array) $metadata->table['options']).'}'; |
|
1078 | 1078 | } |
1079 | 1079 | |
1080 | 1080 | if (isset($metadata->table['uniqueConstraints']) && $metadata->table['uniqueConstraints']) { |
1081 | 1081 | $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table['uniqueConstraints']); |
1082 | - $table[] = 'uniqueConstraints={' . $constraints . '}'; |
|
1082 | + $table[] = 'uniqueConstraints={'.$constraints.'}'; |
|
1083 | 1083 | } |
1084 | 1084 | |
1085 | 1085 | if (isset($metadata->table['indexes']) && $metadata->table['indexes']) { |
1086 | 1086 | $constraints = $this->generateTableConstraints('Index', $metadata->table['indexes']); |
1087 | - $table[] = 'indexes={' . $constraints . '}'; |
|
1087 | + $table[] = 'indexes={'.$constraints.'}'; |
|
1088 | 1088 | } |
1089 | 1089 | |
1090 | - return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')'; |
|
1090 | + return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')'; |
|
1091 | 1091 | } |
1092 | 1092 | |
1093 | 1093 | /** |
@@ -1102,9 +1102,9 @@ discard block |
||
1102 | 1102 | foreach ($constraints as $name => $constraint) { |
1103 | 1103 | $columns = []; |
1104 | 1104 | foreach ($constraint['columns'] as $column) { |
1105 | - $columns[] = '"' . $column . '"'; |
|
1105 | + $columns[] = '"'.$column.'"'; |
|
1106 | 1106 | } |
1107 | - $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})'; |
|
1107 | + $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})'; |
|
1108 | 1108 | } |
1109 | 1109 | |
1110 | 1110 | return implode(', ', $annotations); |
@@ -1121,7 +1121,7 @@ discard block |
||
1121 | 1121 | return ''; |
1122 | 1122 | } |
1123 | 1123 | |
1124 | - return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1124 | + return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")'; |
|
1125 | 1125 | } |
1126 | 1126 | |
1127 | 1127 | /** |
@@ -1136,11 +1136,11 @@ discard block |
||
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | $discrColumn = $metadata->discriminatorColumn; |
1139 | - $columnDefinition = 'name="' . $discrColumn['name'] |
|
1140 | - . '", type="' . $discrColumn['type'] |
|
1141 | - . '", length=' . $discrColumn['length']; |
|
1139 | + $columnDefinition = 'name="'.$discrColumn['name'] |
|
1140 | + . '", type="'.$discrColumn['type'] |
|
1141 | + . '", length='.$discrColumn['length']; |
|
1142 | 1142 | |
1143 | - return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')'; |
|
1143 | + return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')'; |
|
1144 | 1144 | } |
1145 | 1145 | |
1146 | 1146 | /** |
@@ -1157,10 +1157,10 @@ discard block |
||
1157 | 1157 | $inheritanceClassMap = []; |
1158 | 1158 | |
1159 | 1159 | foreach ($metadata->discriminatorMap as $type => $class) { |
1160 | - $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"'; |
|
1160 | + $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"'; |
|
1161 | 1161 | } |
1162 | 1162 | |
1163 | - return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})'; |
|
1163 | + return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})'; |
|
1164 | 1164 | } |
1165 | 1165 | |
1166 | 1166 | /** |
@@ -1179,8 +1179,8 @@ discard block |
||
1179 | 1179 | |
1180 | 1180 | $nullableField = $this->nullableFieldExpression($fieldMapping); |
1181 | 1181 | |
1182 | - if ((!$metadata->isEmbeddedClass || !$this->embeddablesImmutable) |
|
1183 | - && (!isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1182 | + if (( ! $metadata->isEmbeddedClass || ! $this->embeddablesImmutable) |
|
1183 | + && ( ! isset($fieldMapping['id']) || ! $fieldMapping['id'] || $metadata->generatorType === ClassMetadataInfo::GENERATOR_TYPE_NONE) |
|
1184 | 1184 | && $code = $this->generateEntityStubMethod($metadata, 'set', $fieldMapping['fieldName'], $fieldMapping['type'], $nullableField) |
1185 | 1185 | ) { |
1186 | 1186 | $methods[] = $code; |
@@ -1251,7 +1251,7 @@ discard block |
||
1251 | 1251 | } |
1252 | 1252 | |
1253 | 1253 | foreach ($joinColumns as $joinColumn) { |
1254 | - if (isset($joinColumn['nullable']) && !$joinColumn['nullable']) { |
|
1254 | + if (isset($joinColumn['nullable']) && ! $joinColumn['nullable']) { |
|
1255 | 1255 | return false; |
1256 | 1256 | } |
1257 | 1257 | } |
@@ -1296,8 +1296,8 @@ discard block |
||
1296 | 1296 | } |
1297 | 1297 | |
1298 | 1298 | $lines[] = $this->generateAssociationMappingPropertyDocBlock($associationMapping, $metadata); |
1299 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $associationMapping['fieldName'] |
|
1300 | - . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null) . ";\n"; |
|
1299 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$associationMapping['fieldName'] |
|
1300 | + . ($associationMapping['type'] == 'manyToMany' ? ' = array()' : null).";\n"; |
|
1301 | 1301 | } |
1302 | 1302 | |
1303 | 1303 | return implode("\n", $lines); |
@@ -1321,8 +1321,8 @@ discard block |
||
1321 | 1321 | } |
1322 | 1322 | |
1323 | 1323 | $lines[] = $this->generateFieldMappingPropertyDocBlock($fieldMapping, $metadata); |
1324 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldMapping['fieldName'] |
|
1325 | - . (isset($fieldMapping['options']['default']) ? ' = ' . var_export($fieldMapping['options']['default'], true) : null) . ";\n"; |
|
1324 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldMapping['fieldName'] |
|
1325 | + . (isset($fieldMapping['options']['default']) ? ' = '.var_export($fieldMapping['options']['default'], true) : null).";\n"; |
|
1326 | 1326 | } |
1327 | 1327 | |
1328 | 1328 | return implode("\n", $lines); |
@@ -1343,7 +1343,7 @@ discard block |
||
1343 | 1343 | } |
1344 | 1344 | |
1345 | 1345 | $lines[] = $this->generateEmbeddedPropertyDocBlock($embeddedClass); |
1346 | - $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . ";\n"; |
|
1346 | + $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.";\n"; |
|
1347 | 1347 | } |
1348 | 1348 | |
1349 | 1349 | return implode("\n", $lines); |
@@ -1360,7 +1360,7 @@ discard block |
||
1360 | 1360 | */ |
1361 | 1361 | protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null) |
1362 | 1362 | { |
1363 | - $methodName = $type . Inflector::classify($fieldName); |
|
1363 | + $methodName = $type.Inflector::classify($fieldName); |
|
1364 | 1364 | $variableName = Inflector::camelize($fieldName); |
1365 | 1365 | if (in_array($type, ["add", "remove"])) { |
1366 | 1366 | $methodName = Inflector::singularize($methodName); |
@@ -1380,18 +1380,18 @@ discard block |
||
1380 | 1380 | $variableType = $typeHint ? $this->getType($typeHint) : null; |
1381 | 1381 | |
1382 | 1382 | if ($typeHint && ! isset($types[$typeHint])) { |
1383 | - $variableType = '\\' . ltrim($variableType, '\\'); |
|
1384 | - $methodTypeHint = '\\' . $typeHint . ' '; |
|
1383 | + $variableType = '\\'.ltrim($variableType, '\\'); |
|
1384 | + $methodTypeHint = '\\'.$typeHint.' '; |
|
1385 | 1385 | } |
1386 | 1386 | |
1387 | 1387 | $replacements = [ |
1388 | - '<description>' => ucfirst($type) . ' ' . $variableName . '.', |
|
1388 | + '<description>' => ucfirst($type).' '.$variableName.'.', |
|
1389 | 1389 | '<methodTypeHint>' => $methodTypeHint, |
1390 | - '<variableType>' => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''), |
|
1390 | + '<variableType>' => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''), |
|
1391 | 1391 | '<variableName>' => $variableName, |
1392 | 1392 | '<methodName>' => $methodName, |
1393 | 1393 | '<fieldName>' => $fieldName, |
1394 | - '<variableDefault>' => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '', |
|
1394 | + '<variableDefault>' => ($defaultValue !== null) ? (' = '.$defaultValue) : '', |
|
1395 | 1395 | '<entity>' => $this->getClassName($metadata) |
1396 | 1396 | ]; |
1397 | 1397 | |
@@ -1420,7 +1420,7 @@ discard block |
||
1420 | 1420 | $this->staticReflection[$metadata->name]['methods'][] = $methodName; |
1421 | 1421 | |
1422 | 1422 | $replacements = [ |
1423 | - '<name>' => $this->annotationsPrefix . ucfirst($name), |
|
1423 | + '<name>' => $this->annotationsPrefix.ucfirst($name), |
|
1424 | 1424 | '<methodName>' => $methodName, |
1425 | 1425 | ]; |
1426 | 1426 | |
@@ -1443,30 +1443,30 @@ discard block |
||
1443 | 1443 | $joinColumnAnnot = []; |
1444 | 1444 | |
1445 | 1445 | if (isset($joinColumn['name'])) { |
1446 | - $joinColumnAnnot[] = 'name="' . $joinColumn['name'] . '"'; |
|
1446 | + $joinColumnAnnot[] = 'name="'.$joinColumn['name'].'"'; |
|
1447 | 1447 | } |
1448 | 1448 | |
1449 | 1449 | if (isset($joinColumn['referencedColumnName'])) { |
1450 | - $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn['referencedColumnName'] . '"'; |
|
1450 | + $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn['referencedColumnName'].'"'; |
|
1451 | 1451 | } |
1452 | 1452 | |
1453 | 1453 | if (isset($joinColumn['unique']) && $joinColumn['unique']) { |
1454 | - $joinColumnAnnot[] = 'unique=' . ($joinColumn['unique'] ? 'true' : 'false'); |
|
1454 | + $joinColumnAnnot[] = 'unique='.($joinColumn['unique'] ? 'true' : 'false'); |
|
1455 | 1455 | } |
1456 | 1456 | |
1457 | 1457 | if (isset($joinColumn['nullable'])) { |
1458 | - $joinColumnAnnot[] = 'nullable=' . ($joinColumn['nullable'] ? 'true' : 'false'); |
|
1458 | + $joinColumnAnnot[] = 'nullable='.($joinColumn['nullable'] ? 'true' : 'false'); |
|
1459 | 1459 | } |
1460 | 1460 | |
1461 | 1461 | if (isset($joinColumn['onDelete'])) { |
1462 | - $joinColumnAnnot[] = 'onDelete="' . ($joinColumn['onDelete'] . '"'); |
|
1462 | + $joinColumnAnnot[] = 'onDelete="'.($joinColumn['onDelete'].'"'); |
|
1463 | 1463 | } |
1464 | 1464 | |
1465 | 1465 | if (isset($joinColumn['columnDefinition'])) { |
1466 | - $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn['columnDefinition'] . '"'; |
|
1466 | + $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn['columnDefinition'].'"'; |
|
1467 | 1467 | } |
1468 | 1468 | |
1469 | - return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')'; |
|
1469 | + return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')'; |
|
1470 | 1470 | } |
1471 | 1471 | |
1472 | 1472 | /** |
@@ -1478,22 +1478,22 @@ discard block |
||
1478 | 1478 | protected function generateAssociationMappingPropertyDocBlock(array $associationMapping, ClassMetadataInfo $metadata) |
1479 | 1479 | { |
1480 | 1480 | $lines = []; |
1481 | - $lines[] = $this->spaces . '/**'; |
|
1481 | + $lines[] = $this->spaces.'/**'; |
|
1482 | 1482 | |
1483 | 1483 | if ($associationMapping['type'] & ClassMetadataInfo::TO_MANY) { |
1484 | - $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection'; |
|
1484 | + $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection'; |
|
1485 | 1485 | } else { |
1486 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($associationMapping['targetEntity'], '\\'); |
|
1486 | + $lines[] = $this->spaces.' * @var \\'.ltrim($associationMapping['targetEntity'], '\\'); |
|
1487 | 1487 | } |
1488 | 1488 | |
1489 | 1489 | if ($this->generateAnnotations) { |
1490 | - $lines[] = $this->spaces . ' *'; |
|
1490 | + $lines[] = $this->spaces.' *'; |
|
1491 | 1491 | |
1492 | 1492 | if (isset($associationMapping['id']) && $associationMapping['id']) { |
1493 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1493 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1494 | 1494 | |
1495 | 1495 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1496 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1496 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1497 | 1497 | } |
1498 | 1498 | } |
1499 | 1499 | |
@@ -1515,15 +1515,15 @@ discard block |
||
1515 | 1515 | $typeOptions = []; |
1516 | 1516 | |
1517 | 1517 | if (isset($associationMapping['targetEntity'])) { |
1518 | - $typeOptions[] = 'targetEntity="' . $associationMapping['targetEntity'] . '"'; |
|
1518 | + $typeOptions[] = 'targetEntity="'.$associationMapping['targetEntity'].'"'; |
|
1519 | 1519 | } |
1520 | 1520 | |
1521 | 1521 | if (isset($associationMapping['inversedBy'])) { |
1522 | - $typeOptions[] = 'inversedBy="' . $associationMapping['inversedBy'] . '"'; |
|
1522 | + $typeOptions[] = 'inversedBy="'.$associationMapping['inversedBy'].'"'; |
|
1523 | 1523 | } |
1524 | 1524 | |
1525 | 1525 | if (isset($associationMapping['mappedBy'])) { |
1526 | - $typeOptions[] = 'mappedBy="' . $associationMapping['mappedBy'] . '"'; |
|
1526 | + $typeOptions[] = 'mappedBy="'.$associationMapping['mappedBy'].'"'; |
|
1527 | 1527 | } |
1528 | 1528 | |
1529 | 1529 | if ($associationMapping['cascade']) { |
@@ -1539,11 +1539,11 @@ discard block |
||
1539 | 1539 | $cascades = ['"all"']; |
1540 | 1540 | } |
1541 | 1541 | |
1542 | - $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}'; |
|
1542 | + $typeOptions[] = 'cascade={'.implode(',', $cascades).'}'; |
|
1543 | 1543 | } |
1544 | 1544 | |
1545 | 1545 | if (isset($associationMapping['orphanRemoval']) && $associationMapping['orphanRemoval']) { |
1546 | - $typeOptions[] = 'orphanRemoval=' . ($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1546 | + $typeOptions[] = 'orphanRemoval='.($associationMapping['orphanRemoval'] ? 'true' : 'false'); |
|
1547 | 1547 | } |
1548 | 1548 | |
1549 | 1549 | if (isset($associationMapping['fetch']) && $associationMapping['fetch'] !== ClassMetadataInfo::FETCH_LAZY) { |
@@ -1552,71 +1552,71 @@ discard block |
||
1552 | 1552 | ClassMetadataInfo::FETCH_EAGER => 'EAGER', |
1553 | 1553 | ]; |
1554 | 1554 | |
1555 | - $typeOptions[] = 'fetch="' . $fetchMap[$associationMapping['fetch']] . '"'; |
|
1555 | + $typeOptions[] = 'fetch="'.$fetchMap[$associationMapping['fetch']].'"'; |
|
1556 | 1556 | } |
1557 | 1557 | |
1558 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')'; |
|
1558 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')'; |
|
1559 | 1559 | |
1560 | 1560 | if (isset($associationMapping['joinColumns']) && $associationMapping['joinColumns']) { |
1561 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({'; |
|
1561 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({'; |
|
1562 | 1562 | |
1563 | 1563 | $joinColumnsLines = []; |
1564 | 1564 | |
1565 | 1565 | foreach ($associationMapping['joinColumns'] as $joinColumn) { |
1566 | 1566 | if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) { |
1567 | - $joinColumnsLines[] = $this->spaces . ' * ' . $joinColumnAnnot; |
|
1567 | + $joinColumnsLines[] = $this->spaces.' * '.$joinColumnAnnot; |
|
1568 | 1568 | } |
1569 | 1569 | } |
1570 | 1570 | |
1571 | 1571 | $lines[] = implode(",\n", $joinColumnsLines); |
1572 | - $lines[] = $this->spaces . ' * })'; |
|
1572 | + $lines[] = $this->spaces.' * })'; |
|
1573 | 1573 | } |
1574 | 1574 | |
1575 | 1575 | if (isset($associationMapping['joinTable']) && $associationMapping['joinTable']) { |
1576 | 1576 | $joinTable = []; |
1577 | - $joinTable[] = 'name="' . $associationMapping['joinTable']['name'] . '"'; |
|
1577 | + $joinTable[] = 'name="'.$associationMapping['joinTable']['name'].'"'; |
|
1578 | 1578 | |
1579 | 1579 | if (isset($associationMapping['joinTable']['schema'])) { |
1580 | - $joinTable[] = 'schema="' . $associationMapping['joinTable']['schema'] . '"'; |
|
1580 | + $joinTable[] = 'schema="'.$associationMapping['joinTable']['schema'].'"'; |
|
1581 | 1581 | } |
1582 | 1582 | |
1583 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTable) . ','; |
|
1584 | - $lines[] = $this->spaces . ' * joinColumns={'; |
|
1583 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTable).','; |
|
1584 | + $lines[] = $this->spaces.' * joinColumns={'; |
|
1585 | 1585 | |
1586 | 1586 | $joinColumnsLines = []; |
1587 | 1587 | |
1588 | 1588 | foreach ($associationMapping['joinTable']['joinColumns'] as $joinColumn) { |
1589 | - $joinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1589 | + $joinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1590 | 1590 | } |
1591 | 1591 | |
1592 | - $lines[] = implode(",". PHP_EOL, $joinColumnsLines); |
|
1593 | - $lines[] = $this->spaces . ' * },'; |
|
1594 | - $lines[] = $this->spaces . ' * inverseJoinColumns={'; |
|
1592 | + $lines[] = implode(",".PHP_EOL, $joinColumnsLines); |
|
1593 | + $lines[] = $this->spaces.' * },'; |
|
1594 | + $lines[] = $this->spaces.' * inverseJoinColumns={'; |
|
1595 | 1595 | |
1596 | 1596 | $inverseJoinColumnsLines = []; |
1597 | 1597 | |
1598 | 1598 | foreach ($associationMapping['joinTable']['inverseJoinColumns'] as $joinColumn) { |
1599 | - $inverseJoinColumnsLines[] = $this->spaces . ' * ' . $this->generateJoinColumnAnnotation($joinColumn); |
|
1599 | + $inverseJoinColumnsLines[] = $this->spaces.' * '.$this->generateJoinColumnAnnotation($joinColumn); |
|
1600 | 1600 | } |
1601 | 1601 | |
1602 | - $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines); |
|
1603 | - $lines[] = $this->spaces . ' * }'; |
|
1604 | - $lines[] = $this->spaces . ' * )'; |
|
1602 | + $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines); |
|
1603 | + $lines[] = $this->spaces.' * }'; |
|
1604 | + $lines[] = $this->spaces.' * )'; |
|
1605 | 1605 | } |
1606 | 1606 | |
1607 | 1607 | if (isset($associationMapping['orderBy'])) { |
1608 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({'; |
|
1608 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({'; |
|
1609 | 1609 | |
1610 | 1610 | foreach ($associationMapping['orderBy'] as $name => $direction) { |
1611 | - $lines[] = $this->spaces . ' * "' . $name . '"="' . $direction . '",'; |
|
1611 | + $lines[] = $this->spaces.' * "'.$name.'"="'.$direction.'",'; |
|
1612 | 1612 | } |
1613 | 1613 | |
1614 | 1614 | $lines[count($lines) - 1] = substr($lines[count($lines) - 1], 0, strlen($lines[count($lines) - 1]) - 1); |
1615 | - $lines[] = $this->spaces . ' * })'; |
|
1615 | + $lines[] = $this->spaces.' * })'; |
|
1616 | 1616 | } |
1617 | 1617 | } |
1618 | 1618 | |
1619 | - $lines[] = $this->spaces . ' */'; |
|
1619 | + $lines[] = $this->spaces.' */'; |
|
1620 | 1620 | |
1621 | 1621 | return implode("\n", $lines); |
1622 | 1622 | } |
@@ -1630,37 +1630,37 @@ discard block |
||
1630 | 1630 | protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, ClassMetadataInfo $metadata) |
1631 | 1631 | { |
1632 | 1632 | $lines = []; |
1633 | - $lines[] = $this->spaces . '/**'; |
|
1634 | - $lines[] = $this->spaces . ' * @var ' |
|
1633 | + $lines[] = $this->spaces.'/**'; |
|
1634 | + $lines[] = $this->spaces.' * @var ' |
|
1635 | 1635 | . $this->getType($fieldMapping['type']) |
1636 | 1636 | . ($this->nullableFieldExpression($fieldMapping) ? '|null' : ''); |
1637 | 1637 | |
1638 | 1638 | if ($this->generateAnnotations) { |
1639 | - $lines[] = $this->spaces . ' *'; |
|
1639 | + $lines[] = $this->spaces.' *'; |
|
1640 | 1640 | |
1641 | 1641 | $column = []; |
1642 | 1642 | if (isset($fieldMapping['columnName'])) { |
1643 | - $column[] = 'name="' . $fieldMapping['columnName'] . '"'; |
|
1643 | + $column[] = 'name="'.$fieldMapping['columnName'].'"'; |
|
1644 | 1644 | } |
1645 | 1645 | |
1646 | 1646 | if (isset($fieldMapping['type'])) { |
1647 | - $column[] = 'type="' . $fieldMapping['type'] . '"'; |
|
1647 | + $column[] = 'type="'.$fieldMapping['type'].'"'; |
|
1648 | 1648 | } |
1649 | 1649 | |
1650 | 1650 | if (isset($fieldMapping['length'])) { |
1651 | - $column[] = 'length=' . $fieldMapping['length']; |
|
1651 | + $column[] = 'length='.$fieldMapping['length']; |
|
1652 | 1652 | } |
1653 | 1653 | |
1654 | 1654 | if (isset($fieldMapping['precision'])) { |
1655 | - $column[] = 'precision=' . $fieldMapping['precision']; |
|
1655 | + $column[] = 'precision='.$fieldMapping['precision']; |
|
1656 | 1656 | } |
1657 | 1657 | |
1658 | 1658 | if (isset($fieldMapping['scale'])) { |
1659 | - $column[] = 'scale=' . $fieldMapping['scale']; |
|
1659 | + $column[] = 'scale='.$fieldMapping['scale']; |
|
1660 | 1660 | } |
1661 | 1661 | |
1662 | 1662 | if (isset($fieldMapping['nullable'])) { |
1663 | - $column[] = 'nullable=' . var_export($fieldMapping['nullable'], true); |
|
1663 | + $column[] = 'nullable='.var_export($fieldMapping['nullable'], true); |
|
1664 | 1664 | } |
1665 | 1665 | |
1666 | 1666 | $options = []; |
@@ -1674,47 +1674,47 @@ discard block |
||
1674 | 1674 | } |
1675 | 1675 | |
1676 | 1676 | if (isset($fieldMapping['columnDefinition'])) { |
1677 | - $column[] = 'columnDefinition="' . $fieldMapping['columnDefinition'] . '"'; |
|
1677 | + $column[] = 'columnDefinition="'.$fieldMapping['columnDefinition'].'"'; |
|
1678 | 1678 | } |
1679 | 1679 | |
1680 | 1680 | if (isset($fieldMapping['unique'])) { |
1681 | - $column[] = 'unique=' . var_export($fieldMapping['unique'], true); |
|
1681 | + $column[] = 'unique='.var_export($fieldMapping['unique'], true); |
|
1682 | 1682 | } |
1683 | 1683 | |
1684 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')'; |
|
1684 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')'; |
|
1685 | 1685 | |
1686 | 1686 | if (isset($fieldMapping['id']) && $fieldMapping['id']) { |
1687 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id'; |
|
1687 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id'; |
|
1688 | 1688 | |
1689 | 1689 | if ($generatorType = $this->getIdGeneratorTypeString($metadata->generatorType)) { |
1690 | - $lines[] = $this->spaces.' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")'; |
|
1690 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")'; |
|
1691 | 1691 | } |
1692 | 1692 | |
1693 | 1693 | if ($metadata->sequenceGeneratorDefinition) { |
1694 | 1694 | $sequenceGenerator = []; |
1695 | 1695 | |
1696 | 1696 | if (isset($metadata->sequenceGeneratorDefinition['sequenceName'])) { |
1697 | - $sequenceGenerator[] = 'sequenceName="' . $metadata->sequenceGeneratorDefinition['sequenceName'] . '"'; |
|
1697 | + $sequenceGenerator[] = 'sequenceName="'.$metadata->sequenceGeneratorDefinition['sequenceName'].'"'; |
|
1698 | 1698 | } |
1699 | 1699 | |
1700 | 1700 | if (isset($metadata->sequenceGeneratorDefinition['allocationSize'])) { |
1701 | - $sequenceGenerator[] = 'allocationSize=' . $metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1701 | + $sequenceGenerator[] = 'allocationSize='.$metadata->sequenceGeneratorDefinition['allocationSize']; |
|
1702 | 1702 | } |
1703 | 1703 | |
1704 | 1704 | if (isset($metadata->sequenceGeneratorDefinition['initialValue'])) { |
1705 | - $sequenceGenerator[] = 'initialValue=' . $metadata->sequenceGeneratorDefinition['initialValue']; |
|
1705 | + $sequenceGenerator[] = 'initialValue='.$metadata->sequenceGeneratorDefinition['initialValue']; |
|
1706 | 1706 | } |
1707 | 1707 | |
1708 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $sequenceGenerator) . ')'; |
|
1708 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $sequenceGenerator).')'; |
|
1709 | 1709 | } |
1710 | 1710 | } |
1711 | 1711 | |
1712 | 1712 | if (isset($fieldMapping['version']) && $fieldMapping['version']) { |
1713 | - $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version'; |
|
1713 | + $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version'; |
|
1714 | 1714 | } |
1715 | 1715 | } |
1716 | 1716 | |
1717 | - $lines[] = $this->spaces . ' */'; |
|
1717 | + $lines[] = $this->spaces.' */'; |
|
1718 | 1718 | |
1719 | 1719 | return implode("\n", $lines); |
1720 | 1720 | } |
@@ -1727,27 +1727,27 @@ discard block |
||
1727 | 1727 | protected function generateEmbeddedPropertyDocBlock(array $embeddedClass) |
1728 | 1728 | { |
1729 | 1729 | $lines = []; |
1730 | - $lines[] = $this->spaces . '/**'; |
|
1731 | - $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\'); |
|
1730 | + $lines[] = $this->spaces.'/**'; |
|
1731 | + $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\'); |
|
1732 | 1732 | |
1733 | 1733 | if ($this->generateAnnotations) { |
1734 | - $lines[] = $this->spaces . ' *'; |
|
1734 | + $lines[] = $this->spaces.' *'; |
|
1735 | 1735 | |
1736 | - $embedded = ['class="' . $embeddedClass['class'] . '"']; |
|
1736 | + $embedded = ['class="'.$embeddedClass['class'].'"']; |
|
1737 | 1737 | |
1738 | 1738 | if (isset($embeddedClass['columnPrefix'])) { |
1739 | 1739 | if (is_string($embeddedClass['columnPrefix'])) { |
1740 | - $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"'; |
|
1740 | + $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"'; |
|
1741 | 1741 | } else { |
1742 | - $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true); |
|
1742 | + $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true); |
|
1743 | 1743 | } |
1744 | 1744 | } |
1745 | 1745 | |
1746 | - $lines[] = $this->spaces . ' * @' . |
|
1747 | - $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')'; |
|
1746 | + $lines[] = $this->spaces.' * @'. |
|
1747 | + $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')'; |
|
1748 | 1748 | } |
1749 | 1749 | |
1750 | - $lines[] = $this->spaces . ' */'; |
|
1750 | + $lines[] = $this->spaces.' */'; |
|
1751 | 1751 | |
1752 | 1752 | return implode("\n", $lines); |
1753 | 1753 | } |
@@ -1761,13 +1761,13 @@ discard block |
||
1761 | 1761 | $processedClasses = []; |
1762 | 1762 | foreach ($metadata->entityListeners as $event => $eventListeners) { |
1763 | 1763 | foreach ($eventListeners as $eventListener) { |
1764 | - $processedClasses[] = '"' . $eventListener['class'] . '"'; |
|
1764 | + $processedClasses[] = '"'.$eventListener['class'].'"'; |
|
1765 | 1765 | } |
1766 | 1766 | } |
1767 | 1767 | |
1768 | 1768 | return \sprintf( |
1769 | 1769 | '%s%s({%s})', |
1770 | - '@' . $this->annotationsPrefix, |
|
1770 | + '@'.$this->annotationsPrefix, |
|
1771 | 1771 | 'EntityListeners', |
1772 | 1772 | \implode(',', \array_unique($processedClasses)) |
1773 | 1773 | ); |
@@ -1785,7 +1785,7 @@ discard block |
||
1785 | 1785 | |
1786 | 1786 | foreach ($lines as $key => $value) { |
1787 | 1787 | if ( ! empty($value)) { |
1788 | - $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key]; |
|
1788 | + $lines[$key] = str_repeat($this->spaces, $num).$lines[$key]; |
|
1789 | 1789 | } |
1790 | 1790 | } |
1791 | 1791 | |
@@ -1867,9 +1867,9 @@ discard block |
||
1867 | 1867 | |
1868 | 1868 | foreach ($options as $name => $option) { |
1869 | 1869 | if (is_array($option)) { |
1870 | - $optionsStr[] = '"' . $name . '"={' . $this->exportTableOptions($option) . '}'; |
|
1870 | + $optionsStr[] = '"'.$name.'"={'.$this->exportTableOptions($option).'}'; |
|
1871 | 1871 | } else { |
1872 | - $optionsStr[] = '"' . $name . '"="' . (string) $option . '"'; |
|
1872 | + $optionsStr[] = '"'.$name.'"="'.(string) $option.'"'; |
|
1873 | 1873 | } |
1874 | 1874 | } |
1875 | 1875 |
@@ -721,13 +721,13 @@ |
||
721 | 721 | return $joinColumn; |
722 | 722 | } |
723 | 723 | |
724 | - /** |
|
725 | - * Parses the given field as array. |
|
726 | - * |
|
727 | - * @param SimpleXMLElement $fieldMapping |
|
728 | - * |
|
729 | - * @return array |
|
730 | - */ |
|
724 | + /** |
|
725 | + * Parses the given field as array. |
|
726 | + * |
|
727 | + * @param SimpleXMLElement $fieldMapping |
|
728 | + * |
|
729 | + * @return array |
|
730 | + */ |
|
731 | 731 | private function columnToArray(SimpleXMLElement $fieldMapping) |
732 | 732 | { |
733 | 733 | $mapping = [ |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | |
165 | 165 | if (isset($xmlRoot['inheritance-type'])) { |
166 | 166 | $inheritanceType = (string) $xmlRoot['inheritance-type']; |
167 | - $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . $inheritanceType)); |
|
167 | + $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_'.$inheritanceType)); |
|
168 | 168 | |
169 | 169 | if ($metadata->inheritanceType != Metadata::INHERITANCE_TYPE_NONE) { |
170 | 170 | // Evaluate <discriminator-column...> |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | |
368 | 368 | if (isset($oneToOneElement['fetch'])) { |
369 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToOneElement['fetch']); |
|
369 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToOneElement['fetch']); |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | if (isset($oneToOneElement['mapped-by'])) { |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | ]; |
416 | 416 | |
417 | 417 | if (isset($oneToManyElement['fetch'])) { |
418 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $oneToManyElement['fetch']); |
|
418 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $oneToManyElement['fetch']); |
|
419 | 419 | } |
420 | 420 | |
421 | 421 | if (isset($oneToManyElement->cascade)) { |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | } |
463 | 463 | |
464 | 464 | if (isset($manyToOneElement['fetch'])) { |
465 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToOneElement['fetch']); |
|
465 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToOneElement['fetch']); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | if (isset($manyToOneElement['inversed-by'])) { |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | ]; |
505 | 505 | |
506 | 506 | if (isset($manyToManyElement['fetch'])) { |
507 | - $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . (string) $manyToManyElement['fetch']); |
|
507 | + $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_'.(string) $manyToManyElement['fetch']); |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | if (isset($manyToManyElement['orphan-removal'])) { |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | |
625 | 625 | // Check for `fetch` |
626 | 626 | if (isset($overrideElement['fetch'])) { |
627 | - $override['fetch'] = constant(Metadata::class . '::FETCH_' . (string) $overrideElement['fetch']); |
|
627 | + $override['fetch'] = constant(Metadata::class.'::FETCH_'.(string) $overrideElement['fetch']); |
|
628 | 628 | } |
629 | 629 | |
630 | 630 | $metadata->setAssociationOverride($fieldName, $override); |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | // Evaluate <lifecycle-callbacks...> |
635 | 635 | if (isset($xmlRoot->{'lifecycle-callbacks'})) { |
636 | 636 | foreach ($xmlRoot->{'lifecycle-callbacks'}->{'lifecycle-callback'} as $lifecycleCallback) { |
637 | - $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::' . (string) $lifecycleCallback['type'])); |
|
637 | + $metadata->addLifecycleCallback((string) $lifecycleCallback['method'], constant('Doctrine\ORM\Events::'.(string) $lifecycleCallback['type'])); |
|
638 | 638 | } |
639 | 639 | } |
640 | 640 | |
@@ -795,12 +795,12 @@ discard block |
||
795 | 795 | $region = isset($cacheMapping['region']) ? (string) $cacheMapping['region'] : null; |
796 | 796 | $usage = isset($cacheMapping['usage']) ? strtoupper($cacheMapping['usage']) : null; |
797 | 797 | |
798 | - if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage)) { |
|
798 | + if ($usage && ! defined('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage)) { |
|
799 | 799 | throw new \InvalidArgumentException(sprintf('Invalid cache usage "%s"', $usage)); |
800 | 800 | } |
801 | 801 | |
802 | 802 | if ($usage) { |
803 | - $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_' . $usage); |
|
803 | + $usage = constant('Doctrine\ORM\Mapping\ClassMetadata::CACHE_USAGE_'.$usage); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | return [ |
@@ -152,7 +152,7 @@ |
||
152 | 152 | */ |
153 | 153 | public function addIndex(array $columns, $name) |
154 | 154 | { |
155 | - if (!isset($this->cm->table['indexes'])) { |
|
155 | + if ( ! isset($this->cm->table['indexes'])) { |
|
156 | 156 | $this->cm->table['indexes'] = []; |
157 | 157 | } |
158 | 158 |
@@ -1428,7 +1428,7 @@ |
||
1428 | 1428 | |
1429 | 1429 | if (Type::hasType($mapping['type']) && Type::getType($mapping['type'])->canRequireSQLConversion()) { |
1430 | 1430 | if (isset($mapping['id']) && true === $mapping['id']) { |
1431 | - throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); |
|
1431 | + throw MappingException::sqlConversionNotAllowedForIdentifiers($this->name, $mapping['fieldName'], $mapping['type']); |
|
1432 | 1432 | } |
1433 | 1433 | |
1434 | 1434 | $mapping['requireSQLConversion'] = true; |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | public function getSingleIdReflectionProperty() |
697 | 697 | { |
698 | 698 | if ($this->isIdentifierComposite) { |
699 | - throw new BadMethodCallException("Class " . $this->name . " has a composite identifier."); |
|
699 | + throw new BadMethodCallException("Class ".$this->name." has a composite identifier."); |
|
700 | 700 | } |
701 | 701 | |
702 | 702 | return $this->reflFields[$this->identifier[0]]; |
@@ -791,7 +791,7 @@ discard block |
||
791 | 791 | */ |
792 | 792 | public function __toString() |
793 | 793 | { |
794 | - return __CLASS__ . '@' . spl_object_hash($this); |
|
794 | + return __CLASS__.'@'.spl_object_hash($this); |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | /** |
@@ -1025,7 +1025,7 @@ discard block |
||
1025 | 1025 | public function validateAssociations() |
1026 | 1026 | { |
1027 | 1027 | foreach ($this->associationMappings as $mapping) { |
1028 | - if ( ! ClassLoader::classExists($mapping['targetEntity']) ) { |
|
1028 | + if ( ! ClassLoader::classExists($mapping['targetEntity'])) { |
|
1029 | 1029 | throw MappingException::invalidTargetEntityClass($mapping['targetEntity'], $this->name, $mapping['fieldName']); |
1030 | 1030 | } |
1031 | 1031 | } |
@@ -1103,7 +1103,7 @@ discard block |
||
1103 | 1103 | } |
1104 | 1104 | |
1105 | 1105 | if ( ! isset($cache['region'])) { |
1106 | - $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)) . '__' . $fieldName; |
|
1106 | + $cache['region'] = strtolower(str_replace('\\', '_', $this->rootEntityName)).'__'.$fieldName; |
|
1107 | 1107 | } |
1108 | 1108 | |
1109 | 1109 | return $cache; |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | protected function _validateAndCompleteFieldMapping(array &$mapping) |
1384 | 1384 | { |
1385 | 1385 | // Check mandatory fields |
1386 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
1386 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
1387 | 1387 | throw MappingException::missingFieldName($this->name); |
1388 | 1388 | } |
1389 | 1389 | |
@@ -1496,14 +1496,14 @@ discard block |
||
1496 | 1496 | $this->isIdentifierComposite = true; |
1497 | 1497 | } |
1498 | 1498 | |
1499 | - if ($this->cache && !isset($mapping['cache'])) { |
|
1499 | + if ($this->cache && ! isset($mapping['cache'])) { |
|
1500 | 1500 | throw CacheException::nonCacheableEntityAssociation($this->name, $mapping['fieldName']); |
1501 | 1501 | } |
1502 | 1502 | } |
1503 | 1503 | |
1504 | 1504 | // Mandatory attributes for both sides |
1505 | 1505 | // Mandatory: fieldName, targetEntity |
1506 | - if ( ! isset($mapping['fieldName']) || !$mapping['fieldName']) { |
|
1506 | + if ( ! isset($mapping['fieldName']) || ! $mapping['fieldName']) { |
|
1507 | 1507 | throw MappingException::missingFieldName($this->name); |
1508 | 1508 | } |
1509 | 1509 | |
@@ -1625,7 +1625,7 @@ discard block |
||
1625 | 1625 | throw new RuntimeException("ClassMetadataInfo::setTable() has to be called before defining a one to one relationship."); |
1626 | 1626 | } |
1627 | 1627 | |
1628 | - $this->table['uniqueConstraints'][$mapping['fieldName'] . "_uniq"] = [ |
|
1628 | + $this->table['uniqueConstraints'][$mapping['fieldName']."_uniq"] = [ |
|
1629 | 1629 | 'columns' => $uniqueConstraintColumns |
1630 | 1630 | ]; |
1631 | 1631 | } |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | unset($mapping['unique']); |
1641 | 1641 | } |
1642 | 1642 | |
1643 | - if (isset($mapping['id']) && $mapping['id'] === true && !$mapping['isOwningSide']) { |
|
1643 | + if (isset($mapping['id']) && $mapping['id'] === true && ! $mapping['isOwningSide']) { |
|
1644 | 1644 | throw MappingException::illegalInverseIdentifierAssociation($this->name, $mapping['fieldName']); |
1645 | 1645 | } |
1646 | 1646 | |
@@ -1694,7 +1694,7 @@ discard block |
||
1694 | 1694 | } |
1695 | 1695 | |
1696 | 1696 | $selfReferencingEntityWithoutJoinColumns = $mapping['sourceEntity'] == $mapping['targetEntity'] |
1697 | - && (! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
1697 | + && ( ! (isset($mapping['joinTable']['joinColumns']) || isset($mapping['joinTable']['inverseJoinColumns']))); |
|
1698 | 1698 | |
1699 | 1699 | if ( ! isset($mapping['joinTable']['joinColumns'])) { |
1700 | 1700 | $mapping['joinTable']['joinColumns'] = [ |
@@ -1887,7 +1887,7 @@ discard block |
||
1887 | 1887 | |
1888 | 1888 | // Association defined as Id field |
1889 | 1889 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
1890 | - $assocColumnNames = array_map(function ($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
1890 | + $assocColumnNames = array_map(function($joinColumn) { return $joinColumn['name']; }, $joinColumns); |
|
1891 | 1891 | |
1892 | 1892 | $columnNames = array_merge($columnNames, $assocColumnNames); |
1893 | 1893 | } |
@@ -2068,7 +2068,7 @@ discard block |
||
2068 | 2068 | public function getTemporaryIdTableName() |
2069 | 2069 | { |
2070 | 2070 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
2071 | - return str_replace('.', '_', $this->getTableName() . '_id_tmp'); |
|
2071 | + return str_replace('.', '_', $this->getTableName().'_id_tmp'); |
|
2072 | 2072 | } |
2073 | 2073 | |
2074 | 2074 | /** |
@@ -2405,7 +2405,7 @@ discard block |
||
2405 | 2405 | */ |
2406 | 2406 | public function addNamedQuery(array $queryMapping) |
2407 | 2407 | { |
2408 | - if (!isset($queryMapping['name'])) { |
|
2408 | + if ( ! isset($queryMapping['name'])) { |
|
2409 | 2409 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
2410 | 2410 | } |
2411 | 2411 | |
@@ -2413,7 +2413,7 @@ discard block |
||
2413 | 2413 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
2414 | 2414 | } |
2415 | 2415 | |
2416 | - if (!isset($queryMapping['query'])) { |
|
2416 | + if ( ! isset($queryMapping['query'])) { |
|
2417 | 2417 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
2418 | 2418 | } |
2419 | 2419 | |
@@ -2440,7 +2440,7 @@ discard block |
||
2440 | 2440 | */ |
2441 | 2441 | public function addNamedNativeQuery(array $queryMapping) |
2442 | 2442 | { |
2443 | - if (!isset($queryMapping['name'])) { |
|
2443 | + if ( ! isset($queryMapping['name'])) { |
|
2444 | 2444 | throw MappingException::nameIsMandatoryForQueryMapping($this->name); |
2445 | 2445 | } |
2446 | 2446 | |
@@ -2448,11 +2448,11 @@ discard block |
||
2448 | 2448 | throw MappingException::duplicateQueryMapping($this->name, $queryMapping['name']); |
2449 | 2449 | } |
2450 | 2450 | |
2451 | - if (!isset($queryMapping['query'])) { |
|
2451 | + if ( ! isset($queryMapping['query'])) { |
|
2452 | 2452 | throw MappingException::emptyQueryMapping($this->name, $queryMapping['name']); |
2453 | 2453 | } |
2454 | 2454 | |
2455 | - if (!isset($queryMapping['resultClass']) && !isset($queryMapping['resultSetMapping'])) { |
|
2455 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
2456 | 2456 | throw MappingException::missingQueryMapping($this->name, $queryMapping['name']); |
2457 | 2457 | } |
2458 | 2458 | |
@@ -2484,7 +2484,7 @@ discard block |
||
2484 | 2484 | */ |
2485 | 2485 | public function addSqlResultSetMapping(array $resultMapping) |
2486 | 2486 | { |
2487 | - if (!isset($resultMapping['name'])) { |
|
2487 | + if ( ! isset($resultMapping['name'])) { |
|
2488 | 2488 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->name); |
2489 | 2489 | } |
2490 | 2490 | |
@@ -2494,7 +2494,7 @@ discard block |
||
2494 | 2494 | |
2495 | 2495 | if (isset($resultMapping['entities'])) { |
2496 | 2496 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
2497 | - if (!isset($entityResult['entityClass'])) { |
|
2497 | + if ( ! isset($entityResult['entityClass'])) { |
|
2498 | 2498 | throw MappingException::missingResultSetMappingEntity($this->name, $resultMapping['name']); |
2499 | 2499 | } |
2500 | 2500 | |
@@ -2513,11 +2513,11 @@ discard block |
||
2513 | 2513 | |
2514 | 2514 | if (isset($entityResult['fields'])) { |
2515 | 2515 | foreach ($entityResult['fields'] as $k => $field) { |
2516 | - if (!isset($field['name'])) { |
|
2516 | + if ( ! isset($field['name'])) { |
|
2517 | 2517 | throw MappingException::missingResultSetMappingFieldName($this->name, $resultMapping['name']); |
2518 | 2518 | } |
2519 | 2519 | |
2520 | - if (!isset($field['column'])) { |
|
2520 | + if ( ! isset($field['column'])) { |
|
2521 | 2521 | $fieldName = $field['name']; |
2522 | 2522 | if (strpos($fieldName, '.')) { |
2523 | 2523 | list(, $fieldName) = explode('.', $fieldName); |
@@ -3008,7 +3008,7 @@ discard block |
||
3008 | 3008 | } |
3009 | 3009 | |
3010 | 3010 | if ($definition['sequenceName'][0] == '`') { |
3011 | - $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
3011 | + $definition['sequenceName'] = trim($definition['sequenceName'], '`'); |
|
3012 | 3012 | $definition['quoted'] = true; |
3013 | 3013 | } |
3014 | 3014 | |
@@ -3100,7 +3100,7 @@ discard block |
||
3100 | 3100 | public function getAssociationTargetClass($assocName) |
3101 | 3101 | { |
3102 | 3102 | if ( ! isset($this->associationMappings[$assocName])) { |
3103 | - throw new InvalidArgumentException("Association name expected, '" . $assocName ."' is not an association."); |
|
3103 | + throw new InvalidArgumentException("Association name expected, '".$assocName."' is not an association."); |
|
3104 | 3104 | } |
3105 | 3105 | |
3106 | 3106 | return $this->associationMappings[$assocName]['targetEntity']; |
@@ -3139,7 +3139,7 @@ discard block |
||
3139 | 3139 | // Association defined as Id field |
3140 | 3140 | $joinColumns = $this->associationMappings[$idProperty]['joinColumns']; |
3141 | 3141 | $assocQuotedColumnNames = array_map( |
3142 | - function ($joinColumn) use ($platform) { |
|
3142 | + function($joinColumn) use ($platform) { |
|
3143 | 3143 | return isset($joinColumn['quoted']) |
3144 | 3144 | ? $platform->quoteIdentifier($joinColumn['name']) |
3145 | 3145 | : $joinColumn['name']; |
@@ -3250,7 +3250,7 @@ discard block |
||
3250 | 3250 | } |
3251 | 3251 | |
3252 | 3252 | if ($className !== null && strpos($className, '\\') === false && $this->namespace) { |
3253 | - return $this->namespace . '\\' . $className; |
|
3253 | + return $this->namespace.'\\'.$className; |
|
3254 | 3254 | } |
3255 | 3255 | |
3256 | 3256 | return $className; |
@@ -3302,13 +3302,13 @@ discard block |
||
3302 | 3302 | foreach ($embeddable->fieldMappings as $fieldMapping) { |
3303 | 3303 | $fieldMapping['originalClass'] = $fieldMapping['originalClass'] ?? $embeddable->name; |
3304 | 3304 | $fieldMapping['declaredField'] = isset($fieldMapping['declaredField']) |
3305 | - ? $property . '.' . $fieldMapping['declaredField'] |
|
3305 | + ? $property.'.'.$fieldMapping['declaredField'] |
|
3306 | 3306 | : $property; |
3307 | 3307 | $fieldMapping['originalField'] = $fieldMapping['originalField'] ?? $fieldMapping['fieldName']; |
3308 | - $fieldMapping['fieldName'] = $property . "." . $fieldMapping['fieldName']; |
|
3308 | + $fieldMapping['fieldName'] = $property.".".$fieldMapping['fieldName']; |
|
3309 | 3309 | |
3310 | - if (! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3311 | - $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'] . $fieldMapping['columnName']; |
|
3310 | + if ( ! empty($this->embeddedClasses[$property]['columnPrefix'])) { |
|
3311 | + $fieldMapping['columnName'] = $this->embeddedClasses[$property]['columnPrefix'].$fieldMapping['columnName']; |
|
3312 | 3312 | } elseif ($this->embeddedClasses[$property]['columnPrefix'] !== false) { |
3313 | 3313 | $fieldMapping['columnName'] = $this->namingStrategy |
3314 | 3314 | ->embeddedFieldToColumnName( |
@@ -3349,7 +3349,7 @@ discard block |
||
3349 | 3349 | { |
3350 | 3350 | $sequencePrefix = $this->getSequencePrefix($platform); |
3351 | 3351 | $columnName = $this->getSingleIdentifierColumnName(); |
3352 | - $sequenceName = $sequencePrefix . '_' . $columnName . '_seq'; |
|
3352 | + $sequenceName = $sequencePrefix.'_'.$columnName.'_seq'; |
|
3353 | 3353 | |
3354 | 3354 | return $sequenceName; |
3355 | 3355 | } |
@@ -3369,10 +3369,10 @@ discard block |
||
3369 | 3369 | |
3370 | 3370 | // Prepend the schema name to the table name if there is one |
3371 | 3371 | if ($schemaName = $this->getSchemaName()) { |
3372 | - $sequencePrefix = $schemaName . '.' . $tableName; |
|
3372 | + $sequencePrefix = $schemaName.'.'.$tableName; |
|
3373 | 3373 | |
3374 | 3374 | if ( ! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { |
3375 | - $sequencePrefix = $schemaName . '__' . $tableName; |
|
3375 | + $sequencePrefix = $schemaName.'__'.$tableName; |
|
3376 | 3376 | } |
3377 | 3377 | } |
3378 | 3378 | |
@@ -3384,8 +3384,8 @@ discard block |
||
3384 | 3384 | */ |
3385 | 3385 | private function assertMappingOrderBy(array $mapping) |
3386 | 3386 | { |
3387 | - if (isset($mapping['orderBy']) && !is_array($mapping['orderBy'])) { |
|
3388 | - throw new InvalidArgumentException("'orderBy' is expected to be an array, not " . gettype($mapping['orderBy'])); |
|
3387 | + if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) { |
|
3388 | + throw new InvalidArgumentException("'orderBy' is expected to be an array, not ".gettype($mapping['orderBy'])); |
|
3389 | 3389 | } |
3390 | 3390 | } |
3391 | 3391 | } |