@@ -21,7 +21,6 @@ |
||
| 21 | 21 | namespace Doctrine\ORM\Cache; |
| 22 | 22 | |
| 23 | 23 | use Doctrine\Common\Util\ClassUtils; |
| 24 | - |
|
| 25 | 24 | use Doctrine\ORM\Query; |
| 26 | 25 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 27 | 26 | use Doctrine\ORM\EntityManagerInterface; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $targetAssoc = $targetClassMetadata->associationMappings[$fieldName]; |
| 111 | 111 | |
| 112 | - foreach($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { |
|
| 112 | + foreach ($assoc['targetToSourceKeyColumns'] as $referencedColumn => $localColumn) { |
|
| 113 | 113 | if (isset($targetAssoc['sourceToTargetKeyColumns'][$referencedColumn])) { |
| 114 | 114 | $data[$localColumn] = $fieldValue; |
| 115 | 115 | } |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | foreach ($metadata->associationMappings as $name => $assoc) { |
| 164 | - if ( ! isset($assoc['cache']) || ! isset($data[$name])) { |
|
| 164 | + if ( ! isset($assoc['cache']) || ! isset($data[$name])) { |
|
| 165 | 165 | continue; |
| 166 | 166 | } |
| 167 | 167 | |
@@ -282,7 +282,7 @@ |
||
| 282 | 282 | /** |
| 283 | 283 | * Generates a string of currently query |
| 284 | 284 | * |
| 285 | - * @param array $query |
|
| 285 | + * @param string $query |
|
| 286 | 286 | * @param string $criteria |
| 287 | 287 | * @param array $orderBy |
| 288 | 288 | * @param integer $limit |
@@ -31,7 +31,6 @@ |
||
| 31 | 31 | use Doctrine\ORM\PersistentCollection; |
| 32 | 32 | use Doctrine\ORM\EntityManagerInterface; |
| 33 | 33 | use Doctrine\ORM\Persisters\Entity\EntityPersister; |
| 34 | - |
|
| 35 | 34 | use Doctrine\Common\Util\ClassUtils; |
| 36 | 35 | use Doctrine\Common\Collections\Criteria; |
| 37 | 36 | |
@@ -296,7 +296,7 @@ |
||
| 296 | 296 | ? $this->persister->expandCriteriaParameters($criteria) |
| 297 | 297 | : $this->persister->expandParameters($criteria); |
| 298 | 298 | |
| 299 | - return sha1($query . serialize($params) . serialize($orderBy) . $limit . $offset); |
|
| 299 | + return sha1($query.serialize($params).serialize($orderBy).$limit.$offset); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -41,9 +41,9 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | abstract class AbstractEntityPersister implements CachedEntityPersister |
| 43 | 43 | { |
| 44 | - /** |
|
| 45 | - * @var \Doctrine\ORM\UnitOfWork |
|
| 46 | - */ |
|
| 44 | + /** |
|
| 45 | + * @var \Doctrine\ORM\UnitOfWork |
|
| 46 | + */ |
|
| 47 | 47 | protected $uow; |
| 48 | 48 | |
| 49 | 49 | /** |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | protected $class; |
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * @var array |
|
| 66 | - */ |
|
| 64 | + /** |
|
| 65 | + * @var array |
|
| 66 | + */ |
|
| 67 | 67 | protected $queuedCache = []; |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -70,8 +70,6 @@ |
||
| 70 | 70 | * Returns a join column name for a property. |
| 71 | 71 | * |
| 72 | 72 | * @param string $propertyName A property name. |
| 73 | - * @param string|null $className The fully-qualified class name. |
|
| 74 | - * This parameter is omitted from the signature due to BC |
|
| 75 | 73 | * |
| 76 | 74 | * @return string A join column name. |
| 77 | 75 | */ |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | /** |
| 50 | 50 | * Gets the SQL query. |
| 51 | 51 | * |
| 52 | - * @return mixed The built SQL query or an array of all SQL queries. |
|
| 52 | + * @return string The built SQL query or an array of all SQL queries. |
|
| 53 | 53 | * |
| 54 | 54 | * @override |
| 55 | 55 | */ |
@@ -579,7 +579,7 @@ |
||
| 579 | 579 | * Internal note: Tried to implement Serializable first but that did not work well |
| 580 | 580 | * with circular references. This solution seems simpler and works well. |
| 581 | 581 | * |
| 582 | - * @return array |
|
| 582 | + * @return string[] |
|
| 583 | 583 | */ |
| 584 | 584 | public function __sleep() |
| 585 | 585 | { |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | */ |
| 404 | 404 | public function containsKey($key) |
| 405 | 405 | { |
| 406 | - if (! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
| 406 | + if ( ! $this->initialized && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
|
| 407 | 407 | && isset($this->association['indexBy'])) { |
| 408 | 408 | $persister = $this->em->getUnitOfWork()->getCollectionPersister($this->association); |
| 409 | 409 | |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | && $this->association['fetch'] === ClassMetadata::FETCH_EXTRA_LAZY |
| 437 | 437 | && isset($this->association['indexBy']) |
| 438 | 438 | ) { |
| 439 | - if (!$this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
| 439 | + if ( ! $this->typeClass->isIdentifierComposite && $this->typeClass->isIdentifier($this->association['indexBy'])) { |
|
| 440 | 440 | return $this->em->find($this->typeClass->name, $key); |
| 441 | 441 | } |
| 442 | 442 | |
@@ -20,7 +20,6 @@ |
||
| 20 | 20 | namespace Doctrine\ORM\Query; |
| 21 | 21 | |
| 22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
| 23 | - |
|
| 24 | 23 | use Doctrine\Common\Collections\Expr\ExpressionVisitor; |
| 25 | 24 | use Doctrine\Common\Collections\Expr\Comparison; |
| 26 | 25 | use Doctrine\Common\Collections\Expr\CompositeExpression; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $expressionList[] = $this->dispatch($child); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - switch($expr->getType()) { |
|
| 117 | + switch ($expr->getType()) { |
|
| 118 | 118 | case CompositeExpression::TYPE_AND: |
| 119 | 119 | return new Expr\Andx($expressionList); |
| 120 | 120 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | return new Expr\Orx($expressionList); |
| 123 | 123 | |
| 124 | 124 | default: |
| 125 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
| 125 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -136,10 +136,10 @@ discard block |
||
| 136 | 136 | throw new QueryException('No aliases are set before invoking walkComparison().'); |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - $field = $this->queryAliases[0] . '.' . $comparison->getField(); |
|
| 139 | + $field = $this->queryAliases[0].'.'.$comparison->getField(); |
|
| 140 | 140 | |
| 141 | - foreach($this->queryAliases as $alias) { |
|
| 142 | - if(strpos($comparison->getField() . '.', $alias . '.') === 0) { |
|
| 141 | + foreach ($this->queryAliases as $alias) { |
|
| 142 | + if (strpos($comparison->getField().'.', $alias.'.') === 0) { |
|
| 143 | 143 | $field = $comparison->getField(); |
| 144 | 144 | break; |
| 145 | 145 | } |
@@ -149,13 +149,13 @@ discard block |
||
| 149 | 149 | |
| 150 | 150 | foreach ($this->parameters as $parameter) { |
| 151 | 151 | if ($parameter->getName() === $parameterName) { |
| 152 | - $parameterName .= '_' . count($this->parameters); |
|
| 152 | + $parameterName .= '_'.count($this->parameters); |
|
| 153 | 153 | break; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue())); |
| 158 | - $placeholder = ':' . $parameterName; |
|
| 158 | + $placeholder = ':'.$parameterName; |
|
| 159 | 159 | |
| 160 | 160 | switch ($comparison->getOperator()) { |
| 161 | 161 | case Comparison::IN: |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | return $this->expr->neq($field, $placeholder); |
| 184 | 184 | case Comparison::CONTAINS: |
| 185 | - $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); |
|
| 185 | + $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); |
|
| 186 | 186 | $this->parameters[] = $parameter; |
| 187 | 187 | |
| 188 | 188 | return $this->expr->like($field, $placeholder); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | ); |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | - throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); |
|
| 201 | + throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator()); |
|
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | 204 | |
@@ -389,7 +389,7 @@ |
||
| 389 | 389 | /** |
| 390 | 390 | * Adds a metadata parameter mappings. |
| 391 | 391 | * |
| 392 | - * @param mixed $parameter The parameter name in the SQL result set. |
|
| 392 | + * @param string $parameter The parameter name in the SQL result set. |
|
| 393 | 393 | * @param string $attribute The metadata attribute. |
| 394 | 394 | */ |
| 395 | 395 | public function addMetadataParameterMapping($parameter, $attribute) |
@@ -227,7 +227,9 @@ |
||
| 227 | 227 | $found = false; |
| 228 | 228 | |
| 229 | 229 | foreach (array_merge($this->metaMappings, $this->fieldMappings) as $columnName => $columnFieldName) { |
| 230 | - if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) continue; |
|
| 230 | + if ( ! ($columnFieldName === $fieldName && $this->columnOwnerMap[$columnName] === $alias)) { |
|
| 231 | + continue; |
|
| 232 | + } |
|
| 231 | 233 | |
| 232 | 234 | $this->addIndexByColumn($alias, $columnName); |
| 233 | 235 | $found = true; |
@@ -1529,6 +1529,7 @@ |
||
| 1529 | 1529 | |
| 1530 | 1530 | /** |
| 1531 | 1531 | * @param AST\NewObjectExpression $newObjectExpression |
| 1532 | + * @param string $newObjectResultAlias |
|
| 1532 | 1533 | * |
| 1533 | 1534 | * @return string The SQL. |
| 1534 | 1535 | */ |
@@ -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 | |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | $columnAlias = $this->getSQLColumnAlias($columnName); |
| 765 | 765 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
| 766 | 766 | |
| 767 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $columnName . ' AS ' . $columnAlias; |
|
| 767 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$columnName.' AS '.$columnAlias; |
|
| 768 | 768 | |
| 769 | 769 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $isIdentifier, $columnType); |
| 770 | 770 | } |
@@ -792,7 +792,7 @@ discard block |
||
| 792 | 792 | $columnAlias = $this->getSQLColumnAlias($columnName); |
| 793 | 793 | $columnType = PersisterHelper::getTypeOfColumn($joinColumn['referencedColumnName'], $targetClass, $this->em); |
| 794 | 794 | |
| 795 | - $sqlSelectExpressions[] = $sqlTableAlias . '.' . $columnName . ' AS ' . $columnAlias; |
|
| 795 | + $sqlSelectExpressions[] = $sqlTableAlias.'.'.$columnName.' AS '.$columnAlias; |
|
| 796 | 796 | |
| 797 | 797 | $this->rsm->addMetaResult($dqlAlias, $columnAlias, $columnName, $subClass->isIdentifier($columnName), $columnType); |
| 798 | 798 | } |
@@ -818,7 +818,7 @@ discard block |
||
| 818 | 818 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
| 819 | 819 | } |
| 820 | 820 | |
| 821 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 821 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 822 | 822 | } |
| 823 | 823 | |
| 824 | 824 | /** |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | } |
| 883 | 883 | |
| 884 | 884 | $sql = $this->platform->appendLockHint( |
| 885 | - $this->quoteStrategy->getTableName($class, $this->platform) . ' ' . |
|
| 885 | + $this->quoteStrategy->getTableName($class, $this->platform).' '. |
|
| 886 | 886 | $this->getSQLTableAlias($class->getTableName(), $dqlAlias), |
| 887 | 887 | $this->query->getHint(Query::HINT_LOCK_MODE) |
| 888 | 888 | ); |
@@ -924,7 +924,7 @@ discard block |
||
| 924 | 924 | // Ensure we got the owning side, since it has all mapping info |
| 925 | 925 | $assoc = ( ! $relation['isOwningSide']) ? $targetClass->associationMappings[$relation['mappedBy']] : $relation; |
| 926 | 926 | |
| 927 | - if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 927 | + if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 928 | 928 | if ($relation['type'] == ClassMetadata::ONE_TO_MANY || $relation['type'] == ClassMetadata::MANY_TO_MANY) { |
| 929 | 929 | throw QueryException::iterateWithFetchJoinNotAllowed($assoc); |
| 930 | 930 | } |
@@ -944,12 +944,12 @@ discard block |
||
| 944 | 944 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 945 | 945 | |
| 946 | 946 | if ($relation['isOwningSide']) { |
| 947 | - $conditions[] = $sourceTableAlias . '.' . $quotedSourceColumn . ' = ' . $targetTableAlias . '.' . $quotedTargetColumn; |
|
| 947 | + $conditions[] = $sourceTableAlias.'.'.$quotedSourceColumn.' = '.$targetTableAlias.'.'.$quotedTargetColumn; |
|
| 948 | 948 | |
| 949 | 949 | continue; |
| 950 | 950 | } |
| 951 | 951 | |
| 952 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $targetTableAlias . '.' . $quotedSourceColumn; |
|
| 952 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$targetTableAlias.'.'.$quotedSourceColumn; |
|
| 953 | 953 | } |
| 954 | 954 | |
| 955 | 955 | // Apply remaining inheritance restrictions |
@@ -967,7 +967,7 @@ discard block |
||
| 967 | 967 | } |
| 968 | 968 | |
| 969 | 969 | $targetTableJoin = [ |
| 970 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 970 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 971 | 971 | 'condition' => implode(' AND ', $conditions), |
| 972 | 972 | ]; |
| 973 | 973 | break; |
@@ -987,10 +987,10 @@ discard block |
||
| 987 | 987 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 988 | 988 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 989 | 989 | |
| 990 | - $conditions[] = $sourceTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
| 990 | + $conditions[] = $sourceTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
| 991 | 991 | } |
| 992 | 992 | |
| 993 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
| 993 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
| 994 | 994 | |
| 995 | 995 | // Join target table |
| 996 | 996 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1004,7 +1004,7 @@ discard block |
||
| 1004 | 1004 | $quotedSourceColumn = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 1005 | 1005 | $quotedTargetColumn = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 1006 | 1006 | |
| 1007 | - $conditions[] = $targetTableAlias . '.' . $quotedTargetColumn . ' = ' . $joinTableAlias . '.' . $quotedSourceColumn; |
|
| 1007 | + $conditions[] = $targetTableAlias.'.'.$quotedTargetColumn.' = '.$joinTableAlias.'.'.$quotedSourceColumn; |
|
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | 1010 | // Apply remaining inheritance restrictions |
@@ -1022,7 +1022,7 @@ discard block |
||
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | $targetTableJoin = [ |
| 1025 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1025 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1026 | 1026 | 'condition' => implode(' AND ', $conditions), |
| 1027 | 1027 | ]; |
| 1028 | 1028 | break; |
@@ -1032,22 +1032,22 @@ discard block |
||
| 1032 | 1032 | } |
| 1033 | 1033 | |
| 1034 | 1034 | // Handle WITH clause |
| 1035 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
| 1035 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
| 1036 | 1036 | |
| 1037 | 1037 | if ($targetClass->isInheritanceTypeJoined()) { |
| 1038 | 1038 | $ctiJoins = $this->_generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
| 1039 | 1039 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
| 1040 | 1040 | if ($withCondition) { |
| 1041 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
| 1041 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
| 1042 | 1042 | } else { |
| 1043 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
| 1043 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
| 1044 | 1044 | } |
| 1045 | 1045 | } else { |
| 1046 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
| 1046 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | if ($withCondition) { |
| 1050 | - $sql .= ' AND ' . $withCondition; |
|
| 1050 | + $sql .= ' AND '.$withCondition; |
|
| 1051 | 1051 | } |
| 1052 | 1052 | |
| 1053 | 1053 | // Apply the indexes |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
| 1081 | 1081 | } |
| 1082 | 1082 | |
| 1083 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
| 1083 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
| 1084 | 1084 | } |
| 1085 | 1085 | |
| 1086 | 1086 | /** |
@@ -1097,10 +1097,10 @@ discard block |
||
| 1097 | 1097 | $this->orderedColumnsMap[$sql] = $type; |
| 1098 | 1098 | |
| 1099 | 1099 | if ($expr instanceof AST\Subselect) { |
| 1100 | - return '(' . $sql . ') ' . $type; |
|
| 1100 | + return '('.$sql.') '.$type; |
|
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | - return $sql . ' ' . $type; |
|
| 1103 | + return $sql.' '.$type; |
|
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | /** |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | */ |
| 1109 | 1109 | public function walkHavingClause($havingClause) |
| 1110 | 1110 | { |
| 1111 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1111 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | /** |
@@ -1131,7 +1131,7 @@ discard block |
||
| 1131 | 1131 | $conditions = []; |
| 1132 | 1132 | |
| 1133 | 1133 | if ($join->conditionalExpression) { |
| 1134 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
| 1134 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
| 1135 | 1135 | } |
| 1136 | 1136 | |
| 1137 | 1137 | $condExprConjunction = ($class->isInheritanceTypeJoined() && $joinType != AST\Join::JOIN_TYPE_LEFT && $joinType != AST\Join::JOIN_TYPE_LEFTOUTER) |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | } |
| 1156 | 1156 | |
| 1157 | 1157 | if ($conditions) { |
| 1158 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
| 1158 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
| 1159 | 1159 | } |
| 1160 | 1160 | |
| 1161 | 1161 | break; |
@@ -1212,7 +1212,7 @@ discard block |
||
| 1212 | 1212 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
| 1213 | 1213 | } |
| 1214 | 1214 | |
| 1215 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
| 1215 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
| 1216 | 1216 | |
| 1217 | 1217 | return $sql; |
| 1218 | 1218 | } |
@@ -1234,7 +1234,7 @@ discard block |
||
| 1234 | 1234 | ? $this->conn->quote($nullIfExpression->secondExpression) |
| 1235 | 1235 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
| 1236 | 1236 | |
| 1237 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
| 1237 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
| 1238 | 1238 | } |
| 1239 | 1239 | |
| 1240 | 1240 | /** |
@@ -1249,11 +1249,11 @@ discard block |
||
| 1249 | 1249 | $sql = 'CASE'; |
| 1250 | 1250 | |
| 1251 | 1251 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
| 1252 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1253 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1252 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1253 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1254 | 1254 | } |
| 1255 | 1255 | |
| 1256 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
| 1256 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
| 1257 | 1257 | |
| 1258 | 1258 | return $sql; |
| 1259 | 1259 | } |
@@ -1267,14 +1267,14 @@ discard block |
||
| 1267 | 1267 | */ |
| 1268 | 1268 | public function walkSimpleCaseExpression($simpleCaseExpression) |
| 1269 | 1269 | { |
| 1270 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1270 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1271 | 1271 | |
| 1272 | 1272 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
| 1273 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1274 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1273 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1274 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1275 | 1275 | } |
| 1276 | 1276 | |
| 1277 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
| 1277 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
| 1278 | 1278 | |
| 1279 | 1279 | return $sql; |
| 1280 | 1280 | } |
@@ -1308,14 +1308,14 @@ discard block |
||
| 1308 | 1308 | $fieldMapping = $class->fieldMappings[$fieldName]; |
| 1309 | 1309 | $columnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
| 1310 | 1310 | $columnAlias = $this->getSQLColumnAlias($fieldMapping['columnName']); |
| 1311 | - $col = $sqlTableAlias . '.' . $columnName; |
|
| 1311 | + $col = $sqlTableAlias.'.'.$columnName; |
|
| 1312 | 1312 | |
| 1313 | 1313 | if (isset($fieldMapping['requireSQLConversion'])) { |
| 1314 | 1314 | $type = Type::getType($fieldMapping['type']); |
| 1315 | 1315 | $col = $type->convertToPHPValueSQL($col, $this->conn->getDatabasePlatform()); |
| 1316 | 1316 | } |
| 1317 | 1317 | |
| 1318 | - $sql .= $col . ' AS ' . $columnAlias; |
|
| 1318 | + $sql .= $col.' AS '.$columnAlias; |
|
| 1319 | 1319 | |
| 1320 | 1320 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1321 | 1321 | |
@@ -1340,7 +1340,7 @@ discard block |
||
| 1340 | 1340 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
| 1341 | 1341 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1342 | 1342 | |
| 1343 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1343 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1344 | 1344 | |
| 1345 | 1345 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1346 | 1346 | |
@@ -1354,7 +1354,7 @@ discard block |
||
| 1354 | 1354 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
| 1355 | 1355 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1356 | 1356 | |
| 1357 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1357 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1358 | 1358 | |
| 1359 | 1359 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1360 | 1360 | |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | break; |
| 1366 | 1366 | |
| 1367 | 1367 | case ($expr instanceof AST\NewObjectExpression): |
| 1368 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
| 1368 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
| 1369 | 1369 | break; |
| 1370 | 1370 | |
| 1371 | 1371 | default: |
@@ -1406,14 +1406,14 @@ discard block |
||
| 1406 | 1406 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
| 1407 | 1407 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $class, $this->platform); |
| 1408 | 1408 | |
| 1409 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
| 1409 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
| 1410 | 1410 | |
| 1411 | 1411 | if (isset($mapping['requireSQLConversion'])) { |
| 1412 | 1412 | $type = Type::getType($mapping['type']); |
| 1413 | 1413 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
| 1414 | 1414 | } |
| 1415 | 1415 | |
| 1416 | - $sqlParts[] = $col . ' AS '. $columnAlias; |
|
| 1416 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
| 1417 | 1417 | |
| 1418 | 1418 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
| 1419 | 1419 | |
@@ -1430,21 +1430,21 @@ discard block |
||
| 1430 | 1430 | $sqlTableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
| 1431 | 1431 | |
| 1432 | 1432 | foreach ($subClass->fieldMappings as $fieldName => $mapping) { |
| 1433 | - if (isset($mapping['inherited']) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
| 1433 | + if (isset($mapping['inherited']) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
| 1434 | 1434 | continue; |
| 1435 | 1435 | } |
| 1436 | 1436 | |
| 1437 | 1437 | $columnAlias = $this->getSQLColumnAlias($mapping['columnName']); |
| 1438 | 1438 | $quotedColumnName = $this->quoteStrategy->getColumnName($fieldName, $subClass, $this->platform); |
| 1439 | 1439 | |
| 1440 | - $col = $sqlTableAlias . '.' . $quotedColumnName; |
|
| 1440 | + $col = $sqlTableAlias.'.'.$quotedColumnName; |
|
| 1441 | 1441 | |
| 1442 | 1442 | if (isset($mapping['requireSQLConversion'])) { |
| 1443 | 1443 | $type = Type::getType($mapping['type']); |
| 1444 | 1444 | $col = $type->convertToPHPValueSQL($col, $this->platform); |
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | - $sqlParts[] = $col . ' AS ' . $columnAlias; |
|
| 1447 | + $sqlParts[] = $col.' AS '.$columnAlias; |
|
| 1448 | 1448 | |
| 1449 | 1449 | $this->scalarResultAliasMap[$resultAlias][] = $columnAlias; |
| 1450 | 1450 | |
@@ -1464,7 +1464,7 @@ discard block |
||
| 1464 | 1464 | */ |
| 1465 | 1465 | public function walkQuantifiedExpression($qExpr) |
| 1466 | 1466 | { |
| 1467 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
| 1467 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
| 1468 | 1468 | } |
| 1469 | 1469 | |
| 1470 | 1470 | /** |
@@ -1504,7 +1504,7 @@ discard block |
||
| 1504 | 1504 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
| 1505 | 1505 | } |
| 1506 | 1506 | |
| 1507 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 1507 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 1508 | 1508 | } |
| 1509 | 1509 | |
| 1510 | 1510 | /** |
@@ -1512,7 +1512,7 @@ discard block |
||
| 1512 | 1512 | */ |
| 1513 | 1513 | public function walkSimpleSelectClause($simpleSelectClause) |
| 1514 | 1514 | { |
| 1515 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1515 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1516 | 1516 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
| 1517 | 1517 | } |
| 1518 | 1518 | |
@@ -1531,10 +1531,10 @@ discard block |
||
| 1531 | 1531 | * |
| 1532 | 1532 | * @return string The SQL. |
| 1533 | 1533 | */ |
| 1534 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
| 1534 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
| 1535 | 1535 | { |
| 1536 | 1536 | $sqlSelectExpressions = []; |
| 1537 | - $objIndex = $newObjectResultAlias?:$this->newObjectCounter++; |
|
| 1537 | + $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
|
| 1538 | 1538 | |
| 1539 | 1539 | foreach ($newObjectExpression->args as $argIndex => $e) { |
| 1540 | 1540 | $resultAlias = $this->scalarResultCounter++; |
@@ -1547,7 +1547,7 @@ discard block |
||
| 1547 | 1547 | break; |
| 1548 | 1548 | |
| 1549 | 1549 | case ($e instanceof AST\Subselect): |
| 1550 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
| 1550 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
| 1551 | 1551 | break; |
| 1552 | 1552 | |
| 1553 | 1553 | case ($e instanceof AST\PathExpression): |
@@ -1556,7 +1556,7 @@ discard block |
||
| 1556 | 1556 | $class = $qComp['metadata']; |
| 1557 | 1557 | $fieldType = $class->fieldMappings[$e->field]['type']; |
| 1558 | 1558 | |
| 1559 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1559 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
| 1560 | 1560 | break; |
| 1561 | 1561 | |
| 1562 | 1562 | case ($e instanceof AST\Literal): |
@@ -1570,11 +1570,11 @@ discard block |
||
| 1570 | 1570 | break; |
| 1571 | 1571 | } |
| 1572 | 1572 | |
| 1573 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1573 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
| 1574 | 1574 | break; |
| 1575 | 1575 | |
| 1576 | 1576 | default: |
| 1577 | - $sqlSelectExpressions[] = trim($e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1577 | + $sqlSelectExpressions[] = trim($e->dispatch($this)).' AS '.$columnAlias; |
|
| 1578 | 1578 | break; |
| 1579 | 1579 | } |
| 1580 | 1580 | |
@@ -1607,16 +1607,16 @@ discard block |
||
| 1607 | 1607 | case ($expr instanceof AST\AggregateExpression): |
| 1608 | 1608 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1609 | 1609 | |
| 1610 | - $sql .= $this->walkAggregateExpression($expr) . ' AS dctrn__' . $alias; |
|
| 1610 | + $sql .= $this->walkAggregateExpression($expr).' AS dctrn__'.$alias; |
|
| 1611 | 1611 | break; |
| 1612 | 1612 | |
| 1613 | 1613 | case ($expr instanceof AST\Subselect): |
| 1614 | 1614 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1615 | 1615 | |
| 1616 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
| 1616 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
| 1617 | 1617 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1618 | 1618 | |
| 1619 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1619 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1620 | 1620 | break; |
| 1621 | 1621 | |
| 1622 | 1622 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1633,7 +1633,7 @@ discard block |
||
| 1633 | 1633 | $columnAlias = $this->getSQLColumnAlias('sclr'); |
| 1634 | 1634 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1635 | 1635 | |
| 1636 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1636 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1637 | 1637 | break; |
| 1638 | 1638 | |
| 1639 | 1639 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1653,8 +1653,8 @@ discard block |
||
| 1653 | 1653 | */ |
| 1654 | 1654 | public function walkAggregateExpression($aggExpression) |
| 1655 | 1655 | { |
| 1656 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1657 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
| 1656 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1657 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | 1660 | /** |
@@ -1668,7 +1668,7 @@ discard block |
||
| 1668 | 1668 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
| 1669 | 1669 | } |
| 1670 | 1670 | |
| 1671 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
| 1671 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
| 1672 | 1672 | } |
| 1673 | 1673 | |
| 1674 | 1674 | /** |
@@ -1725,7 +1725,7 @@ discard block |
||
| 1725 | 1725 | { |
| 1726 | 1726 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
| 1727 | 1727 | $tableName = $class->getTableName(); |
| 1728 | - $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
| 1728 | + $sql = 'DELETE FROM '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
| 1729 | 1729 | |
| 1730 | 1730 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
| 1731 | 1731 | $this->rootAliases[] = $deleteClause->aliasIdentificationVariable; |
@@ -1740,12 +1740,12 @@ discard block |
||
| 1740 | 1740 | { |
| 1741 | 1741 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
| 1742 | 1742 | $tableName = $class->getTableName(); |
| 1743 | - $sql = 'UPDATE ' . $this->quoteStrategy->getTableName($class, $this->platform); |
|
| 1743 | + $sql = 'UPDATE '.$this->quoteStrategy->getTableName($class, $this->platform); |
|
| 1744 | 1744 | |
| 1745 | 1745 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
| 1746 | 1746 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
| 1747 | 1747 | |
| 1748 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1748 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1749 | 1749 | |
| 1750 | 1750 | return $sql; |
| 1751 | 1751 | } |
@@ -1758,7 +1758,7 @@ discard block |
||
| 1758 | 1758 | $useTableAliasesBefore = $this->useSqlTableAliases; |
| 1759 | 1759 | $this->useSqlTableAliases = false; |
| 1760 | 1760 | |
| 1761 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
| 1761 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
| 1762 | 1762 | $newValue = $updateItem->newValue; |
| 1763 | 1763 | |
| 1764 | 1764 | switch (true) { |
@@ -1801,7 +1801,7 @@ discard block |
||
| 1801 | 1801 | |
| 1802 | 1802 | if (count($filterClauses)) { |
| 1803 | 1803 | if ($condSql) { |
| 1804 | - $condSql = '(' . $condSql . ') AND '; |
|
| 1804 | + $condSql = '('.$condSql.') AND '; |
|
| 1805 | 1805 | } |
| 1806 | 1806 | |
| 1807 | 1807 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1809,11 +1809,11 @@ discard block |
||
| 1809 | 1809 | } |
| 1810 | 1810 | |
| 1811 | 1811 | if ($condSql) { |
| 1812 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
| 1812 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
| 1813 | 1813 | } |
| 1814 | 1814 | |
| 1815 | 1815 | if ($discrSql) { |
| 1816 | - return ' WHERE ' . $discrSql; |
|
| 1816 | + return ' WHERE '.$discrSql; |
|
| 1817 | 1817 | } |
| 1818 | 1818 | |
| 1819 | 1819 | return ''; |
@@ -1856,7 +1856,7 @@ discard block |
||
| 1856 | 1856 | // if only one ConditionalPrimary is defined |
| 1857 | 1857 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
| 1858 | 1858 | ? $this->walkConditionalPrimary($factor) |
| 1859 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1859 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1860 | 1860 | } |
| 1861 | 1861 | |
| 1862 | 1862 | /** |
@@ -1871,7 +1871,7 @@ discard block |
||
| 1871 | 1871 | if ($primary->isConditionalExpression()) { |
| 1872 | 1872 | $condExpr = $primary->conditionalExpression; |
| 1873 | 1873 | |
| 1874 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
| 1874 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
| 1875 | 1875 | } |
| 1876 | 1876 | } |
| 1877 | 1877 | |
@@ -1882,7 +1882,7 @@ discard block |
||
| 1882 | 1882 | { |
| 1883 | 1883 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
| 1884 | 1884 | |
| 1885 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
| 1885 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
| 1886 | 1886 | |
| 1887 | 1887 | return $sql; |
| 1888 | 1888 | } |
@@ -1926,7 +1926,7 @@ discard block |
||
| 1926 | 1926 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
| 1927 | 1927 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1928 | 1928 | |
| 1929 | - $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' WHERE '; |
|
| 1929 | + $sql .= $this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' WHERE '; |
|
| 1930 | 1930 | |
| 1931 | 1931 | $owningAssoc = $targetClass->associationMappings[$assoc['mappedBy']]; |
| 1932 | 1932 | $sqlParts = []; |
@@ -1934,7 +1934,7 @@ discard block |
||
| 1934 | 1934 | foreach ($owningAssoc['targetToSourceKeyColumns'] as $targetColumn => $sourceColumn) { |
| 1935 | 1935 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$targetColumn], $class, $this->platform); |
| 1936 | 1936 | |
| 1937 | - $sqlParts[] = $sourceTableAlias . '.' . $targetColumn . ' = ' . $targetTableAlias . '.' . $sourceColumn; |
|
| 1937 | + $sqlParts[] = $sourceTableAlias.'.'.$targetColumn.' = '.$targetTableAlias.'.'.$sourceColumn; |
|
| 1938 | 1938 | } |
| 1939 | 1939 | |
| 1940 | 1940 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 1943 | 1943 | } |
| 1944 | 1944 | |
| 1945 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' = ' . $entitySql; |
|
| 1945 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' = '.$entitySql; |
|
| 1946 | 1946 | } |
| 1947 | 1947 | |
| 1948 | 1948 | $sql .= implode(' AND ', $sqlParts); |
@@ -1958,8 +1958,8 @@ discard block |
||
| 1958 | 1958 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1959 | 1959 | |
| 1960 | 1960 | // join to target table |
| 1961 | - $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform) . ' ' . $joinTableAlias |
|
| 1962 | - . ' INNER JOIN ' . $this->quoteStrategy->getTableName($targetClass, $this->platform) . ' ' . $targetTableAlias . ' ON '; |
|
| 1961 | + $sql .= $this->quoteStrategy->getJoinTableName($owningAssoc, $targetClass, $this->platform).' '.$joinTableAlias |
|
| 1962 | + . ' INNER JOIN '.$this->quoteStrategy->getTableName($targetClass, $this->platform).' '.$targetTableAlias.' ON '; |
|
| 1963 | 1963 | |
| 1964 | 1964 | // join conditions |
| 1965 | 1965 | $joinColumns = $assoc['isOwningSide'] ? $joinTable['inverseJoinColumns'] : $joinTable['joinColumns']; |
@@ -1968,7 +1968,7 @@ discard block |
||
| 1968 | 1968 | foreach ($joinColumns as $joinColumn) { |
| 1969 | 1969 | $targetColumn = $this->quoteStrategy->getColumnName($targetClass->fieldNames[$joinColumn['referencedColumnName']], $targetClass, $this->platform); |
| 1970 | 1970 | |
| 1971 | - $joinSqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $targetTableAlias . '.' . $targetColumn; |
|
| 1971 | + $joinSqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$targetTableAlias.'.'.$targetColumn; |
|
| 1972 | 1972 | } |
| 1973 | 1973 | |
| 1974 | 1974 | $sql .= implode(' AND ', $joinSqlParts); |
@@ -1980,7 +1980,7 @@ discard block |
||
| 1980 | 1980 | foreach ($joinColumns as $joinColumn) { |
| 1981 | 1981 | $targetColumn = $this->quoteStrategy->getColumnName($class->fieldNames[$joinColumn['referencedColumnName']], $class, $this->platform); |
| 1982 | 1982 | |
| 1983 | - $sqlParts[] = $joinTableAlias . '.' . $joinColumn['name'] . ' = ' . $sourceTableAlias . '.' . $targetColumn; |
|
| 1983 | + $sqlParts[] = $joinTableAlias.'.'.$joinColumn['name'].' = '.$sourceTableAlias.'.'.$targetColumn; |
|
| 1984 | 1984 | } |
| 1985 | 1985 | |
| 1986 | 1986 | foreach ($this->quoteStrategy->getIdentifierColumnNames($targetClass, $this->platform) as $targetColumnName) { |
@@ -1988,13 +1988,13 @@ discard block |
||
| 1988 | 1988 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 1989 | 1989 | } |
| 1990 | 1990 | |
| 1991 | - $sqlParts[] = $targetTableAlias . '.' . $targetColumnName . ' IN (' . $entitySql . ')'; |
|
| 1991 | + $sqlParts[] = $targetTableAlias.'.'.$targetColumnName.' IN ('.$entitySql.')'; |
|
| 1992 | 1992 | } |
| 1993 | 1993 | |
| 1994 | 1994 | $sql .= implode(' AND ', $sqlParts); |
| 1995 | 1995 | } |
| 1996 | 1996 | |
| 1997 | - return $sql . ')'; |
|
| 1997 | + return $sql.')'; |
|
| 1998 | 1998 | } |
| 1999 | 1999 | |
| 2000 | 2000 | /** |
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
| 2006 | 2006 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
| 2007 | 2007 | |
| 2008 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2008 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2009 | 2009 | } |
| 2010 | 2010 | |
| 2011 | 2011 | /** |
@@ -2014,19 +2014,19 @@ discard block |
||
| 2014 | 2014 | public function walkNullComparisonExpression($nullCompExpr) |
| 2015 | 2015 | { |
| 2016 | 2016 | $expression = $nullCompExpr->expression; |
| 2017 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
| 2017 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
| 2018 | 2018 | |
| 2019 | 2019 | // Handle ResultVariable |
| 2020 | 2020 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
| 2021 | - return $this->walkResultVariable($expression) . $comparison; |
|
| 2021 | + return $this->walkResultVariable($expression).$comparison; |
|
| 2022 | 2022 | } |
| 2023 | 2023 | |
| 2024 | 2024 | // Handle InputParameter mapping inclusion to ParserResult |
| 2025 | 2025 | if ($expression instanceof AST\InputParameter) { |
| 2026 | - return $this->walkInputParameter($expression) . $comparison; |
|
| 2026 | + return $this->walkInputParameter($expression).$comparison; |
|
| 2027 | 2027 | } |
| 2028 | 2028 | |
| 2029 | - return $expression->dispatch($this) . $comparison; |
|
| 2029 | + return $expression->dispatch($this).$comparison; |
|
| 2030 | 2030 | } |
| 2031 | 2031 | |
| 2032 | 2032 | /** |
@@ -2034,7 +2034,7 @@ discard block |
||
| 2034 | 2034 | */ |
| 2035 | 2035 | public function walkInExpression($inExpr) |
| 2036 | 2036 | { |
| 2037 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
| 2037 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
| 2038 | 2038 | |
| 2039 | 2039 | $sql .= ($inExpr->subselect) |
| 2040 | 2040 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2060,10 +2060,10 @@ discard block |
||
| 2060 | 2060 | } |
| 2061 | 2061 | |
| 2062 | 2062 | if ($this->useSqlTableAliases) { |
| 2063 | - $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias) . '.'; |
|
| 2063 | + $sql .= $this->getSQLTableAlias($discrClass->getTableName(), $dqlAlias).'.'; |
|
| 2064 | 2064 | } |
| 2065 | 2065 | |
| 2066 | - $sql .= $class->discriminatorColumn['name'] . ($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
| 2066 | + $sql .= $class->discriminatorColumn['name'].($instanceOfExpr->not ? ' NOT IN ' : ' IN '); |
|
| 2067 | 2067 | |
| 2068 | 2068 | $sqlParameterList = []; |
| 2069 | 2069 | |
@@ -2093,7 +2093,7 @@ discard block |
||
| 2093 | 2093 | $sqlParameterList[] = $this->conn->quote($discriminatorValue); |
| 2094 | 2094 | } |
| 2095 | 2095 | |
| 2096 | - $sql .= '(' . implode(', ', $sqlParameterList) . ')'; |
|
| 2096 | + $sql .= '('.implode(', ', $sqlParameterList).')'; |
|
| 2097 | 2097 | |
| 2098 | 2098 | return $sql; |
| 2099 | 2099 | } |
@@ -2139,8 +2139,8 @@ discard block |
||
| 2139 | 2139 | $sql .= ' NOT'; |
| 2140 | 2140 | } |
| 2141 | 2141 | |
| 2142 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2143 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2142 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2143 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2144 | 2144 | |
| 2145 | 2145 | return $sql; |
| 2146 | 2146 | } |
@@ -2155,7 +2155,7 @@ discard block |
||
| 2155 | 2155 | ? $this->walkResultVariable($stringExpr) |
| 2156 | 2156 | : $stringExpr->dispatch($this); |
| 2157 | 2157 | |
| 2158 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
| 2158 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
| 2159 | 2159 | |
| 2160 | 2160 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
| 2161 | 2161 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2168,7 +2168,7 @@ discard block |
||
| 2168 | 2168 | } |
| 2169 | 2169 | |
| 2170 | 2170 | if ($likeExpr->escapeChar) { |
| 2171 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
| 2171 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
| 2172 | 2172 | } |
| 2173 | 2173 | |
| 2174 | 2174 | return $sql; |
@@ -2195,7 +2195,7 @@ discard block |
||
| 2195 | 2195 | ? $leftExpr->dispatch($this) |
| 2196 | 2196 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
| 2197 | 2197 | |
| 2198 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
| 2198 | + $sql .= ' '.$compExpr->operator.' '; |
|
| 2199 | 2199 | |
| 2200 | 2200 | $sql .= ($rightExpr instanceof AST\Node) |
| 2201 | 2201 | ? $rightExpr->dispatch($this) |
@@ -2227,7 +2227,7 @@ discard block |
||
| 2227 | 2227 | { |
| 2228 | 2228 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
| 2229 | 2229 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
| 2230 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
| 2230 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
| 2231 | 2231 | } |
| 2232 | 2232 | |
| 2233 | 2233 | /** |
@@ -2281,7 +2281,7 @@ discard block |
||
| 2281 | 2281 | |
| 2282 | 2282 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
| 2283 | 2283 | |
| 2284 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2284 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2285 | 2285 | } |
| 2286 | 2286 | |
| 2287 | 2287 | /** |
@@ -2294,7 +2294,7 @@ discard block |
||
| 2294 | 2294 | public function walkArithmeticPrimary($primary) |
| 2295 | 2295 | { |
| 2296 | 2296 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
| 2297 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
| 2297 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
| 2298 | 2298 | } |
| 2299 | 2299 | |
| 2300 | 2300 | if ($primary instanceof AST\Node) { |
@@ -444,7 +444,9 @@ discard block |
||
| 444 | 444 | foreach ($dqlAliases as $dqlAlias) { |
| 445 | 445 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
| 446 | 446 | |
| 447 | - if ( ! $class->isInheritanceTypeSingleTable()) continue; |
|
| 447 | + if ( ! $class->isInheritanceTypeSingleTable()) { |
|
| 448 | + continue; |
|
| 449 | + } |
|
| 448 | 450 | |
| 449 | 451 | $conn = $this->em->getConnection(); |
| 450 | 452 | $values = []; |
@@ -782,7 +784,9 @@ discard block |
||
| 782 | 784 | |
| 783 | 785 | foreach ($subClass->associationMappings as $assoc) { |
| 784 | 786 | // Skip if association is inherited |
| 785 | - if (isset($assoc['inherited'])) continue; |
|
| 787 | + if (isset($assoc['inherited'])) { |
|
| 788 | + continue; |
|
| 789 | + } |
|
| 786 | 790 | |
| 787 | 791 | if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) { |
| 788 | 792 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
@@ -21,7 +21,6 @@ |
||
| 21 | 21 | |
| 22 | 22 | use Doctrine\Common\Collections\ArrayCollection; |
| 23 | 23 | use Doctrine\Common\Collections\Criteria; |
| 24 | - |
|
| 25 | 24 | use Doctrine\ORM\Query\Expr; |
| 26 | 25 | use Doctrine\ORM\Query\QueryExpressionVisitor; |
| 27 | 26 | |
@@ -606,7 +606,7 @@ discard block |
||
| 606 | 606 | /** |
| 607 | 607 | * Gets a (previously set) query parameter of the query being constructed. |
| 608 | 608 | * |
| 609 | - * @param mixed $key The key (index or name) of the bound parameter. |
|
| 609 | + * @param string $key The key (index or name) of the bound parameter. |
|
| 610 | 610 | * |
| 611 | 611 | * @return Query\Parameter|null The value of the bound parameter. |
| 612 | 612 | */ |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | * ->leftJoin('u.Phonenumbers', 'p'); |
| 795 | 795 | * </code> |
| 796 | 796 | * |
| 797 | - * @param mixed $select The selection expression. |
|
| 797 | + * @param string $select The selection expression. |
|
| 798 | 798 | * |
| 799 | 799 | * @return self |
| 800 | 800 | */ |
@@ -1094,7 +1094,6 @@ discard block |
||
| 1094 | 1094 | * ->andWhere('u.is_active = 1'); |
| 1095 | 1095 | * </code> |
| 1096 | 1096 | * |
| 1097 | - * @param mixed $where The query restrictions. |
|
| 1098 | 1097 | * |
| 1099 | 1098 | * @return self |
| 1100 | 1099 | * |
@@ -1127,7 +1126,6 @@ discard block |
||
| 1127 | 1126 | * ->orWhere('u.id = 2'); |
| 1128 | 1127 | * </code> |
| 1129 | 1128 | * |
| 1130 | - * @param mixed $where The WHERE statement. |
|
| 1131 | 1129 | * |
| 1132 | 1130 | * @return self |
| 1133 | 1131 | * |
@@ -1192,7 +1190,7 @@ discard block |
||
| 1192 | 1190 | * Specifies a restriction over the groups of the query. |
| 1193 | 1191 | * Replaces any previous having restrictions, if any. |
| 1194 | 1192 | * |
| 1195 | - * @param mixed $having The restriction over the groups. |
|
| 1193 | + * @param string $having The restriction over the groups. |
|
| 1196 | 1194 | * |
| 1197 | 1195 | * @return self |
| 1198 | 1196 | */ |
@@ -1209,7 +1207,7 @@ discard block |
||
| 1209 | 1207 | * Adds a restriction over the groups of the query, forming a logical |
| 1210 | 1208 | * conjunction with any existing having restrictions. |
| 1211 | 1209 | * |
| 1212 | - * @param mixed $having The restriction to append. |
|
| 1210 | + * @param string $having The restriction to append. |
|
| 1213 | 1211 | * |
| 1214 | 1212 | * @return self |
| 1215 | 1213 | */ |
@@ -1232,7 +1230,7 @@ discard block |
||
| 1232 | 1230 | * Adds a restriction over the groups of the query, forming a logical |
| 1233 | 1231 | * disjunction with any existing having restrictions. |
| 1234 | 1232 | * |
| 1235 | - * @param mixed $having The restriction to add. |
|
| 1233 | + * @param string $having The restriction to add. |
|
| 1236 | 1234 | * |
| 1237 | 1235 | * @return self |
| 1238 | 1236 | */ |
@@ -1451,7 +1449,7 @@ discard block |
||
| 1451 | 1449 | /** |
| 1452 | 1450 | * Resets DQL parts. |
| 1453 | 1451 | * |
| 1454 | - * @param array|null $parts |
|
| 1452 | + * @param string[] $parts |
|
| 1455 | 1453 | * |
| 1456 | 1454 | * @return self |
| 1457 | 1455 | */ |
@@ -118,11 +118,11 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | private $joinRootAliases = []; |
| 120 | 120 | |
| 121 | - /** |
|
| 122 | - * Whether to use second level cache, if available. |
|
| 123 | - * |
|
| 124 | - * @var boolean |
|
| 125 | - */ |
|
| 121 | + /** |
|
| 122 | + * Whether to use second level cache, if available. |
|
| 123 | + * |
|
| 124 | + * @var boolean |
|
| 125 | + */ |
|
| 126 | 126 | protected $cacheable = false; |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -213,10 +213,10 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | - * Obtain the name of the second level query cache region in which query results will be stored |
|
| 217 | - * |
|
| 218 | - * @return string|null The cache region name; NULL indicates the default region. |
|
| 219 | - */ |
|
| 216 | + * Obtain the name of the second level query cache region in which query results will be stored |
|
| 217 | + * |
|
| 218 | + * @return string|null The cache region name; NULL indicates the default region. |
|
| 219 | + */ |
|
| 220 | 220 | public function getCacheRegion() |
| 221 | 221 | { |
| 222 | 222 | return $this->cacheRegion; |
@@ -1373,10 +1373,10 @@ discard block |
||
| 1373 | 1373 | */ |
| 1374 | 1374 | private function _getDQLForDelete() |
| 1375 | 1375 | { |
| 1376 | - return 'DELETE' |
|
| 1377 | - . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
| 1378 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1379 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1376 | + return 'DELETE' |
|
| 1377 | + . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
| 1378 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1379 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1380 | 1380 | } |
| 1381 | 1381 | |
| 1382 | 1382 | /** |
@@ -1384,11 +1384,11 @@ discard block |
||
| 1384 | 1384 | */ |
| 1385 | 1385 | private function _getDQLForUpdate() |
| 1386 | 1386 | { |
| 1387 | - return 'UPDATE' |
|
| 1388 | - . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
| 1389 | - . $this->_getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
| 1390 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1391 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1387 | + return 'UPDATE' |
|
| 1388 | + . $this->_getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
| 1389 | + . $this->_getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
| 1390 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1391 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1392 | 1392 | } |
| 1393 | 1393 | |
| 1394 | 1394 | /** |
@@ -1397,8 +1397,8 @@ discard block |
||
| 1397 | 1397 | private function _getDQLForSelect() |
| 1398 | 1398 | { |
| 1399 | 1399 | $dql = 'SELECT' |
| 1400 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
| 1401 | - . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
| 1400 | + . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
| 1401 | + . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
| 1402 | 1402 | |
| 1403 | 1403 | $fromParts = $this->getDQLPart('from'); |
| 1404 | 1404 | $joinParts = $this->getDQLPart('join'); |
@@ -1422,10 +1422,10 @@ discard block |
||
| 1422 | 1422 | } |
| 1423 | 1423 | |
| 1424 | 1424 | $dql .= implode(', ', $fromClauses) |
| 1425 | - . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1426 | - . $this->_getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
| 1427 | - . $this->_getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
| 1428 | - . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1425 | + . $this->_getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
| 1426 | + . $this->_getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
| 1427 | + . $this->_getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
| 1428 | + . $this->_getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
| 1429 | 1429 | |
| 1430 | 1430 | return $dql; |
| 1431 | 1431 | } |
@@ -1445,8 +1445,8 @@ discard block |
||
| 1445 | 1445 | } |
| 1446 | 1446 | |
| 1447 | 1447 | return (isset($options['pre']) ? $options['pre'] : '') |
| 1448 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
| 1449 | - . (isset($options['post']) ? $options['post'] : ''); |
|
| 1448 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
| 1449 | + . (isset($options['post']) ? $options['post'] : ''); |
|
| 1450 | 1450 | } |
| 1451 | 1451 | |
| 1452 | 1452 | /** |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | public function setParameter($key, $value, $type = null) |
| 534 | 534 | { |
| 535 | 535 | $filteredParameters = $this->parameters->filter( |
| 536 | - function ($parameter) use ($key) |
|
| 536 | + function($parameter) use ($key) |
|
| 537 | 537 | { |
| 538 | 538 | /* @var Query\Parameter $parameter */ |
| 539 | 539 | // Must not be identical because of string to integer conversion |
@@ -614,7 +614,7 @@ discard block |
||
| 614 | 614 | public function getParameter($key) |
| 615 | 615 | { |
| 616 | 616 | $filteredParameters = $this->parameters->filter( |
| 617 | - function ($parameter) use ($key) |
|
| 617 | + function($parameter) use ($key) |
|
| 618 | 618 | { |
| 619 | 619 | /* @var Query\Parameter $parameter */ |
| 620 | 620 | // Must not be identical because of string to integer conversion |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | $isMultiple = is_array($this->_dqlParts[$dqlPartName]) |
| 700 | - && !($dqlPartName == 'join' && !$append); |
|
| 700 | + && ! ($dqlPartName == 'join' && ! $append); |
|
| 701 | 701 | |
| 702 | 702 | // Allow adding any part retrieved from self::getDQLParts(). |
| 703 | 703 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | { |
| 915 | 915 | $rootAliases = $this->getRootAliases(); |
| 916 | 916 | |
| 917 | - if (!in_array($alias, $rootAliases)) { |
|
| 917 | + if ( ! in_array($alias, $rootAliases)) { |
|
| 918 | 918 | throw new Query\QueryException( |
| 919 | 919 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
| 920 | 920 | ); |
@@ -1316,15 +1316,15 @@ discard block |
||
| 1316 | 1316 | foreach ($criteria->getOrderings() as $sort => $order) { |
| 1317 | 1317 | |
| 1318 | 1318 | $hasValidAlias = false; |
| 1319 | - foreach($allAliases as $alias) { |
|
| 1320 | - if(strpos($sort . '.', $alias . '.') === 0) { |
|
| 1319 | + foreach ($allAliases as $alias) { |
|
| 1320 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
| 1321 | 1321 | $hasValidAlias = true; |
| 1322 | 1322 | break; |
| 1323 | 1323 | } |
| 1324 | 1324 | } |
| 1325 | 1325 | |
| 1326 | - if(!$hasValidAlias) { |
|
| 1327 | - $sort = $allAliases[0] . '.' . $sort; |
|
| 1326 | + if ( ! $hasValidAlias) { |
|
| 1327 | + $sort = $allAliases[0].'.'.$sort; |
|
| 1328 | 1328 | } |
| 1329 | 1329 | |
| 1330 | 1330 | $this->addOrderBy($sort, $order); |
@@ -1397,7 +1397,7 @@ discard block |
||
| 1397 | 1397 | private function _getDQLForSelect() |
| 1398 | 1398 | { |
| 1399 | 1399 | $dql = 'SELECT' |
| 1400 | - . ($this->_dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
| 1400 | + . ($this->_dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
| 1401 | 1401 | . $this->_getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
| 1402 | 1402 | |
| 1403 | 1403 | $fromParts = $this->getDQLPart('from'); |
@@ -1413,7 +1413,7 @@ discard block |
||
| 1413 | 1413 | |
| 1414 | 1414 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
| 1415 | 1415 | foreach ($joinParts[$from->getAlias()] as $join) { |
| 1416 | - $fromClause .= ' ' . ((string) $join); |
|
| 1416 | + $fromClause .= ' '.((string) $join); |
|
| 1417 | 1417 | } |
| 1418 | 1418 | } |
| 1419 | 1419 | |