@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | /** |
43 | 43 | * A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts. |
44 | 44 | */ |
45 | - const STATE_CLEAN = 1; |
|
45 | + const STATE_CLEAN = 1; |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * A query object is in state DIRTY when it has DQL parts that have not yet been |
@@ -738,11 +738,11 @@ discard block |
||
738 | 738 | ->getName(); |
739 | 739 | |
740 | 740 | return md5( |
741 | - $this->getDQL() . serialize($this->_hints) . |
|
742 | - '&platform=' . $platform . |
|
743 | - ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : '') . |
|
744 | - '&firstResult=' . $this->_firstResult . '&maxResult=' . $this->_maxResults . |
|
745 | - '&hydrationMode=' . $this->_hydrationMode . '&types=' . serialize($this->_parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT' |
|
741 | + $this->getDQL().serialize($this->_hints). |
|
742 | + '&platform='.$platform. |
|
743 | + ($this->_em->hasFilters() ? $this->_em->getFilters()->getHash() : ''). |
|
744 | + '&firstResult='.$this->_firstResult.'&maxResult='.$this->_maxResults. |
|
745 | + '&hydrationMode='.$this->_hydrationMode.'&types='.serialize($this->_parsedTypes).'DOCTRINE_QUERY_CACHE_SALT' |
|
746 | 746 | ); |
747 | 747 | } |
748 | 748 | |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | */ |
752 | 752 | protected function getHash() |
753 | 753 | { |
754 | - return sha1(parent::getHash(). '-'. $this->_firstResult . '-' . $this->_maxResults); |
|
754 | + return sha1(parent::getHash().'-'.$this->_firstResult.'-'.$this->_maxResults); |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | /** |
@@ -22,7 +22,6 @@ |
||
22 | 22 | use Doctrine\Common\Util\ClassUtils; |
23 | 23 | use Doctrine\Common\Collections\Collection; |
24 | 24 | use Doctrine\Common\Collections\ArrayCollection; |
25 | - |
|
26 | 25 | use Doctrine\ORM\Query\Parameter; |
27 | 26 | use Doctrine\ORM\Cache\QueryCacheKey; |
28 | 27 | use Doctrine\DBAL\Cache\QueryCacheProfile; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | * declarations (from ... x join ... y join ... z ...) appear in the query |
414 | 414 | * as the hydration process relies on that order for proper operation. |
415 | 415 | * |
416 | - * @param AST\SelectStatement|AST\DeleteStatement|AST\UpdateStatement $AST |
|
416 | + * @param AST\SelectStatement $AST |
|
417 | 417 | * |
418 | 418 | * @return void |
419 | 419 | */ |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | * accessible is "FROM", prohibiting an easy implementation without larger |
1618 | 1618 | * changes.} |
1619 | 1619 | * |
1620 | - * @return \Doctrine\ORM\Query\AST\SubselectIdentificationVariableDeclaration | |
|
1620 | + * @return AST\IdentificationVariableDeclaration | |
|
1621 | 1621 | * \Doctrine\ORM\Query\AST\IdentificationVariableDeclaration |
1622 | 1622 | */ |
1623 | 1623 | public function SubselectIdentificationVariableDeclaration() |
@@ -1755,7 +1755,7 @@ discard block |
||
1755 | 1755 | /** |
1756 | 1756 | * JoinAssociationDeclaration ::= JoinAssociationPathExpression ["AS"] AliasIdentificationVariable [IndexBy] |
1757 | 1757 | * |
1758 | - * @return \Doctrine\ORM\Query\AST\JoinAssociationPathExpression |
|
1758 | + * @return AST\JoinAssociationDeclaration |
|
1759 | 1759 | */ |
1760 | 1760 | public function JoinAssociationDeclaration() |
1761 | 1761 | { |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | |
209 | 209 | foreach ($data as $columnName => $value) { |
210 | - if (!is_array($id) || !isset($id[$columnName])) { |
|
210 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
211 | 211 | $stmt->bindValue($paramIndex++, $value, $this->columnTypes[$columnName]); |
212 | 212 | } |
213 | 213 | } |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | // If the current class in the root entity, add the filters |
323 | 323 | if ($filterSql = $this->generateFilterConditionSQL($this->em->getClassMetadata($this->class->rootEntityName), $this->getSQLTableAlias($this->class->rootEntityName))) { |
324 | 324 | $conditionSql .= $conditionSql |
325 | - ? ' AND ' . $filterSql |
|
325 | + ? ' AND '.$filterSql |
|
326 | 326 | : $filterSql; |
327 | 327 | } |
328 | 328 | |
@@ -341,29 +341,29 @@ discard block |
||
341 | 341 | switch ($lockMode) { |
342 | 342 | case LockMode::PESSIMISTIC_READ: |
343 | 343 | |
344 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
344 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
345 | 345 | |
346 | 346 | break; |
347 | 347 | |
348 | 348 | case LockMode::PESSIMISTIC_WRITE: |
349 | 349 | |
350 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
350 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
351 | 351 | |
352 | 352 | break; |
353 | 353 | } |
354 | 354 | |
355 | 355 | $tableName = $this->quoteStrategy->getTableName($this->class, $this->platform); |
356 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
357 | - $where = $conditionSql != '' ? ' WHERE ' . $conditionSql : ''; |
|
356 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
357 | + $where = $conditionSql != '' ? ' WHERE '.$conditionSql : ''; |
|
358 | 358 | $lock = $this->platform->appendLockHint($from, $lockMode); |
359 | 359 | $columnList = $this->getSelectColumnsSQL(); |
360 | - $query = 'SELECT ' . $columnList |
|
360 | + $query = 'SELECT '.$columnList |
|
361 | 361 | . $lock |
362 | 362 | . $joinSql |
363 | 363 | . $where |
364 | 364 | . $orderBySql; |
365 | 365 | |
366 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
366 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | /** |
@@ -383,14 +383,14 @@ discard block |
||
383 | 383 | |
384 | 384 | if ('' !== $filterSql) { |
385 | 385 | $conditionSql = $conditionSql |
386 | - ? $conditionSql . ' AND ' . $filterSql |
|
386 | + ? $conditionSql.' AND '.$filterSql |
|
387 | 387 | : $filterSql; |
388 | 388 | } |
389 | 389 | |
390 | 390 | $sql = 'SELECT COUNT(*) ' |
391 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
391 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
392 | 392 | . $joinSql |
393 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
393 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
394 | 394 | |
395 | 395 | return $sql; |
396 | 396 | } |
@@ -409,16 +409,16 @@ discard block |
||
409 | 409 | $conditions = []; |
410 | 410 | $tableAlias = $this->getSQLTableAlias($parentClassName); |
411 | 411 | $parentClass = $this->em->getClassMetadata($parentClassName); |
412 | - $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
412 | + $joinSql .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
413 | 413 | |
414 | 414 | foreach ($identifierColumns as $idColumn) { |
415 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
415 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
416 | 416 | } |
417 | 417 | |
418 | 418 | $joinSql .= implode(' AND ', $conditions); |
419 | 419 | } |
420 | 420 | |
421 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
421 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | /** |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | ? $baseTableAlias |
480 | 480 | : $this->getSQLTableAlias($this->class->rootEntityName); |
481 | 481 | |
482 | - $columnList[] = $tableAlias . '.' . $discrColumn; |
|
482 | + $columnList[] = $tableAlias.'.'.$discrColumn; |
|
483 | 483 | |
484 | 484 | // sub tables |
485 | 485 | foreach ($this->class->subClasses as $subClassName) { |
@@ -586,11 +586,11 @@ discard block |
||
586 | 586 | $conditions = []; |
587 | 587 | $parentClass = $this->em->getClassMetadata($parentClassName); |
588 | 588 | $tableAlias = $this->getSQLTableAlias($parentClassName); |
589 | - $joinSql .= ' INNER JOIN ' . $this->quoteStrategy->getTableName($parentClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
589 | + $joinSql .= ' INNER JOIN '.$this->quoteStrategy->getTableName($parentClass, $this->platform).' '.$tableAlias.' ON '; |
|
590 | 590 | |
591 | 591 | |
592 | 592 | foreach ($identifierColumn as $idColumn) { |
593 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
593 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | $joinSql .= implode(' AND ', $conditions); |
@@ -601,10 +601,10 @@ discard block |
||
601 | 601 | $conditions = []; |
602 | 602 | $subClass = $this->em->getClassMetadata($subClassName); |
603 | 603 | $tableAlias = $this->getSQLTableAlias($subClassName); |
604 | - $joinSql .= ' LEFT JOIN ' . $this->quoteStrategy->getTableName($subClass, $this->platform) . ' ' . $tableAlias . ' ON '; |
|
604 | + $joinSql .= ' LEFT JOIN '.$this->quoteStrategy->getTableName($subClass, $this->platform).' '.$tableAlias.' ON '; |
|
605 | 605 | |
606 | 606 | foreach ($identifierColumn as $idColumn) { |
607 | - $conditions[] = $baseTableAlias . '.' . $idColumn . ' = ' . $tableAlias . '.' . $idColumn; |
|
607 | + $conditions[] = $baseTableAlias.'.'.$idColumn.' = '.$tableAlias.'.'.$idColumn; |
|
608 | 608 | } |
609 | 609 | |
610 | 610 | $joinSql .= implode(' AND ', $conditions); |
@@ -340,9 +340,9 @@ discard block |
||
340 | 340 | $columnName = $this->quoteStrategy->getColumnName($versionField, $versionedClass, $this->platform); |
341 | 341 | |
342 | 342 | // FIXME: Order with composite keys might not be correct |
343 | - $sql = 'SELECT ' . $columnName |
|
344 | - . ' FROM ' . $tableName |
|
345 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
343 | + $sql = 'SELECT '.$columnName |
|
344 | + . ' FROM '.$tableName |
|
345 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
346 | 346 | |
347 | 347 | $flatId = $this->identifierFlattener->flattenIdentifier($versionedClass, $id); |
348 | 348 | |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | } |
419 | 419 | |
420 | 420 | $params[] = $value; |
421 | - $set[] = $column . ' = ' . $placeholder; |
|
421 | + $set[] = $column.' = '.$placeholder; |
|
422 | 422 | $types[] = $this->columnTypes[$columnName]; |
423 | 423 | } |
424 | 424 | |
@@ -466,18 +466,18 @@ discard block |
||
466 | 466 | case Type::SMALLINT: |
467 | 467 | case Type::INTEGER: |
468 | 468 | case Type::BIGINT: |
469 | - $set[] = $versionColumn . ' = ' . $versionColumn . ' + 1'; |
|
469 | + $set[] = $versionColumn.' = '.$versionColumn.' + 1'; |
|
470 | 470 | break; |
471 | 471 | |
472 | 472 | case Type::DATETIME: |
473 | - $set[] = $versionColumn . ' = CURRENT_TIMESTAMP'; |
|
473 | + $set[] = $versionColumn.' = CURRENT_TIMESTAMP'; |
|
474 | 474 | break; |
475 | 475 | } |
476 | 476 | } |
477 | 477 | |
478 | - $sql = 'UPDATE ' . $quotedTableName |
|
479 | - . ' SET ' . implode(', ', $set) |
|
480 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
478 | + $sql = 'UPDATE '.$quotedTableName |
|
479 | + . ' SET '.implode(', ', $set) |
|
480 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
481 | 481 | |
482 | 482 | $result = $this->conn->executeUpdate($sql, $params, $types); |
483 | 483 | |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | |
521 | 521 | |
522 | 522 | if ($selfReferential) { |
523 | - $otherColumns = (! $mapping['isOwningSide']) |
|
523 | + $otherColumns = ( ! $mapping['isOwningSide']) |
|
524 | 524 | ? $association['joinTable']['joinColumns'] |
525 | 525 | : $association['joinTable']['inverseJoinColumns']; |
526 | 526 | } |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | $tableName = $this->quoteStrategy->getTableName($class, $this->platform); |
559 | 559 | $idColumns = $this->quoteStrategy->getIdentifierColumnNames($class, $this->platform); |
560 | 560 | $id = array_combine($idColumns, $identifier); |
561 | - $types = array_map(function ($identifier) use ($class, $self) { |
|
561 | + $types = array_map(function($identifier) use ($class, $self) { |
|
562 | 562 | if (isset($class->fieldMappings[$identifier])) { |
563 | 563 | return $class->fieldMappings[$identifier]['type']; |
564 | 564 | } |
@@ -1021,7 +1021,7 @@ discard block |
||
1021 | 1021 | ); |
1022 | 1022 | } |
1023 | 1023 | |
1024 | - $criteria[$quotedJoinTable . '.' . $quotedKeyColumn] = $value; |
|
1024 | + $criteria[$quotedJoinTable.'.'.$quotedKeyColumn] = $value; |
|
1025 | 1025 | $parameters[] = [ |
1026 | 1026 | 'value' => $value, |
1027 | 1027 | 'field' => $field, |
@@ -1064,11 +1064,11 @@ discard block |
||
1064 | 1064 | |
1065 | 1065 | switch ($lockMode) { |
1066 | 1066 | case LockMode::PESSIMISTIC_READ: |
1067 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1067 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1068 | 1068 | break; |
1069 | 1069 | |
1070 | 1070 | case LockMode::PESSIMISTIC_WRITE: |
1071 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1071 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1072 | 1072 | break; |
1073 | 1073 | } |
1074 | 1074 | |
@@ -1079,14 +1079,14 @@ discard block |
||
1079 | 1079 | |
1080 | 1080 | if ('' !== $filterSql) { |
1081 | 1081 | $conditionSql = $conditionSql |
1082 | - ? $conditionSql . ' AND ' . $filterSql |
|
1082 | + ? $conditionSql.' AND '.$filterSql |
|
1083 | 1083 | : $filterSql; |
1084 | 1084 | } |
1085 | 1085 | |
1086 | - $select = 'SELECT ' . $columnList; |
|
1087 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1088 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1089 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1086 | + $select = 'SELECT '.$columnList; |
|
1087 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1088 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1089 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1090 | 1090 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1091 | 1091 | $query = $select |
1092 | 1092 | . $lock |
@@ -1094,7 +1094,7 @@ discard block |
||
1094 | 1094 | . $where |
1095 | 1095 | . $orderBySql; |
1096 | 1096 | |
1097 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1097 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | /** |
@@ -1113,13 +1113,13 @@ discard block |
||
1113 | 1113 | |
1114 | 1114 | if ('' !== $filterSql) { |
1115 | 1115 | $conditionSql = $conditionSql |
1116 | - ? $conditionSql . ' AND ' . $filterSql |
|
1116 | + ? $conditionSql.' AND '.$filterSql |
|
1117 | 1117 | : $filterSql; |
1118 | 1118 | } |
1119 | 1119 | |
1120 | 1120 | $sql = 'SELECT COUNT(*) ' |
1121 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1122 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1121 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1122 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1123 | 1123 | |
1124 | 1124 | return $sql; |
1125 | 1125 | } |
@@ -1152,7 +1152,7 @@ discard block |
||
1152 | 1152 | : $baseTableAlias; |
1153 | 1153 | |
1154 | 1154 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $this->class, $this->platform); |
1155 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1155 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1156 | 1156 | |
1157 | 1157 | continue; |
1158 | 1158 | } |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | |
1170 | 1170 | foreach ($this->class->associationMappings[$fieldName]['joinColumns'] as $joinColumn) { |
1171 | 1171 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1172 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1172 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1173 | 1173 | } |
1174 | 1174 | |
1175 | 1175 | continue; |
@@ -1178,7 +1178,7 @@ discard block |
||
1178 | 1178 | throw ORMException::unrecognizedField($fieldName); |
1179 | 1179 | } |
1180 | 1180 | |
1181 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1181 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | /** |
@@ -1206,8 +1206,8 @@ discard block |
||
1206 | 1206 | $columnList[] = $this->getSelectColumnSQL($field, $this->class); |
1207 | 1207 | } |
1208 | 1208 | |
1209 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1210 | - $eagerAliasCounter = 0; |
|
1209 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1210 | + $eagerAliasCounter = 0; |
|
1211 | 1211 | |
1212 | 1212 | foreach ($this->class->associationMappings as $assocField => $assoc) { |
1213 | 1213 | $assocColumnSQL = $this->getSelectColumnAssociationSQL($assocField, $assoc, $this->class); |
@@ -1233,7 +1233,7 @@ discard block |
||
1233 | 1233 | continue; // now this is why you shouldn't use inheritance |
1234 | 1234 | } |
1235 | 1235 | |
1236 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1236 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1237 | 1237 | $this->currentPersisterContext->rsm->addJoinedEntityResult($assoc['targetEntity'], $assocAlias, 'r', $assocField); |
1238 | 1238 | |
1239 | 1239 | foreach ($eagerEntity->fieldNames as $field) { |
@@ -1266,14 +1266,14 @@ discard block |
||
1266 | 1266 | $joinTableName = $this->quoteStrategy->getTableName($eagerEntity, $this->platform); |
1267 | 1267 | |
1268 | 1268 | if ($assoc['isOwningSide']) { |
1269 | - $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1270 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1269 | + $tableAlias = $this->getSQLTableAlias($association['targetEntity'], $assocAlias); |
|
1270 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForJoinColumns($association['joinColumns']); |
|
1271 | 1271 | |
1272 | 1272 | foreach ($association['joinColumns'] as $joinColumn) { |
1273 | 1273 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1274 | 1274 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1275 | 1275 | $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity']) |
1276 | - . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol; |
|
1276 | + . '.'.$sourceCol.' = '.$tableAlias.'.'.$targetCol; |
|
1277 | 1277 | } |
1278 | 1278 | |
1279 | 1279 | // Add filter SQL |
@@ -1289,12 +1289,12 @@ discard block |
||
1289 | 1289 | $sourceCol = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1290 | 1290 | $targetCol = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1291 | 1291 | |
1292 | - $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias) . '.' . $sourceCol . ' = ' |
|
1293 | - . $this->getSQLTableAlias($association['targetEntity']) . '.' . $targetCol; |
|
1292 | + $joinCondition[] = $this->getSQLTableAlias($association['sourceEntity'], $assocAlias).'.'.$sourceCol.' = ' |
|
1293 | + . $this->getSQLTableAlias($association['targetEntity']).'.'.$targetCol; |
|
1294 | 1294 | } |
1295 | 1295 | } |
1296 | 1296 | |
1297 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1297 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1298 | 1298 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1299 | 1299 | } |
1300 | 1300 | |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | */ |
1316 | 1316 | protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $class, $alias = 'r') |
1317 | 1317 | { |
1318 | - if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) ) { |
|
1318 | + if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
|
1319 | 1319 | return ''; |
1320 | 1320 | } |
1321 | 1321 | |
@@ -1364,10 +1364,10 @@ discard block |
||
1364 | 1364 | foreach ($joinColumns as $joinColumn) { |
1365 | 1365 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
1366 | 1366 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $this->class, $this->platform); |
1367 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableName . '.' . $quotedSourceColumn; |
|
1367 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableName.'.'.$quotedSourceColumn; |
|
1368 | 1368 | } |
1369 | 1369 | |
1370 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1370 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1371 | 1371 | } |
1372 | 1372 | |
1373 | 1373 | /** |
@@ -1446,7 +1446,7 @@ discard block |
||
1446 | 1446 | continue; |
1447 | 1447 | } |
1448 | 1448 | |
1449 | - if (! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1449 | + if ( ! $this->class->isIdGeneratorIdentity() || $this->class->identifier[0] != $name) { |
|
1450 | 1450 | $columns[] = $this->quoteStrategy->getColumnName($name, $this->class, $this->platform); |
1451 | 1451 | $this->columnTypes[$name] = $this->class->fieldMappings[$name]['type']; |
1452 | 1452 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
1467 | 1467 | */ |
1468 | 1468 | protected function getSelectColumnSQL($field, ClassMetadata $class, $alias = 'r') |
1469 | 1469 | { |
1470 | - $root = $alias == 'r' ? '' : $alias ; |
|
1470 | + $root = $alias == 'r' ? '' : $alias; |
|
1471 | 1471 | $tableAlias = $this->getSQLTableAlias($class->name, $root); |
1472 | 1472 | $fieldMapping = $class->fieldMappings[$field]; |
1473 | 1473 | $sql = sprintf('%s.%s', $tableAlias, $this->quoteStrategy->getColumnName($field, $class, $this->platform)); |
@@ -1480,7 +1480,7 @@ discard block |
||
1480 | 1480 | $sql = $type->convertToPHPValueSQL($sql, $this->platform); |
1481 | 1481 | } |
1482 | 1482 | |
1483 | - return $sql . ' AS ' . $columnAlias; |
|
1483 | + return $sql.' AS '.$columnAlias; |
|
1484 | 1484 | } |
1485 | 1485 | |
1486 | 1486 | /** |
@@ -1496,14 +1496,14 @@ discard block |
||
1496 | 1496 | protected function getSQLTableAlias($className, $assocName = '') |
1497 | 1497 | { |
1498 | 1498 | if ($assocName) { |
1499 | - $className .= '#' . $assocName; |
|
1499 | + $className .= '#'.$assocName; |
|
1500 | 1500 | } |
1501 | 1501 | |
1502 | 1502 | if (isset($this->currentPersisterContext->sqlTableAliases[$className])) { |
1503 | 1503 | return $this->currentPersisterContext->sqlTableAliases[$className]; |
1504 | 1504 | } |
1505 | 1505 | |
1506 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1506 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1507 | 1507 | |
1508 | 1508 | $this->currentPersisterContext->sqlTableAliases[$className] = $tableAlias; |
1509 | 1509 | |
@@ -1530,7 +1530,7 @@ discard block |
||
1530 | 1530 | } |
1531 | 1531 | |
1532 | 1532 | $lock = $this->getLockTablesSql($lockMode); |
1533 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1533 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1534 | 1534 | $sql = 'SELECT 1 ' |
1535 | 1535 | . $lock |
1536 | 1536 | . $where |
@@ -1552,7 +1552,7 @@ discard block |
||
1552 | 1552 | { |
1553 | 1553 | return $this->platform->appendLockHint( |
1554 | 1554 | 'FROM ' |
1555 | - . $this->quoteStrategy->getTableName($this->class, $this->platform) . ' ' |
|
1555 | + . $this->quoteStrategy->getTableName($this->class, $this->platform).' ' |
|
1556 | 1556 | . $this->getSQLTableAlias($this->class->name), |
1557 | 1557 | $lockMode |
1558 | 1558 | ); |
@@ -1604,19 +1604,19 @@ discard block |
||
1604 | 1604 | |
1605 | 1605 | if (null !== $comparison) { |
1606 | 1606 | // special case null value handling |
1607 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1608 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1607 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1608 | + $selectedColumns[] = $column.' IS NULL'; |
|
1609 | 1609 | |
1610 | 1610 | continue; |
1611 | 1611 | } |
1612 | 1612 | |
1613 | 1613 | if ($comparison === Comparison::NEQ && null === $value) { |
1614 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1614 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1615 | 1615 | |
1616 | 1616 | continue; |
1617 | 1617 | } |
1618 | 1618 | |
1619 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1619 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1620 | 1620 | |
1621 | 1621 | continue; |
1622 | 1622 | } |
@@ -1664,7 +1664,7 @@ discard block |
||
1664 | 1664 | ? $this->class->fieldMappings[$field]['inherited'] |
1665 | 1665 | : $this->class->name; |
1666 | 1666 | |
1667 | - return [$this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1667 | + return [$this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getColumnName($field, $this->class, $this->platform)]; |
|
1668 | 1668 | } |
1669 | 1669 | |
1670 | 1670 | if (isset($this->class->associationMappings[$field])) { |
@@ -1685,7 +1685,7 @@ discard block |
||
1685 | 1685 | |
1686 | 1686 | |
1687 | 1687 | foreach ($joinColumns as $joinColumn) { |
1688 | - $columns[] = $joinTableName . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1688 | + $columns[] = $joinTableName.'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
|
1689 | 1689 | } |
1690 | 1690 | |
1691 | 1691 | } else { |
@@ -1693,12 +1693,12 @@ discard block |
||
1693 | 1693 | throw ORMException::invalidFindByInverseAssociation($this->class->name, $field); |
1694 | 1694 | } |
1695 | 1695 | |
1696 | - $className = (isset($association['inherited'])) |
|
1696 | + $className = (isset($association['inherited'])) |
|
1697 | 1697 | ? $association['inherited'] |
1698 | 1698 | : $this->class->name; |
1699 | 1699 | |
1700 | 1700 | foreach ($association['joinColumns'] as $joinColumn) { |
1701 | - $columns[] = $this->getSQLTableAlias($className) . '.' . $this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1701 | + $columns[] = $this->getSQLTableAlias($className).'.'.$this->quoteStrategy->getJoinColumnName($joinColumn, $this->class, $this->platform); |
|
1702 | 1702 | } |
1703 | 1703 | } |
1704 | 1704 | return $columns; |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | $value = $value[$this->em->getClassMetadata($sourceClass->associationMappings[$field]['targetEntity'])->identifier[0]]; |
1791 | 1791 | } |
1792 | 1792 | |
1793 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1793 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1794 | 1794 | $parameters[] = [ |
1795 | 1795 | 'value' => $value, |
1796 | 1796 | 'field' => $field, |
@@ -1803,7 +1803,7 @@ discard block |
||
1803 | 1803 | $field = $sourceClass->fieldNames[$sourceKeyColumn]; |
1804 | 1804 | $value = $sourceClass->reflFields[$field]->getValue($sourceEntity); |
1805 | 1805 | |
1806 | - $criteria[$tableAlias . "." . $targetKeyColumn] = $value; |
|
1806 | + $criteria[$tableAlias.".".$targetKeyColumn] = $value; |
|
1807 | 1807 | $parameters[] = [ |
1808 | 1808 | 'value' => $value, |
1809 | 1809 | 'field' => $field, |
@@ -1891,7 +1891,7 @@ discard block |
||
1891 | 1891 | $assoc = $class->associationMappings[$field]; |
1892 | 1892 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1893 | 1893 | |
1894 | - if (! $assoc['isOwningSide']) { |
|
1894 | + if ( ! $assoc['isOwningSide']) { |
|
1895 | 1895 | $assoc = $class->associationMappings[$assoc['mappedBy']]; |
1896 | 1896 | $class = $this->em->getClassMetadata($assoc['targetEntity']); |
1897 | 1897 | } |
@@ -1900,7 +1900,7 @@ discard block |
||
1900 | 1900 | ? $assoc['relationToTargetKeyColumns'] |
1901 | 1901 | : $assoc['sourceToTargetKeyColumns']; |
1902 | 1902 | |
1903 | - foreach ($columns as $column){ |
|
1903 | + foreach ($columns as $column) { |
|
1904 | 1904 | $types[] = PersisterHelper::getTypeOfColumn($column, $class, $this->em); |
1905 | 1905 | } |
1906 | 1906 | break; |
@@ -1911,7 +1911,7 @@ discard block |
||
1911 | 1911 | } |
1912 | 1912 | |
1913 | 1913 | if (is_array($value)) { |
1914 | - return array_map(function ($type) { |
|
1914 | + return array_map(function($type) { |
|
1915 | 1915 | $type = Type::getType($type); |
1916 | 1916 | |
1917 | 1917 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
@@ -1987,12 +1987,12 @@ discard block |
||
1987 | 1987 | |
1988 | 1988 | $sql = 'SELECT 1 ' |
1989 | 1989 | . $this->getLockTablesSql(null) |
1990 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
1990 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
1991 | 1991 | |
1992 | 1992 | list($params, $types) = $this->expandParameters($criteria); |
1993 | 1993 | |
1994 | 1994 | if (null !== $extraConditions) { |
1995 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
1995 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
1996 | 1996 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
1997 | 1997 | |
1998 | 1998 | $params = array_merge($params, $criteriaParams); |
@@ -2000,7 +2000,7 @@ discard block |
||
2000 | 2000 | } |
2001 | 2001 | |
2002 | 2002 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2003 | - $sql .= ' AND ' . $filterSql; |
|
2003 | + $sql .= ' AND '.$filterSql; |
|
2004 | 2004 | } |
2005 | 2005 | |
2006 | 2006 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2047,13 +2047,13 @@ discard block |
||
2047 | 2047 | |
2048 | 2048 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2049 | 2049 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2050 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2050 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2051 | 2051 | } |
2052 | 2052 | } |
2053 | 2053 | |
2054 | 2054 | $sql = implode(' AND ', $filterClauses); |
2055 | 2055 | |
2056 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2056 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2057 | 2057 | } |
2058 | 2058 | |
2059 | 2059 | /** |
@@ -89,66 +89,66 @@ discard block |
||
89 | 89 | $cmf = $this->em->getMetadataFactory(); |
90 | 90 | |
91 | 91 | foreach ($class->fieldMappings as $fieldName => $mapping) { |
92 | - if (!Type::hasType($mapping['type'])) { |
|
93 | - $ce[] = "The field '" . $class->name . "#" . $fieldName."' uses a non-existent type '" . $mapping['type'] . "'."; |
|
92 | + if ( ! Type::hasType($mapping['type'])) { |
|
93 | + $ce[] = "The field '".$class->name."#".$fieldName."' uses a non-existent type '".$mapping['type']."'."; |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
97 | 97 | foreach ($class->associationMappings as $fieldName => $assoc) { |
98 | - if (!class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { |
|
99 | - $ce[] = "The target entity '" . $assoc['targetEntity'] . "' specified on " . $class->name . '#' . $fieldName . ' is unknown or not an entity.'; |
|
98 | + if ( ! class_exists($assoc['targetEntity']) || $cmf->isTransient($assoc['targetEntity'])) { |
|
99 | + $ce[] = "The target entity '".$assoc['targetEntity']."' specified on ".$class->name.'#'.$fieldName.' is unknown or not an entity.'; |
|
100 | 100 | |
101 | 101 | return $ce; |
102 | 102 | } |
103 | 103 | |
104 | 104 | if ($assoc['mappedBy'] && $assoc['inversedBy']) { |
105 | - $ce[] = "The association " . $class . "#" . $fieldName . " cannot be defined as both inverse and owning."; |
|
105 | + $ce[] = "The association ".$class."#".$fieldName." cannot be defined as both inverse and owning."; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | $targetMetadata = $cmf->getMetadataFor($assoc['targetEntity']); |
109 | 109 | |
110 | 110 | if (isset($assoc['id']) && $targetMetadata->containsForeignIdentifier) { |
111 | - $ce[] = "Cannot map association '" . $class->name. "#". $fieldName ." as identifier, because " . |
|
112 | - "the target entity '". $targetMetadata->name . "' also maps an association as identifier."; |
|
111 | + $ce[] = "Cannot map association '".$class->name."#".$fieldName." as identifier, because ". |
|
112 | + "the target entity '".$targetMetadata->name."' also maps an association as identifier."; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if ($assoc['mappedBy']) { |
116 | 116 | if ($targetMetadata->hasField($assoc['mappedBy'])) { |
117 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
|
118 | - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which is not defined as association, but as field."; |
|
117 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the owning side ". |
|
118 | + "field ".$assoc['targetEntity']."#".$assoc['mappedBy']." which is not defined as association, but as field."; |
|
119 | 119 | } |
120 | - if (!$targetMetadata->hasAssociation($assoc['mappedBy'])) { |
|
121 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the owning side ". |
|
122 | - "field " . $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " which does not exist."; |
|
120 | + if ( ! $targetMetadata->hasAssociation($assoc['mappedBy'])) { |
|
121 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the owning side ". |
|
122 | + "field ".$assoc['targetEntity']."#".$assoc['mappedBy']." which does not exist."; |
|
123 | 123 | } elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] == null) { |
124 | - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the inverse side of a ". |
|
124 | + $ce[] = "The field ".$class->name."#".$fieldName." is on the inverse side of a ". |
|
125 | 125 | "bi-directional relationship, but the specified mappedBy association on the target-entity ". |
126 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
|
127 | - "'inversedBy=\"" . $fieldName . "\"' attribute."; |
|
126 | + $assoc['targetEntity']."#".$assoc['mappedBy']." does not contain the required ". |
|
127 | + "'inversedBy=\"".$fieldName."\"' attribute."; |
|
128 | 128 | } elseif ($targetMetadata->associationMappings[$assoc['mappedBy']]['inversedBy'] != $fieldName) { |
129 | - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
|
130 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " are ". |
|
129 | + $ce[] = "The mappings ".$class->name."#".$fieldName." and ". |
|
130 | + $assoc['targetEntity']."#".$assoc['mappedBy']." are ". |
|
131 | 131 | "inconsistent with each other."; |
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
135 | 135 | if ($assoc['inversedBy']) { |
136 | 136 | if ($targetMetadata->hasField($assoc['inversedBy'])) { |
137 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
|
138 | - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which is not defined as association."; |
|
137 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the inverse side ". |
|
138 | + "field ".$assoc['targetEntity']."#".$assoc['inversedBy']." which is not defined as association."; |
|
139 | 139 | } |
140 | 140 | |
141 | - if (!$targetMetadata->hasAssociation($assoc['inversedBy'])) { |
|
142 | - $ce[] = "The association " . $class->name . "#" . $fieldName . " refers to the inverse side ". |
|
143 | - "field " . $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " which does not exist."; |
|
141 | + if ( ! $targetMetadata->hasAssociation($assoc['inversedBy'])) { |
|
142 | + $ce[] = "The association ".$class->name."#".$fieldName." refers to the inverse side ". |
|
143 | + "field ".$assoc['targetEntity']."#".$assoc['inversedBy']." which does not exist."; |
|
144 | 144 | } elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] == null) { |
145 | - $ce[] = "The field " . $class->name . "#" . $fieldName . " is on the owning side of a ". |
|
145 | + $ce[] = "The field ".$class->name."#".$fieldName." is on the owning side of a ". |
|
146 | 146 | "bi-directional relationship, but the specified mappedBy association on the target-entity ". |
147 | - $assoc['targetEntity'] . "#" . $assoc['mappedBy'] . " does not contain the required ". |
|
147 | + $assoc['targetEntity']."#".$assoc['mappedBy']." does not contain the required ". |
|
148 | 148 | "'inversedBy' attribute."; |
149 | 149 | } elseif ($targetMetadata->associationMappings[$assoc['inversedBy']]['mappedBy'] != $fieldName) { |
150 | - $ce[] = "The mappings " . $class->name . "#" . $fieldName . " and " . |
|
151 | - $assoc['targetEntity'] . "#" . $assoc['inversedBy'] . " are ". |
|
150 | + $ce[] = "The mappings ".$class->name."#".$fieldName." and ". |
|
151 | + $assoc['targetEntity']."#".$assoc['inversedBy']." are ". |
|
152 | 152 | "inconsistent with each other."; |
153 | 153 | } |
154 | 154 | |
@@ -156,14 +156,14 @@ discard block |
||
156 | 156 | if (array_key_exists($assoc['inversedBy'], $targetMetadata->associationMappings)) { |
157 | 157 | $targetAssoc = $targetMetadata->associationMappings[$assoc['inversedBy']]; |
158 | 158 | if ($assoc['type'] == ClassMetadataInfo::ONE_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_ONE) { |
159 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is one-to-one, then the inversed " . |
|
160 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-one as well."; |
|
159 | + $ce[] = "If association ".$class->name."#".$fieldName." is one-to-one, then the inversed ". |
|
160 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be one-to-one as well."; |
|
161 | 161 | } elseif ($assoc['type'] == ClassMetadataInfo::MANY_TO_ONE && $targetAssoc['type'] !== ClassMetadataInfo::ONE_TO_MANY) { |
162 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-one, then the inversed " . |
|
163 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be one-to-many."; |
|
162 | + $ce[] = "If association ".$class->name."#".$fieldName." is many-to-one, then the inversed ". |
|
163 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be one-to-many."; |
|
164 | 164 | } elseif ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY && $targetAssoc['type'] !== ClassMetadataInfo::MANY_TO_MANY) { |
165 | - $ce[] = "If association " . $class->name . "#" . $fieldName . " is many-to-many, then the inversed " . |
|
166 | - "side " . $targetMetadata->name . "#" . $assoc['inversedBy'] . " has to be many-to-many as well."; |
|
165 | + $ce[] = "If association ".$class->name."#".$fieldName." is many-to-many, then the inversed ". |
|
166 | + "side ".$targetMetadata->name."#".$assoc['inversedBy']." has to be many-to-many as well."; |
|
167 | 167 | } |
168 | 168 | } |
169 | 169 | } |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | if ($assoc['type'] == ClassMetadataInfo::MANY_TO_MANY) { |
173 | 173 | $identifierColumns = $class->getIdentifierColumnNames(); |
174 | 174 | foreach ($assoc['joinTable']['joinColumns'] as $joinColumn) { |
175 | - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
176 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
175 | + if ( ! in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
176 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
177 | 177 | "has to be a primary key column on the target entity class '".$class->name."'."; |
178 | 178 | break; |
179 | 179 | } |
@@ -181,32 +181,32 @@ discard block |
||
181 | 181 | |
182 | 182 | $identifierColumns = $targetMetadata->getIdentifierColumnNames(); |
183 | 183 | foreach ($assoc['joinTable']['inverseJoinColumns'] as $inverseJoinColumn) { |
184 | - if (!in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { |
|
185 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
184 | + if ( ! in_array($inverseJoinColumn['referencedColumnName'], $identifierColumns)) { |
|
185 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
186 | 186 | "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; |
187 | 187 | break; |
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | 191 | if (count($targetMetadata->getIdentifierColumnNames()) != count($assoc['joinTable']['inverseJoinColumns'])) { |
192 | - $ce[] = "The inverse join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . |
|
193 | - "have to contain to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . |
|
194 | - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))) . |
|
192 | + $ce[] = "The inverse join columns of the many-to-many table '".$assoc['joinTable']['name']."' ". |
|
193 | + "have to contain to ALL identifier columns of the target entity '".$targetMetadata->name."', ". |
|
194 | + "however '".implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), array_values($assoc['relationToTargetKeyColumns']))). |
|
195 | 195 | "' are missing."; |
196 | 196 | } |
197 | 197 | |
198 | 198 | if (count($class->getIdentifierColumnNames()) != count($assoc['joinTable']['joinColumns'])) { |
199 | - $ce[] = "The join columns of the many-to-many table '" . $assoc['joinTable']['name'] . "' " . |
|
200 | - "have to contain to ALL identifier columns of the source entity '". $class->name . "', " . |
|
201 | - "however '" . implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))) . |
|
199 | + $ce[] = "The join columns of the many-to-many table '".$assoc['joinTable']['name']."' ". |
|
200 | + "have to contain to ALL identifier columns of the source entity '".$class->name."', ". |
|
201 | + "however '".implode(", ", array_diff($class->getIdentifierColumnNames(), array_values($assoc['relationToSourceKeyColumns']))). |
|
202 | 202 | "' are missing."; |
203 | 203 | } |
204 | 204 | |
205 | 205 | } elseif ($assoc['type'] & ClassMetadataInfo::TO_ONE) { |
206 | 206 | $identifierColumns = $targetMetadata->getIdentifierColumnNames(); |
207 | 207 | foreach ($assoc['joinColumns'] as $joinColumn) { |
208 | - if (!in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
209 | - $ce[] = "The referenced column name '" . $joinColumn['referencedColumnName'] . "' " . |
|
208 | + if ( ! in_array($joinColumn['referencedColumnName'], $identifierColumns)) { |
|
209 | + $ce[] = "The referenced column name '".$joinColumn['referencedColumnName']."' ". |
|
210 | 210 | "has to be a primary key column on the target entity class '".$targetMetadata->name."'."; |
211 | 211 | } |
212 | 212 | } |
@@ -218,9 +218,9 @@ discard block |
||
218 | 218 | $ids[] = $joinColumn['name']; |
219 | 219 | } |
220 | 220 | |
221 | - $ce[] = "The join columns of the association '" . $assoc['fieldName'] . "' " . |
|
222 | - "have to match to ALL identifier columns of the target entity '". $targetMetadata->name . "', " . |
|
223 | - "however '" . implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)) . |
|
221 | + $ce[] = "The join columns of the association '".$assoc['fieldName']."' ". |
|
222 | + "have to match to ALL identifier columns of the target entity '".$targetMetadata->name."', ". |
|
223 | + "however '".implode(", ", array_diff($targetMetadata->getIdentifierColumnNames(), $ids)). |
|
224 | 224 | "' are missing."; |
225 | 225 | } |
226 | 226 | } |
@@ -228,19 +228,19 @@ discard block |
||
228 | 228 | |
229 | 229 | if (isset($assoc['orderBy']) && $assoc['orderBy'] !== null) { |
230 | 230 | foreach ($assoc['orderBy'] as $orderField => $orientation) { |
231 | - if (!$targetMetadata->hasField($orderField) && !$targetMetadata->hasAssociation($orderField)) { |
|
232 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a foreign field " . |
|
233 | - $orderField . " that is not a field on the target entity " . $targetMetadata->name . "."; |
|
231 | + if ( ! $targetMetadata->hasField($orderField) && ! $targetMetadata->hasAssociation($orderField)) { |
|
232 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a foreign field ". |
|
233 | + $orderField." that is not a field on the target entity ".$targetMetadata->name."."; |
|
234 | 234 | continue; |
235 | 235 | } |
236 | 236 | if ($targetMetadata->isCollectionValuedAssociation($orderField)) { |
237 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a field " . |
|
238 | - $orderField . " on " . $targetMetadata->name . " that is a collection-valued association."; |
|
237 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a field ". |
|
238 | + $orderField." on ".$targetMetadata->name." that is a collection-valued association."; |
|
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | if ($targetMetadata->isAssociationInverseSide($orderField)) { |
242 | - $ce[] = "The association " . $class->name."#".$fieldName." is ordered by a field " . |
|
243 | - $orderField . " on " . $targetMetadata->name . " that is the inverse side of an association."; |
|
242 | + $ce[] = "The association ".$class->name."#".$fieldName." is ordered by a field ". |
|
243 | + $orderField." on ".$targetMetadata->name." that is the inverse side of an association."; |
|
244 | 244 | continue; |
245 | 245 | } |
246 | 246 | } |
@@ -248,9 +248,9 @@ discard block |
||
248 | 248 | } |
249 | 249 | |
250 | 250 | foreach ($class->subClasses as $subClass) { |
251 | - if (!in_array($class->name, class_parents($subClass))) { |
|
252 | - $ce[] = "According to the discriminator map class '" . $subClass . "' has to be a child ". |
|
253 | - "of '" . $class->name . "' but these entities are not related through inheritance."; |
|
251 | + if ( ! in_array($class->name, class_parents($subClass))) { |
|
252 | + $ce[] = "According to the discriminator map class '".$subClass."' has to be a child ". |
|
253 | + "of '".$class->name."' but these entities are not related through inheritance."; |
|
254 | 254 | } |
255 | 255 | } |
256 | 256 |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $class->reflFields[$fieldName]->setValue($entity, $value); |
200 | 200 | $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value); |
201 | 201 | |
202 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
202 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
203 | 203 | } else if ( |
204 | 204 | isset($this->_hints[Query::HINT_REFRESH]) || |
205 | 205 | isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) && |
@@ -210,10 +210,10 @@ discard block |
||
210 | 210 | $value->setInitialized(true); |
211 | 211 | $value->unwrap()->clear(); |
212 | 212 | |
213 | - $this->initializedCollections[$oid . $fieldName] = $value; |
|
213 | + $this->initializedCollections[$oid.$fieldName] = $value; |
|
214 | 214 | } else { |
215 | 215 | // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN! |
216 | - $this->existingCollections[$oid . $fieldName] = $value; |
|
216 | + $this->existingCollections[$oid.$fieldName] = $value; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | return $value; |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | $idHash = ''; |
288 | 288 | |
289 | 289 | foreach ($class->identifier as $fieldName) { |
290 | - $idHash .= ' ' . (isset($class->associationMappings[$fieldName]) |
|
290 | + $idHash .= ' '.(isset($class->associationMappings[$fieldName]) |
|
291 | 291 | ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']] |
292 | 292 | : $data[$fieldName]); |
293 | 293 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias]; |
344 | 344 | // we need the $path to save into the identifier map which entities were already |
345 | 345 | // seen for this parent-child relationship |
346 | - $path = $parentAlias . '.' . $dqlAlias; |
|
346 | + $path = $parentAlias.'.'.$dqlAlias; |
|
347 | 347 | |
348 | 348 | // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs |
349 | 349 | if ( ! isset($nonemptyComponents[$parentAlias])) { |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $reflFieldValue = $reflField->getValue($parentObject); |
384 | 384 | |
385 | 385 | if (isset($nonemptyComponents[$dqlAlias])) { |
386 | - $collKey = $oid . $relationField; |
|
386 | + $collKey = $oid.$relationField; |
|
387 | 387 | if (isset($this->initializedCollections[$collKey])) { |
388 | 388 | $reflFieldValue = $this->initializedCollections[$collKey]; |
389 | 389 | } else if ( ! isset($this->existingCollections[$collKey])) { |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | // PATH B: Single-valued association |
432 | 432 | $reflFieldValue = $reflField->getValue($parentObject); |
433 | 433 | |
434 | - if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) { |
|
434 | + if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized__)) { |
|
435 | 435 | // we only need to take action if this value is null, |
436 | 436 | // we refresh the entity or its an uninitialized proxy. |
437 | 437 | if (isset($nonemptyComponents[$dqlAlias])) { |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0; |
477 | 477 | |
478 | 478 | // if this row has a NULL value for the root result id then make it a null result. |
479 | - if ( ! isset($nonemptyComponents[$dqlAlias]) ) { |
|
479 | + if ( ! isset($nonemptyComponents[$dqlAlias])) { |
|
480 | 480 | if ($this->_rsm->isMixed) { |
481 | 481 | $result[] = [$entityKey => null]; |
482 | 482 | } else { |
@@ -532,13 +532,13 @@ discard block |
||
532 | 532 | } |
533 | 533 | } |
534 | 534 | |
535 | - if ( ! isset($resultKey) ) { |
|
535 | + if ( ! isset($resultKey)) { |
|
536 | 536 | $this->resultCounter++; |
537 | 537 | } |
538 | 538 | |
539 | 539 | // Append scalar values to mixed result sets |
540 | 540 | if (isset($rowData['scalars'])) { |
541 | - if ( ! isset($resultKey) ) { |
|
541 | + if ( ! isset($resultKey)) { |
|
542 | 542 | $resultKey = (isset($this->_rsm->indexByMap['scalars'])) |
543 | 543 | ? $row[$this->_rsm->indexByMap['scalars']] |
544 | 544 | : $this->resultCounter - 1; |
@@ -551,19 +551,19 @@ discard block |
||
551 | 551 | |
552 | 552 | // Append new object to mixed result sets |
553 | 553 | if (isset($rowData['newObjects'])) { |
554 | - if ( ! isset($resultKey) ) { |
|
554 | + if ( ! isset($resultKey)) { |
|
555 | 555 | $resultKey = $this->resultCounter - 1; |
556 | 556 | } |
557 | 557 | |
558 | 558 | |
559 | - $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0); |
|
559 | + $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0); |
|
560 | 560 | |
561 | 561 | foreach ($rowData['newObjects'] as $objIndex => $newObject) { |
562 | 562 | $class = $newObject['class']; |
563 | 563 | $args = $newObject['args']; |
564 | 564 | $obj = $class->newInstanceArgs($args); |
565 | 565 | |
566 | - if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) { |
|
566 | + if ($scalarCount == 0 && count($rowData['newObjects']) == 1) { |
|
567 | 567 | $result[$resultKey] = $obj; |
568 | 568 | |
569 | 569 | continue; |
@@ -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); |
@@ -651,7 +651,7 @@ discard block |
||
651 | 651 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
652 | 652 | |
653 | 653 | if ($this->useSqlTableAliases) { |
654 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
654 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | $sql .= $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | } |
681 | 681 | |
682 | 682 | if ($this->useSqlTableAliases) { |
683 | - $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias) . '.'; |
|
683 | + $sql .= $this->getSQLTableAlias($class->getTableName(), $dqlAlias).'.'; |
|
684 | 684 | } |
685 | 685 | |
686 | 686 | $sql .= reset($assoc['targetToSourceKeyColumns']); |
@@ -698,7 +698,7 @@ discard block |
||
698 | 698 | */ |
699 | 699 | public function walkSelectClause($selectClause) |
700 | 700 | { |
701 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
701 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
702 | 702 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
703 | 703 | |
704 | 704 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | $discrColumn = $rootClass->discriminatorColumn; |
736 | 736 | $columnAlias = $this->getSQLColumnAlias($discrColumn['name']); |
737 | 737 | |
738 | - $sqlSelectExpressions[] = $tblAlias . '.' . $discrColumn['name'] . ' AS ' . $columnAlias; |
|
738 | + $sqlSelectExpressions[] = $tblAlias.'.'.$discrColumn['name'].' AS '.$columnAlias; |
|
739 | 739 | |
740 | 740 | $this->rsm->setDiscriminatorColumn($dqlAlias, $columnAlias); |
741 | 741 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $discrColumn['fieldName'], false, $discrColumn['type']); |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | foreach ($class->associationMappings as $assoc) { |
751 | 751 | if ( ! ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE)) { |
752 | 752 | continue; |
753 | - } else if ( !$addMetaColumns && !isset($assoc['id'])) { |
|
753 | + } else if ( ! $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 | /** |
@@ -884,7 +884,7 @@ discard block |
||
884 | 884 | } |
885 | 885 | |
886 | 886 | $sql = $this->platform->appendLockHint( |
887 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
887 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
888 | 888 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
889 | 889 | $this->query->getHint(Query::HINT_LOCK_MODE) |
890 | 890 | ); |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | // Ensure we got the owning side, since it has all mapping info |
927 | 927 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
928 | 928 | |
929 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
929 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
930 | 930 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
931 | 931 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
932 | 932 | } |
@@ -946,12 +946,12 @@ discard block |
||
946 | 946 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
947 | 947 | |
948 | 948 | if ($relation['isOwningSide']) { |
949 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
949 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
950 | 950 | |
951 | 951 | continue; |
952 | 952 | } |
953 | 953 | |
954 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
954 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
955 | 955 | } |
956 | 956 | |
957 | 957 | // Apply remaining inheritance restrictions |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | } |
970 | 970 | |
971 | 971 | $targetTableJoin = [ |
972 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
972 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
973 | 973 | 'condition' => implode(' AND ', $conditions), |
974 | 974 | ]; |
975 | 975 | break; |
@@ -989,10 +989,10 @@ discard block |
||
989 | 989 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
990 | 990 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
991 | 991 | |
992 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
992 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
993 | 993 | } |
994 | 994 | |
995 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
995 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
996 | 996 | |
997 | 997 | // Join target table |
998 | 998 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1006,7 +1006,7 @@ 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[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
1009 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | // Apply remaining inheritance restrictions |
@@ -1024,7 +1024,7 @@ discard block |
||
1024 | 1024 | } |
1025 | 1025 | |
1026 | 1026 | $targetTableJoin = [ |
1027 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1027 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1028 | 1028 | 'condition' => implode(' AND ', $conditions), |
1029 | 1029 | ]; |
1030 | 1030 | break; |
@@ -1034,22 +1034,22 @@ discard block |
||
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | // Handle WITH clause |
1037 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1037 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1038 | 1038 | |
1039 | 1039 | if ($targetClass->isInheritanceTypeJoined()) { |
1040 | 1040 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1041 | 1041 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1042 | 1042 | if ($withCondition) { |
1043 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1043 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1044 | 1044 | } else { |
1045 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1045 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1046 | 1046 | } |
1047 | 1047 | } else { |
1048 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1048 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1049 | 1049 | } |
1050 | 1050 | |
1051 | 1051 | if ($withCondition) { |
1052 | - $sql .= ' AND ' . $withCondition; |
|
1052 | + $sql .= ' AND '.$withCondition; |
|
1053 | 1053 | } |
1054 | 1054 | |
1055 | 1055 | // Apply the indexes |
@@ -1082,7 +1082,7 @@ discard block |
||
1082 | 1082 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1083 | 1083 | } |
1084 | 1084 | |
1085 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1085 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1086 | 1086 | } |
1087 | 1087 | |
1088 | 1088 | /** |
@@ -1099,10 +1099,10 @@ discard block |
||
1099 | 1099 | $this->orderedColumnsMap[$sql] = $type; |
1100 | 1100 | |
1101 | 1101 | if ($expr instanceof AST\Subselect) { |
1102 | - return '(' . $sql . ') ' . $type; |
|
1102 | + return '('.$sql.') '.$type; |
|
1103 | 1103 | } |
1104 | 1104 | |
1105 | - return $sql . ' ' . $type; |
|
1105 | + return $sql.' '.$type; |
|
1106 | 1106 | } |
1107 | 1107 | |
1108 | 1108 | /** |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | */ |
1111 | 1111 | public function walkHavingClause($havingClause) |
1112 | 1112 | { |
1113 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1113 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1114 | 1114 | } |
1115 | 1115 | |
1116 | 1116 | /** |
@@ -1133,7 +1133,7 @@ discard block |
||
1133 | 1133 | $conditions = []; |
1134 | 1134 | |
1135 | 1135 | if ($join->conditionalExpression) { |
1136 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1136 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1137 | 1137 | } |
1138 | 1138 | |
1139 | 1139 | $condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER) |
@@ -1157,7 +1157,7 @@ discard block |
||
1157 | 1157 | } |
1158 | 1158 | |
1159 | 1159 | if ($conditions) { |
1160 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1160 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1161 | 1161 | } |
1162 | 1162 | |
1163 | 1163 | break; |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1188 | 1188 | } |
1189 | 1189 | |
1190 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1190 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1191 | 1191 | |
1192 | 1192 | return $sql; |
1193 | 1193 | } |
@@ -1209,7 +1209,7 @@ discard block |
||
1209 | 1209 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1210 | 1210 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1211 | 1211 | |
1212 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1212 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1213 | 1213 | } |
1214 | 1214 | |
1215 | 1215 | /** |
@@ -1224,11 +1224,11 @@ discard block |
||
1224 | 1224 | $sql = 'CASE'; |
1225 | 1225 | |
1226 | 1226 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1227 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1228 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1227 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1228 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1229 | 1229 | } |
1230 | 1230 | |
1231 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1231 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1232 | 1232 | |
1233 | 1233 | return $sql; |
1234 | 1234 | } |
@@ -1242,14 +1242,14 @@ discard block |
||
1242 | 1242 | */ |
1243 | 1243 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1244 | 1244 | { |
1245 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1245 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1246 | 1246 | |
1247 | 1247 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1248 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1249 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1248 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1249 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1250 | 1250 | } |
1251 | 1251 | |
1252 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1252 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1253 | 1253 | |
1254 | 1254 | return $sql; |
1255 | 1255 | } |
@@ -1283,14 +1283,14 @@ discard block |
||
1283 | 1283 | $fieldMapping = $class->fieldMappings[$fieldName]; |
1284 | 1284 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1285 | 1285 | $columnAlias = $this->getSQLColumnAlias($fieldMapping['columnName']); |
1286 | - $col = $sqlTableAlias . '.' . $columnName; |
|
1286 | + $col = $sqlTableAlias.'.'.$columnName; |
|
1287 | 1287 | |
1288 | 1288 | if (isset($fieldMapping['requireSQLConversion'])) { |
1289 | 1289 | $type = Type::getType($fieldMapping['type']); |
1290 | 1290 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
1291 | 1291 | } |
1292 | 1292 | |
1293 | - $sql .= $col . ' AS ' . $columnAlias; |
|
1293 | + $sql .= $col.' AS '.$columnAlias; |
|
1294 | 1294 | |
1295 | 1295 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1296 | 1296 | |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1316 | 1316 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1317 | 1317 | |
1318 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1318 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1319 | 1319 | |
1320 | 1320 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1321 | 1321 | |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1330 | 1330 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1331 | 1331 | |
1332 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1332 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1333 | 1333 | |
1334 | 1334 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1335 | 1335 | |
@@ -1340,7 +1340,7 @@ discard block |
||
1340 | 1340 | break; |
1341 | 1341 | |
1342 | 1342 | case ($expr instanceof AST\NewObjectExpression): |
1343 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1343 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1344 | 1344 | break; |
1345 | 1345 | |
1346 | 1346 | default: |
@@ -1381,14 +1381,14 @@ discard block |
||
1381 | 1381 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1382 | 1382 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
1383 | 1383 | |
1384 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1384 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1385 | 1385 | |
1386 | 1386 | if (isset($mapping['requireSQLConversion'])) { |
1387 | 1387 | $type = Type::getType($mapping['type']); |
1388 | 1388 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1389 | 1389 | } |
1390 | 1390 | |
1391 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
1391 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1392 | 1392 | |
1393 | 1393 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1394 | 1394 | |
@@ -1405,21 +1405,21 @@ discard block |
||
1405 | 1405 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
1406 | 1406 | |
1407 | 1407 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
1408 | - if (isset($mapping['inherited']) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
1408 | + if (isset($mapping['inherited']) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
1409 | 1409 | continue; |
1410 | 1410 | } |
1411 | 1411 | |
1412 | 1412 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
1413 | 1413 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
1414 | 1414 | |
1415 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
1415 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
1416 | 1416 | |
1417 | 1417 | if (isset($mapping['requireSQLConversion'])) { |
1418 | 1418 | $type = Type::getType($mapping['type']); |
1419 | 1419 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
1420 | 1420 | } |
1421 | 1421 | |
1422 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
1422 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
1423 | 1423 | |
1424 | 1424 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
1425 | 1425 | |
@@ -1439,7 +1439,7 @@ discard block |
||
1439 | 1439 | */ |
1440 | 1440 | public function walkQuantifiedExpression($qExpr) |
1441 | 1441 | { |
1442 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1442 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1443 | 1443 | } |
1444 | 1444 | |
1445 | 1445 | /** |
@@ -1479,7 +1479,7 @@ discard block |
||
1479 | 1479 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1480 | 1480 | } |
1481 | 1481 | |
1482 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1482 | + return ' FROM '.implode(', ', $sqlParts); |
|
1483 | 1483 | } |
1484 | 1484 | |
1485 | 1485 | /** |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | */ |
1488 | 1488 | public function walkSimpleSelectClause($simpleSelectClause) |
1489 | 1489 | { |
1490 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1490 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1491 | 1491 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1492 | 1492 | } |
1493 | 1493 | |
@@ -1506,10 +1506,10 @@ discard block |
||
1506 | 1506 | * @param null|string $newObjectResultAlias |
1507 | 1507 | * @return string The SQL. |
1508 | 1508 | */ |
1509 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1509 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1510 | 1510 | { |
1511 | 1511 | $sqlSelectExpressions = []; |
1512 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
1512 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
1513 | 1513 | |
1514 | 1514 | foreach ($newObjectExpression->args as $argIndex => $e) { |
1515 | 1515 | $resultAlias = $this->scalarResultCounter++; |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | break; |
1523 | 1523 | |
1524 | 1524 | case ($e instanceof AST\Subselect): |
1525 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1525 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1526 | 1526 | break; |
1527 | 1527 | |
1528 | 1528 | case ($e instanceof AST\PathExpression): |
@@ -1531,7 +1531,7 @@ discard block |
||
1531 | 1531 | $class = $qComp['metadata']; |
1532 | 1532 | $fieldType = $class->fieldMappings[$e->field]['type']; |
1533 | 1533 | |
1534 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1534 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1535 | 1535 | break; |
1536 | 1536 | |
1537 | 1537 | case ($e instanceof AST\Literal): |
@@ -1545,11 +1545,11 @@ discard block |
||
1545 | 1545 | break; |
1546 | 1546 | } |
1547 | 1547 | |
1548 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1548 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1549 | 1549 | break; |
1550 | 1550 | |
1551 | 1551 | default: |
1552 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1552 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
1553 | 1553 | break; |
1554 | 1554 | } |
1555 | 1555 | |
@@ -1582,16 +1582,16 @@ discard block |
||
1582 | 1582 | case ($expr instanceof AST\AggregateExpression): |
1583 | 1583 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1584 | 1584 | |
1585 | - $sql .= $this->walkAggregateExpression($expr) . ' AS dctrn__' . $alias; |
|
1585 | + $sql .= $this->walkAggregateExpression($expr).' AS dctrn__'.$alias; |
|
1586 | 1586 | break; |
1587 | 1587 | |
1588 | 1588 | case ($expr instanceof AST\Subselect): |
1589 | 1589 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1590 | 1590 | |
1591 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1591 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1592 | 1592 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1593 | 1593 | |
1594 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1594 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1595 | 1595 | break; |
1596 | 1596 | |
1597 | 1597 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1608,7 +1608,7 @@ discard block |
||
1608 | 1608 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
1609 | 1609 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1610 | 1610 | |
1611 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1611 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1612 | 1612 | break; |
1613 | 1613 | |
1614 | 1614 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1628,8 +1628,8 @@ discard block |
||
1628 | 1628 | */ |
1629 | 1629 | public function walkAggregateExpression($aggExpression) |
1630 | 1630 | { |
1631 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1632 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1631 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1632 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1633 | 1633 | } |
1634 | 1634 | |
1635 | 1635 | /** |
@@ -1643,7 +1643,7 @@ discard block |
||
1643 | 1643 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1644 | 1644 | } |
1645 | 1645 | |
1646 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1646 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1647 | 1647 | } |
1648 | 1648 | |
1649 | 1649 | /** |
@@ -1700,7 +1700,7 @@ discard block |
||
1700 | 1700 | { |
1701 | 1701 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1702 | 1702 | $tableName = $class->getTableName(); |
1703 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1703 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1704 | 1704 | |
1705 | 1705 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1706 | 1706 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1715,12 +1715,12 @@ discard block |
||
1715 | 1715 | { |
1716 | 1716 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1717 | 1717 | $tableName = $class->getTableName(); |
1718 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
1718 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
1719 | 1719 | |
1720 | 1720 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1721 | 1721 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1722 | 1722 | |
1723 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1723 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1724 | 1724 | |
1725 | 1725 | return $sql; |
1726 | 1726 | } |
@@ -1733,7 +1733,7 @@ discard block |
||
1733 | 1733 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1734 | 1734 | $this->useSqlTableAliases = false; |
1735 | 1735 | |
1736 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1736 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1737 | 1737 | $newValue = $updateItem->newValue; |
1738 | 1738 | |
1739 | 1739 | switch (true) { |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | |
1777 | 1777 | if (count($filterClauses)) { |
1778 | 1778 | if ($condSql) { |
1779 | - $condSql = '(' . $condSql . ') AND '; |
|
1779 | + $condSql = '('.$condSql.') AND '; |
|
1780 | 1780 | } |
1781 | 1781 | |
1782 | 1782 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1784,11 +1784,11 @@ discard block |
||
1784 | 1784 | } |
1785 | 1785 | |
1786 | 1786 | if ($condSql) { |
1787 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1787 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1788 | 1788 | } |
1789 | 1789 | |
1790 | 1790 | if ($discrSql) { |
1791 | - return ' WHERE ' . $discrSql; |
|
1791 | + return ' WHERE '.$discrSql; |
|
1792 | 1792 | } |
1793 | 1793 | |
1794 | 1794 | return ''; |
@@ -1831,7 +1831,7 @@ discard block |
||
1831 | 1831 | // if only one ConditionalPrimary is defined |
1832 | 1832 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1833 | 1833 | ? $this->walkConditionalPrimary($factor) |
1834 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1834 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1835 | 1835 | } |
1836 | 1836 | |
1837 | 1837 | /** |
@@ -1846,7 +1846,7 @@ discard block |
||
1846 | 1846 | if ($primary->isConditionalExpression()) { |
1847 | 1847 | $condExpr = $primary->conditionalExpression; |
1848 | 1848 | |
1849 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1849 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1850 | 1850 | } |
1851 | 1851 | } |
1852 | 1852 | |
@@ -1857,7 +1857,7 @@ discard block |
||
1857 | 1857 | { |
1858 | 1858 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1859 | 1859 | |
1860 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1860 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1861 | 1861 | |
1862 | 1862 | return $sql; |
1863 | 1863 | } |
@@ -1901,7 +1901,7 @@ discard block |
||
1901 | 1901 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1902 | 1902 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1903 | 1903 | |
1904 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
1904 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
1905 | 1905 | |
1906 | 1906 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
1907 | 1907 | $sqlParts = []; |
@@ -1909,7 +1909,7 @@ discard block |
||
1909 | 1909 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
1910 | 1910 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
1911 | 1911 | |
1912 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
1912 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
1913 | 1913 | } |
1914 | 1914 | |
1915 | 1915 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1917,7 +1917,7 @@ discard block |
||
1917 | 1917 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1918 | 1918 | } |
1919 | 1919 | |
1920 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
1920 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
1921 | 1921 | } |
1922 | 1922 | |
1923 | 1923 | $sql .= implode(' AND ', $sqlParts); |
@@ -1933,8 +1933,8 @@ discard block |
||
1933 | 1933 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1934 | 1934 | |
1935 | 1935 | // join to target table |
1936 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
1937 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
1936 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
1937 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
1938 | 1938 | |
1939 | 1939 | // join conditions |
1940 | 1940 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1943,7 +1943,7 @@ discard block |
||
1943 | 1943 | foreach ($joinColumns as $joinColumn) { |
1944 | 1944 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
1945 | 1945 | |
1946 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
1946 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
1947 | 1947 | } |
1948 | 1948 | |
1949 | 1949 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -1955,7 +1955,7 @@ discard block |
||
1955 | 1955 | foreach ($joinColumns as $joinColumn) { |
1956 | 1956 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
1957 | 1957 | |
1958 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
1958 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
1959 | 1959 | } |
1960 | 1960 | |
1961 | 1961 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1963,13 +1963,13 @@ discard block |
||
1963 | 1963 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
1964 | 1964 | } |
1965 | 1965 | |
1966 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
1966 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
1967 | 1967 | } |
1968 | 1968 | |
1969 | 1969 | $sql .= implode(' AND ', $sqlParts); |
1970 | 1970 | } |
1971 | 1971 | |
1972 | - return $sql . ')'; |
|
1972 | + return $sql.')'; |
|
1973 | 1973 | } |
1974 | 1974 | |
1975 | 1975 | /** |
@@ -1980,7 +1980,7 @@ discard block |
||
1980 | 1980 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
1981 | 1981 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
1982 | 1982 | |
1983 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
1983 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
1984 | 1984 | } |
1985 | 1985 | |
1986 | 1986 | /** |
@@ -1989,19 +1989,19 @@ discard block |
||
1989 | 1989 | public function walkNullComparisonExpression($nullCompExpr) |
1990 | 1990 | { |
1991 | 1991 | $expression = $nullCompExpr->expression; |
1992 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
1992 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
1993 | 1993 | |
1994 | 1994 | // Handle ResultVariable |
1995 | 1995 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
1996 | - return $this->walkResultVariable($expression) . $comparison; |
|
1996 | + return $this->walkResultVariable($expression).$comparison; |
|
1997 | 1997 | } |
1998 | 1998 | |
1999 | 1999 | // Handle InputParameter mapping inclusion to ParserResult |
2000 | 2000 | if ($expression instanceof AST\InputParameter) { |
2001 | - return $this->walkInputParameter($expression) . $comparison; |
|
2001 | + return $this->walkInputParameter($expression).$comparison; |
|
2002 | 2002 | } |
2003 | 2003 | |
2004 | - return $expression->dispatch($this) . $comparison; |
|
2004 | + return $expression->dispatch($this).$comparison; |
|
2005 | 2005 | } |
2006 | 2006 | |
2007 | 2007 | /** |
@@ -2009,7 +2009,7 @@ discard block |
||
2009 | 2009 | */ |
2010 | 2010 | public function walkInExpression($inExpr) |
2011 | 2011 | { |
2012 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2012 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2013 | 2013 | |
2014 | 2014 | $sql .= ($inExpr->subselect) |
2015 | 2015 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2035,10 +2035,10 @@ discard block |
||
2035 | 2035 | } |
2036 | 2036 | |
2037 | 2037 | if ($this->useSqlTableAliases) { |
2038 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
2038 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
2039 | 2039 | } |
2040 | 2040 | |
2041 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2041 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
2042 | 2042 | |
2043 | 2043 | $sqlParameterList = []; |
2044 | 2044 | |
@@ -2068,7 +2068,7 @@ discard block |
||
2068 | 2068 | $sqlParameterList[] = $this->conn->quote($discriminatorValue); |
2069 | 2069 | } |
2070 | 2070 | |
2071 | - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; |
|
2071 | + $sql .= '('.implode(', ', $sqlParameterList).')'; |
|
2072 | 2072 | |
2073 | 2073 | return $sql; |
2074 | 2074 | } |
@@ -2114,8 +2114,8 @@ discard block |
||
2114 | 2114 | $sql .= ' NOT'; |
2115 | 2115 | } |
2116 | 2116 | |
2117 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2118 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2117 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2118 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2119 | 2119 | |
2120 | 2120 | return $sql; |
2121 | 2121 | } |
@@ -2130,7 +2130,7 @@ discard block |
||
2130 | 2130 | ? $this->walkResultVariable($stringExpr) |
2131 | 2131 | : $stringExpr->dispatch($this); |
2132 | 2132 | |
2133 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2133 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2134 | 2134 | |
2135 | 2135 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2136 | 2136 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2143,7 +2143,7 @@ discard block |
||
2143 | 2143 | } |
2144 | 2144 | |
2145 | 2145 | if ($likeExpr->escapeChar) { |
2146 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2146 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2147 | 2147 | } |
2148 | 2148 | |
2149 | 2149 | return $sql; |
@@ -2170,7 +2170,7 @@ discard block |
||
2170 | 2170 | ? $leftExpr->dispatch($this) |
2171 | 2171 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2172 | 2172 | |
2173 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2173 | + $sql .= ' '.$compExpr->operator.' '; |
|
2174 | 2174 | |
2175 | 2175 | $sql .= ($rightExpr instanceof AST\Node) |
2176 | 2176 | ? $rightExpr->dispatch($this) |
@@ -2202,7 +2202,7 @@ discard block |
||
2202 | 2202 | { |
2203 | 2203 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2204 | 2204 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2205 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2205 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2206 | 2206 | } |
2207 | 2207 | |
2208 | 2208 | /** |
@@ -2256,7 +2256,7 @@ discard block |
||
2256 | 2256 | |
2257 | 2257 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2258 | 2258 | |
2259 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2259 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2260 | 2260 | } |
2261 | 2261 | |
2262 | 2262 | /** |
@@ -2269,7 +2269,7 @@ discard block |
||
2269 | 2269 | public function walkArithmeticPrimary($primary) |
2270 | 2270 | { |
2271 | 2271 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2272 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2272 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2273 | 2273 | } |
2274 | 2274 | |
2275 | 2275 | if ($primary instanceof AST\Node) { |
@@ -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 [ |