@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * A query object is in CLEAN state when it has NO unparsed/unprocessed DQL parts. |
28 | 28 | */ |
29 | - const STATE_CLEAN = 1; |
|
29 | + const STATE_CLEAN = 1; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * A query object is in state DIRTY when it has DQL parts that have not yet been |
@@ -717,11 +717,11 @@ discard block |
||
717 | 717 | ->getName(); |
718 | 718 | |
719 | 719 | return md5( |
720 | - $this->getDQL() . serialize($this->hints) . |
|
721 | - '&platform=' . $platform . |
|
722 | - ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : '') . |
|
723 | - '&firstResult=' . $this->firstResult . '&maxResult=' . $this->maxResults . |
|
724 | - '&hydrationMode=' . $this->hydrationMode . '&types=' . serialize($this->parsedTypes) . 'DOCTRINE_QUERY_CACHE_SALT' |
|
720 | + $this->getDQL().serialize($this->hints). |
|
721 | + '&platform='.$platform. |
|
722 | + ($this->em->hasFilters() ? $this->em->getFilters()->getHash() : ''). |
|
723 | + '&firstResult='.$this->firstResult.'&maxResult='.$this->maxResults. |
|
724 | + '&hydrationMode='.$this->hydrationMode.'&types='.serialize($this->parsedTypes).'DOCTRINE_QUERY_CACHE_SALT' |
|
725 | 725 | ); |
726 | 726 | } |
727 | 727 | |
@@ -730,7 +730,7 @@ discard block |
||
730 | 730 | */ |
731 | 731 | protected function getHash() |
732 | 732 | { |
733 | - return sha1(parent::getHash(). '-'. $this->firstResult . '-' . $this->maxResults); |
|
733 | + return sha1(parent::getHash().'-'.$this->firstResult.'-'.$this->maxResults); |
|
734 | 734 | } |
735 | 735 | |
736 | 736 | /** |
@@ -1,7 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -declare(strict_types=1); |
|
4 | +declare(strict_types = 1); |
|
5 | 5 | |
6 | 6 | namespace Doctrine\ORM\Cache; |
7 | 7 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | foreach ($metadatas as $metadata) { |
207 | 207 | foreach ($metadata->getDeclaredPropertiesIterator() as $association) { |
208 | - if (! $association instanceof ToManyAssociationMetadata) { |
|
208 | + if ( ! $association instanceof ToManyAssociationMetadata) { |
|
209 | 209 | continue; |
210 | 210 | } |
211 | 211 | |
@@ -262,8 +262,7 @@ discard block |
||
262 | 262 | public function getQueryCache($regionName = null) |
263 | 263 | { |
264 | 264 | if ($regionName === null) { |
265 | - return $this->defaultQueryCache ?: |
|
266 | - $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
265 | + return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em); |
|
267 | 266 | } |
268 | 267 | |
269 | 268 | if ( ! isset($this->queryCaches[$regionName])) { |
@@ -281,7 +280,7 @@ discard block |
||
281 | 280 | */ |
282 | 281 | private function buildEntityCacheKey(ClassMetadata $metadata, $identifier) |
283 | 282 | { |
284 | - if (! is_array($identifier)) { |
|
283 | + if ( ! is_array($identifier)) { |
|
285 | 284 | $identifier = $this->toIdentifierArray($metadata, $identifier); |
286 | 285 | } |
287 | 286 | |
@@ -297,7 +296,7 @@ discard block |
||
297 | 296 | */ |
298 | 297 | private function buildCollectionCacheKey(ClassMetadata $metadata, $association, $ownerIdentifier) |
299 | 298 | { |
300 | - if (! is_array($ownerIdentifier)) { |
|
299 | + if ( ! is_array($ownerIdentifier)) { |
|
301 | 300 | $ownerIdentifier = $this->toIdentifierArray($metadata, $ownerIdentifier); |
302 | 301 | } |
303 | 302 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Query; |
6 | 6 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | return new Expr\Orx($expressionList); |
108 | 108 | |
109 | 109 | default: |
110 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
110 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | throw new QueryException('No aliases are set before invoking walkComparison().'); |
121 | 121 | } |
122 | 122 | |
123 | - $field = $this->queryAliases[0] . '.' . $comparison->getField(); |
|
123 | + $field = $this->queryAliases[0].'.'.$comparison->getField(); |
|
124 | 124 | |
125 | 125 | foreach ($this->queryAliases as $alias) { |
126 | - if (strpos($comparison->getField() . '.', $alias . '.') === 0) { |
|
126 | + if (strpos($comparison->getField().'.', $alias.'.') === 0) { |
|
127 | 127 | $field = $comparison->getField(); |
128 | 128 | break; |
129 | 129 | } |
@@ -134,13 +134,13 @@ discard block |
||
134 | 134 | |
135 | 135 | foreach ($this->parameters as $parameter) { |
136 | 136 | if ($parameter->getName() === $parameterName) { |
137 | - $parameterName .= '_' . $parameterCount; |
|
137 | + $parameterName .= '_'.$parameterCount; |
|
138 | 138 | break; |
139 | 139 | } |
140 | 140 | } |
141 | 141 | |
142 | 142 | $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue())); |
143 | - $placeholder = ':' . $parameterName; |
|
143 | + $placeholder = ':'.$parameterName; |
|
144 | 144 | |
145 | 145 | switch ($comparison->getOperator()) { |
146 | 146 | case Comparison::IN: |
@@ -167,17 +167,17 @@ discard block |
||
167 | 167 | |
168 | 168 | return $this->expr->neq($field, $placeholder); |
169 | 169 | case Comparison::CONTAINS: |
170 | - $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType()); |
|
170 | + $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType()); |
|
171 | 171 | $this->parameters[] = $parameter; |
172 | 172 | |
173 | 173 | return $this->expr->like($field, $placeholder); |
174 | 174 | case Comparison::STARTS_WITH: |
175 | - $parameter->setValue($parameter->getValue() . '%', $parameter->getType()); |
|
175 | + $parameter->setValue($parameter->getValue().'%', $parameter->getType()); |
|
176 | 176 | $this->parameters[] = $parameter; |
177 | 177 | |
178 | 178 | return $this->expr->like($field, $placeholder); |
179 | 179 | case Comparison::ENDS_WITH: |
180 | - $parameter->setValue('%' . $parameter->getValue(), $parameter->getType()); |
|
180 | + $parameter->setValue('%'.$parameter->getValue(), $parameter->getType()); |
|
181 | 181 | $this->parameters[] = $parameter; |
182 | 182 | |
183 | 183 | return $this->expr->like($field, $placeholder); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | ); |
194 | 194 | } |
195 | 195 | |
196 | - throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator()); |
|
196 | + throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator()); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Query; |
6 | 6 | |
@@ -272,10 +272,10 @@ discard block |
||
272 | 272 | */ |
273 | 273 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
274 | 274 | { |
275 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
275 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
276 | 276 | |
277 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
278 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
277 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
278 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | return $this->tableAliasMap[$tableName]; |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | */ |
294 | 294 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
295 | 295 | { |
296 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
296 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
297 | 297 | |
298 | 298 | $this->tableAliasMap[$tableName] = $alias; |
299 | 299 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | public function getSQLColumnAlias() |
309 | 309 | { |
310 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
310 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -334,14 +334,14 @@ discard block |
||
334 | 334 | |
335 | 335 | // If this is a joined association we must use left joins to preserve the correct result. |
336 | 336 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
337 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
337 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
338 | 338 | |
339 | 339 | $sqlParts = []; |
340 | 340 | |
341 | 341 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
342 | 342 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
343 | 343 | |
344 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
344 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | // Add filters on the root class |
@@ -363,14 +363,14 @@ discard block |
||
363 | 363 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
364 | 364 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
365 | 365 | |
366 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
366 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
367 | 367 | |
368 | 368 | $sqlParts = []; |
369 | 369 | |
370 | 370 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
371 | 371 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
372 | 372 | |
373 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
373 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
374 | 374 | } |
375 | 375 | |
376 | 376 | $sql .= implode(' AND ', $sqlParts); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $qComp = $this->queryComponents[$dqlAlias]; |
392 | 392 | $association = $qComp['relation']; |
393 | 393 | |
394 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
394 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
395 | 395 | continue; |
396 | 396 | } |
397 | 397 | |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $property = $qComp['metadata']->getProperty($fieldName); |
400 | 400 | $tableName = $property->getTableName(); |
401 | 401 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
402 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
402 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
403 | 403 | |
404 | 404 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
405 | 405 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | } |
408 | 408 | |
409 | 409 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
410 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
410 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
411 | 411 | } |
412 | 412 | } |
413 | 413 | |
@@ -447,19 +447,19 @@ discard block |
||
447 | 447 | $discrColumnType = $discrColumn->getType(); |
448 | 448 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
449 | 449 | $sqlTableAlias = ($this->useSqlTableAliases) |
450 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
450 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
451 | 451 | : ''; |
452 | 452 | |
453 | 453 | $sqlParts[] = sprintf( |
454 | 454 | '%s IN (%s)', |
455 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
455 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
456 | 456 | implode(', ', $values) |
457 | 457 | ); |
458 | 458 | } |
459 | 459 | |
460 | 460 | $sql = implode(' AND ', $sqlParts); |
461 | 461 | |
462 | - return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql; |
|
462 | + return isset($sqlParts[1]) ? '('.$sql.')' : $sql; |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | /** |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | */ |
473 | 473 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
474 | 474 | { |
475 | - if (! $this->em->hasFilters()) { |
|
475 | + if ( ! $this->em->hasFilters()) { |
|
476 | 476 | return ''; |
477 | 477 | } |
478 | 478 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | |
504 | 504 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
505 | 505 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
506 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
506 | + $filterClauses[] = '('.$filterExpr.')'; |
|
507 | 507 | } |
508 | 508 | } |
509 | 509 | |
@@ -535,7 +535,7 @@ discard block |
||
535 | 535 | } |
536 | 536 | |
537 | 537 | if ( ! $AST->orderByClause && ($orderBySql = $this->generateOrderedCollectionOrderByItems())) { |
538 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
538 | + $sql .= ' ORDER BY '.$orderBySql; |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | if ($limit !== null || $offset !== null) { |
@@ -547,11 +547,11 @@ discard block |
||
547 | 547 | } |
548 | 548 | |
549 | 549 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
550 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
550 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
551 | 551 | } |
552 | 552 | |
553 | 553 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
554 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
554 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
555 | 555 | } |
556 | 556 | |
557 | 557 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
609 | 609 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
610 | 610 | |
611 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
611 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | return implode(', ', $sqlParts); |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | { |
627 | 627 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
628 | 628 | |
629 | - if (!$fieldName) { |
|
629 | + if ( ! $fieldName) { |
|
630 | 630 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
631 | 631 | } |
632 | 632 | |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | $property = $class->getProperty($fieldName); |
656 | 656 | |
657 | 657 | if ($this->useSqlTableAliases) { |
658 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
658 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
659 | 659 | } |
660 | 660 | |
661 | 661 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
670 | 670 | $association = $class->getProperty($fieldName); |
671 | 671 | |
672 | - if (! $association->isOwningSide()) { |
|
672 | + if ( ! $association->isOwningSide()) { |
|
673 | 673 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
674 | 674 | } |
675 | 675 | |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | $joinColumn = reset($joinColumns); |
684 | 684 | |
685 | 685 | if ($this->useSqlTableAliases) { |
686 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
686 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
687 | 687 | } |
688 | 688 | |
689 | 689 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | */ |
702 | 702 | public function walkSelectClause($selectClause) |
703 | 703 | { |
704 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
704 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
705 | 705 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
706 | 706 | |
707 | 707 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) { |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | |
745 | 745 | $sqlSelectExpressions[] = sprintf( |
746 | 746 | '%s AS %s', |
747 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
747 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
748 | 748 | $sqlColumnAlias |
749 | 749 | ); |
750 | 750 | |
@@ -754,12 +754,12 @@ discard block |
||
754 | 754 | |
755 | 755 | // Add foreign key columns of class and also parent classes |
756 | 756 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
757 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
757 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
758 | 758 | || ( ! $addMetaColumns && ! $association->isPrimaryKey())) { |
759 | 759 | continue; |
760 | 760 | } |
761 | 761 | |
762 | - $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
762 | + $targetClass = $this->em->getClassMetadata($association->getTargetEntity()); |
|
763 | 763 | |
764 | 764 | foreach ($association->getJoinColumns() as $joinColumn) { |
765 | 765 | /** @var JoinColumnMetadata $joinColumn */ |
@@ -769,7 +769,7 @@ discard block |
||
769 | 769 | $columnAlias = $this->getSQLColumnAlias(); |
770 | 770 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
771 | 771 | |
772 | - if (! $joinColumn->getType()) { |
|
772 | + if ( ! $joinColumn->getType()) { |
|
773 | 773 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
774 | 774 | } |
775 | 775 | |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | continue; |
800 | 800 | } |
801 | 801 | |
802 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
802 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
803 | 803 | continue; |
804 | 804 | } |
805 | 805 | |
@@ -813,7 +813,7 @@ discard block |
||
813 | 813 | $columnAlias = $this->getSQLColumnAlias(); |
814 | 814 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
815 | 815 | |
816 | - if (! $joinColumn->getType()) { |
|
816 | + if ( ! $joinColumn->getType()) { |
|
817 | 817 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
818 | 818 | } |
819 | 819 | |
@@ -847,7 +847,7 @@ discard block |
||
847 | 847 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
848 | 848 | } |
849 | 849 | |
850 | - return ' FROM ' . implode(', ', $sqlParts); |
|
850 | + return ' FROM '.implode(', ', $sqlParts); |
|
851 | 851 | } |
852 | 852 | |
853 | 853 | /** |
@@ -927,7 +927,7 @@ discard block |
||
927 | 927 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
928 | 928 | |
929 | 929 | $sql = $this->platform->appendLockHint( |
930 | - $tableName . ' ' . $tableAlias, |
|
930 | + $tableName.' '.$tableAlias, |
|
931 | 931 | $this->query->getHint(Query::HINT_LOCK_MODE) |
932 | 932 | ); |
933 | 933 | |
@@ -938,10 +938,10 @@ discard block |
||
938 | 938 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
939 | 939 | |
940 | 940 | if ( ! $buildNestedJoins) { |
941 | - return $sql . $classTableInheritanceJoins; |
|
941 | + return $sql.$classTableInheritanceJoins; |
|
942 | 942 | } |
943 | 943 | |
944 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
944 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | /** |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | ; |
979 | 979 | |
980 | 980 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && |
981 | - (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
981 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
982 | 982 | if ($association instanceof ToManyAssociationMetadata) { |
983 | 983 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
984 | 984 | } |
@@ -1032,7 +1032,7 @@ discard block |
||
1032 | 1032 | } |
1033 | 1033 | |
1034 | 1034 | $targetTableJoin = [ |
1035 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1035 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1036 | 1036 | 'condition' => implode(' AND ', $conditions), |
1037 | 1037 | ]; |
1038 | 1038 | } elseif ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | ); |
1061 | 1061 | } |
1062 | 1062 | |
1063 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
1063 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
1064 | 1064 | |
1065 | 1065 | // Join target table |
1066 | 1066 | $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | } |
1100 | 1100 | |
1101 | 1101 | $targetTableJoin = [ |
1102 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
1102 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
1103 | 1103 | 'condition' => implode(' AND ', $conditions), |
1104 | 1104 | ]; |
1105 | 1105 | } else { |
@@ -1107,23 +1107,23 @@ discard block |
||
1107 | 1107 | } |
1108 | 1108 | |
1109 | 1109 | // Handle WITH clause |
1110 | - $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
1110 | + $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
1111 | 1111 | |
1112 | 1112 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
1113 | 1113 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
1114 | 1114 | |
1115 | 1115 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
1116 | 1116 | if ($withCondition) { |
1117 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
1117 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
1118 | 1118 | } else { |
1119 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
1119 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
1120 | 1120 | } |
1121 | 1121 | } else { |
1122 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
1122 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
1123 | 1123 | } |
1124 | 1124 | |
1125 | 1125 | if ($withCondition) { |
1126 | - $sql .= ' AND ' . $withCondition; |
|
1126 | + $sql .= ' AND '.$withCondition; |
|
1127 | 1127 | } |
1128 | 1128 | |
1129 | 1129 | // Apply the indexes |
@@ -1156,7 +1156,7 @@ discard block |
||
1156 | 1156 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
1157 | 1157 | } |
1158 | 1158 | |
1159 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
1159 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
1160 | 1160 | } |
1161 | 1161 | |
1162 | 1162 | /** |
@@ -1173,10 +1173,10 @@ discard block |
||
1173 | 1173 | $this->orderedColumnsMap[$sql] = $type; |
1174 | 1174 | |
1175 | 1175 | if ($expr instanceof AST\Subselect) { |
1176 | - return '(' . $sql . ') ' . $type; |
|
1176 | + return '('.$sql.') '.$type; |
|
1177 | 1177 | } |
1178 | 1178 | |
1179 | - return $sql . ' ' . $type; |
|
1179 | + return $sql.' '.$type; |
|
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | /** |
@@ -1184,7 +1184,7 @@ discard block |
||
1184 | 1184 | */ |
1185 | 1185 | public function walkHavingClause($havingClause) |
1186 | 1186 | { |
1187 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1187 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
1188 | 1188 | } |
1189 | 1189 | |
1190 | 1190 | /** |
@@ -1207,7 +1207,7 @@ discard block |
||
1207 | 1207 | $conditions = []; |
1208 | 1208 | |
1209 | 1209 | if ($join->conditionalExpression) { |
1210 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
1210 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
1211 | 1211 | } |
1212 | 1212 | |
1213 | 1213 | $isUnconditionalJoin = empty($conditions); |
@@ -1215,7 +1215,7 @@ discard block |
||
1215 | 1215 | ? ' AND ' |
1216 | 1216 | : ' ON '; |
1217 | 1217 | |
1218 | - $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, !$isUnconditionalJoin); |
|
1218 | + $sql .= $this->generateRangeVariableDeclarationSQL($joinDeclaration, ! $isUnconditionalJoin); |
|
1219 | 1219 | |
1220 | 1220 | // Apply remaining inheritance restrictions |
1221 | 1221 | $discrSql = $this->generateDiscriminatorColumnConditionSQL([$dqlAlias]); |
@@ -1232,7 +1232,7 @@ discard block |
||
1232 | 1232 | } |
1233 | 1233 | |
1234 | 1234 | if ($conditions) { |
1235 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
1235 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
1236 | 1236 | } |
1237 | 1237 | |
1238 | 1238 | break; |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
1263 | 1263 | } |
1264 | 1264 | |
1265 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
1265 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
1266 | 1266 | |
1267 | 1267 | return $sql; |
1268 | 1268 | } |
@@ -1284,7 +1284,7 @@ discard block |
||
1284 | 1284 | ? $this->conn->quote($nullIfExpression->secondExpression) |
1285 | 1285 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
1286 | 1286 | |
1287 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
1287 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
1288 | 1288 | } |
1289 | 1289 | |
1290 | 1290 | /** |
@@ -1299,11 +1299,11 @@ discard block |
||
1299 | 1299 | $sql = 'CASE'; |
1300 | 1300 | |
1301 | 1301 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
1302 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1303 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1302 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
1303 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
1304 | 1304 | } |
1305 | 1305 | |
1306 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
1306 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
1307 | 1307 | |
1308 | 1308 | return $sql; |
1309 | 1309 | } |
@@ -1317,14 +1317,14 @@ discard block |
||
1317 | 1317 | */ |
1318 | 1318 | public function walkSimpleCaseExpression($simpleCaseExpression) |
1319 | 1319 | { |
1320 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1320 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
1321 | 1321 | |
1322 | 1322 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
1323 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1324 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1323 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
1324 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
1325 | 1325 | } |
1326 | 1326 | |
1327 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
1327 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
1328 | 1328 | |
1329 | 1329 | return $sql; |
1330 | 1330 | } |
@@ -1386,7 +1386,7 @@ discard block |
||
1386 | 1386 | $columnAlias = $this->getSQLColumnAlias(); |
1387 | 1387 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1388 | 1388 | |
1389 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1389 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1390 | 1390 | |
1391 | 1391 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1392 | 1392 | |
@@ -1401,7 +1401,7 @@ discard block |
||
1401 | 1401 | $columnAlias = $this->getSQLColumnAlias(); |
1402 | 1402 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1403 | 1403 | |
1404 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1404 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1405 | 1405 | |
1406 | 1406 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
1407 | 1407 | |
@@ -1412,7 +1412,7 @@ discard block |
||
1412 | 1412 | break; |
1413 | 1413 | |
1414 | 1414 | case ($expr instanceof AST\NewObjectExpression): |
1415 | - $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable); |
|
1415 | + $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable); |
|
1416 | 1416 | break; |
1417 | 1417 | |
1418 | 1418 | default: |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | |
1442 | 1442 | // Select all fields from the queried class |
1443 | 1443 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1444 | - if (! ($property instanceof FieldMetadata)) { |
|
1444 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1445 | 1445 | continue; |
1446 | 1446 | } |
1447 | 1447 | |
@@ -1476,11 +1476,11 @@ discard block |
||
1476 | 1476 | $subClass = $this->em->getClassMetadata($subClassName); |
1477 | 1477 | |
1478 | 1478 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
1479 | - if (! ($property instanceof FieldMetadata)) { |
|
1479 | + if ( ! ($property instanceof FieldMetadata)) { |
|
1480 | 1480 | continue; |
1481 | 1481 | } |
1482 | 1482 | |
1483 | - if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) { |
|
1483 | + if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) { |
|
1484 | 1484 | continue; |
1485 | 1485 | } |
1486 | 1486 | |
@@ -1515,7 +1515,7 @@ discard block |
||
1515 | 1515 | */ |
1516 | 1516 | public function walkQuantifiedExpression($qExpr) |
1517 | 1517 | { |
1518 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
1518 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
1519 | 1519 | } |
1520 | 1520 | |
1521 | 1521 | /** |
@@ -1555,7 +1555,7 @@ discard block |
||
1555 | 1555 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
1556 | 1556 | } |
1557 | 1557 | |
1558 | - return ' FROM ' . implode(', ', $sqlParts); |
|
1558 | + return ' FROM '.implode(', ', $sqlParts); |
|
1559 | 1559 | } |
1560 | 1560 | |
1561 | 1561 | /** |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | */ |
1564 | 1564 | public function walkSimpleSelectClause($simpleSelectClause) |
1565 | 1565 | { |
1566 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1566 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
1567 | 1567 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
1568 | 1568 | } |
1569 | 1569 | |
@@ -1582,7 +1582,7 @@ discard block |
||
1582 | 1582 | * @param null|string $newObjectResultAlias |
1583 | 1583 | * @return string The SQL. |
1584 | 1584 | */ |
1585 | - public function walkNewObject($newObjectExpression, $newObjectResultAlias=null) |
|
1585 | + public function walkNewObject($newObjectExpression, $newObjectResultAlias = null) |
|
1586 | 1586 | { |
1587 | 1587 | $sqlSelectExpressions = []; |
1588 | 1588 | $objIndex = $newObjectResultAlias ?: $this->newObjectCounter++; |
@@ -1598,7 +1598,7 @@ discard block |
||
1598 | 1598 | break; |
1599 | 1599 | |
1600 | 1600 | case ($e instanceof AST\Subselect): |
1601 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
1601 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
1602 | 1602 | break; |
1603 | 1603 | |
1604 | 1604 | case ($e instanceof AST\PathExpression): |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | $class = $qComp['metadata']; |
1608 | 1608 | $fieldType = $class->getProperty($e->field)->getType(); |
1609 | 1609 | |
1610 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1610 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1611 | 1611 | break; |
1612 | 1612 | |
1613 | 1613 | case ($e instanceof AST\Literal): |
@@ -1621,11 +1621,11 @@ discard block |
||
1621 | 1621 | break; |
1622 | 1622 | } |
1623 | 1623 | |
1624 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1624 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1625 | 1625 | break; |
1626 | 1626 | |
1627 | 1627 | default: |
1628 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
1628 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
1629 | 1629 | break; |
1630 | 1630 | } |
1631 | 1631 | |
@@ -1658,10 +1658,10 @@ discard block |
||
1658 | 1658 | case ($expr instanceof AST\Subselect): |
1659 | 1659 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
1660 | 1660 | |
1661 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
1661 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
1662 | 1662 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1663 | 1663 | |
1664 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
1664 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
1665 | 1665 | break; |
1666 | 1666 | |
1667 | 1667 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | $columnAlias = $this->getSQLColumnAlias(); |
1679 | 1679 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
1680 | 1680 | |
1681 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
1681 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
1682 | 1682 | break; |
1683 | 1683 | |
1684 | 1684 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1698,8 +1698,8 @@ discard block |
||
1698 | 1698 | */ |
1699 | 1699 | public function walkAggregateExpression($aggExpression) |
1700 | 1700 | { |
1701 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1702 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
1701 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
1702 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
1703 | 1703 | } |
1704 | 1704 | |
1705 | 1705 | /** |
@@ -1713,7 +1713,7 @@ discard block |
||
1713 | 1713 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
1714 | 1714 | } |
1715 | 1715 | |
1716 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
1716 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
1717 | 1717 | } |
1718 | 1718 | |
1719 | 1719 | /** |
@@ -1776,7 +1776,7 @@ discard block |
||
1776 | 1776 | { |
1777 | 1777 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
1778 | 1778 | $tableName = $class->getTableName(); |
1779 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1779 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
1780 | 1780 | |
1781 | 1781 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
1782 | 1782 | |
@@ -1792,12 +1792,12 @@ discard block |
||
1792 | 1792 | { |
1793 | 1793 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
1794 | 1794 | $tableName = $class->getTableName(); |
1795 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
1795 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
1796 | 1796 | |
1797 | 1797 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
1798 | 1798 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
1799 | 1799 | |
1800 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1800 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
1801 | 1801 | |
1802 | 1802 | return $sql; |
1803 | 1803 | } |
@@ -1810,7 +1810,7 @@ discard block |
||
1810 | 1810 | $useTableAliasesBefore = $this->useSqlTableAliases; |
1811 | 1811 | $this->useSqlTableAliases = false; |
1812 | 1812 | |
1813 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
1813 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
1814 | 1814 | $newValue = $updateItem->newValue; |
1815 | 1815 | |
1816 | 1816 | switch (true) { |
@@ -1853,7 +1853,7 @@ discard block |
||
1853 | 1853 | |
1854 | 1854 | if ($filterClauses) { |
1855 | 1855 | if ($condSql) { |
1856 | - $condSql = '(' . $condSql . ') AND '; |
|
1856 | + $condSql = '('.$condSql.') AND '; |
|
1857 | 1857 | } |
1858 | 1858 | |
1859 | 1859 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1861,11 +1861,11 @@ discard block |
||
1861 | 1861 | } |
1862 | 1862 | |
1863 | 1863 | if ($condSql) { |
1864 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
1864 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
1865 | 1865 | } |
1866 | 1866 | |
1867 | 1867 | if ($discrSql) { |
1868 | - return ' WHERE ' . $discrSql; |
|
1868 | + return ' WHERE '.$discrSql; |
|
1869 | 1869 | } |
1870 | 1870 | |
1871 | 1871 | return ''; |
@@ -1908,7 +1908,7 @@ discard block |
||
1908 | 1908 | // if only one ConditionalPrimary is defined |
1909 | 1909 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
1910 | 1910 | ? $this->walkConditionalPrimary($factor) |
1911 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1911 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
1912 | 1912 | } |
1913 | 1913 | |
1914 | 1914 | /** |
@@ -1923,7 +1923,7 @@ discard block |
||
1923 | 1923 | if ($primary->isConditionalExpression()) { |
1924 | 1924 | $condExpr = $primary->conditionalExpression; |
1925 | 1925 | |
1926 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
1926 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
1927 | 1927 | } |
1928 | 1928 | } |
1929 | 1929 | |
@@ -1934,7 +1934,7 @@ discard block |
||
1934 | 1934 | { |
1935 | 1935 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
1936 | 1936 | |
1937 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
1937 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
1938 | 1938 | |
1939 | 1939 | return $sql; |
1940 | 1940 | } |
@@ -1983,7 +1983,7 @@ discard block |
||
1983 | 1983 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
1984 | 1984 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
1985 | 1985 | |
1986 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
1986 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
1987 | 1987 | |
1988 | 1988 | $sqlParts = []; |
1989 | 1989 | |
@@ -2004,7 +2004,7 @@ discard block |
||
2004 | 2004 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2005 | 2005 | } |
2006 | 2006 | |
2007 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2007 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2008 | 2008 | } |
2009 | 2009 | |
2010 | 2010 | $sql .= implode(' AND ', $sqlParts); |
@@ -2018,7 +2018,7 @@ discard block |
||
2018 | 2018 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
2019 | 2019 | |
2020 | 2020 | // join to target table |
2021 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
2021 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
2022 | 2022 | |
2023 | 2023 | // join conditions |
2024 | 2024 | $joinSqlParts = []; |
@@ -2069,13 +2069,13 @@ discard block |
||
2069 | 2069 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
2070 | 2070 | } |
2071 | 2071 | |
2072 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
2072 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
2073 | 2073 | } |
2074 | 2074 | |
2075 | 2075 | $sql .= implode(' AND ', $sqlParts); |
2076 | 2076 | } |
2077 | 2077 | |
2078 | - return $sql . ')'; |
|
2078 | + return $sql.')'; |
|
2079 | 2079 | } |
2080 | 2080 | |
2081 | 2081 | /** |
@@ -2086,7 +2086,7 @@ discard block |
||
2086 | 2086 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
2087 | 2087 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
2088 | 2088 | |
2089 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2089 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
2090 | 2090 | } |
2091 | 2091 | |
2092 | 2092 | /** |
@@ -2095,19 +2095,19 @@ discard block |
||
2095 | 2095 | public function walkNullComparisonExpression($nullCompExpr) |
2096 | 2096 | { |
2097 | 2097 | $expression = $nullCompExpr->expression; |
2098 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
2098 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
2099 | 2099 | |
2100 | 2100 | // Handle ResultVariable |
2101 | 2101 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
2102 | - return $this->walkResultVariable($expression) . $comparison; |
|
2102 | + return $this->walkResultVariable($expression).$comparison; |
|
2103 | 2103 | } |
2104 | 2104 | |
2105 | 2105 | // Handle InputParameter mapping inclusion to ParserResult |
2106 | 2106 | if ($expression instanceof AST\InputParameter) { |
2107 | - return $this->walkInputParameter($expression) . $comparison; |
|
2107 | + return $this->walkInputParameter($expression).$comparison; |
|
2108 | 2108 | } |
2109 | 2109 | |
2110 | - return $expression->dispatch($this) . $comparison; |
|
2110 | + return $expression->dispatch($this).$comparison; |
|
2111 | 2111 | } |
2112 | 2112 | |
2113 | 2113 | /** |
@@ -2115,7 +2115,7 @@ discard block |
||
2115 | 2115 | */ |
2116 | 2116 | public function walkInExpression($inExpr) |
2117 | 2117 | { |
2118 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
2118 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
2119 | 2119 | |
2120 | 2120 | $sql .= ($inExpr->subselect) |
2121 | 2121 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2139,12 +2139,12 @@ discard block |
||
2139 | 2139 | $discrColumnType = $discrColumn->getType(); |
2140 | 2140 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
2141 | 2141 | $sqlTableAlias = $this->useSqlTableAliases |
2142 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
2142 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
2143 | 2143 | : ''; |
2144 | 2144 | |
2145 | 2145 | return sprintf( |
2146 | 2146 | '%s %sIN %s', |
2147 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
2147 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
2148 | 2148 | ($instanceOfExpr->not ? 'NOT ' : ''), |
2149 | 2149 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
2150 | 2150 | ); |
@@ -2191,8 +2191,8 @@ discard block |
||
2191 | 2191 | $sql .= ' NOT'; |
2192 | 2192 | } |
2193 | 2193 | |
2194 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2195 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2194 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
2195 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
2196 | 2196 | |
2197 | 2197 | return $sql; |
2198 | 2198 | } |
@@ -2207,7 +2207,7 @@ discard block |
||
2207 | 2207 | ? $this->walkResultVariable($stringExpr) |
2208 | 2208 | : $stringExpr->dispatch($this); |
2209 | 2209 | |
2210 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
2210 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
2211 | 2211 | |
2212 | 2212 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
2213 | 2213 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2220,7 +2220,7 @@ discard block |
||
2220 | 2220 | } |
2221 | 2221 | |
2222 | 2222 | if ($likeExpr->escapeChar) { |
2223 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
2223 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
2224 | 2224 | } |
2225 | 2225 | |
2226 | 2226 | return $sql; |
@@ -2247,7 +2247,7 @@ discard block |
||
2247 | 2247 | ? $leftExpr->dispatch($this) |
2248 | 2248 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
2249 | 2249 | |
2250 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
2250 | + $sql .= ' '.$compExpr->operator.' '; |
|
2251 | 2251 | |
2252 | 2252 | $sql .= ($rightExpr instanceof AST\Node) |
2253 | 2253 | ? $rightExpr->dispatch($this) |
@@ -2279,7 +2279,7 @@ discard block |
||
2279 | 2279 | { |
2280 | 2280 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
2281 | 2281 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
2282 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
2282 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
2283 | 2283 | } |
2284 | 2284 | |
2285 | 2285 | /** |
@@ -2333,7 +2333,7 @@ discard block |
||
2333 | 2333 | |
2334 | 2334 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
2335 | 2335 | |
2336 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2336 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
2337 | 2337 | } |
2338 | 2338 | |
2339 | 2339 | /** |
@@ -2346,7 +2346,7 @@ discard block |
||
2346 | 2346 | public function walkArithmeticPrimary($primary) |
2347 | 2347 | { |
2348 | 2348 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
2349 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
2349 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
2350 | 2350 | } |
2351 | 2351 | |
2352 | 2352 | if ($primary instanceof AST\Node) { |
@@ -2407,7 +2407,7 @@ discard block |
||
2407 | 2407 | $entityClassName = $entityClass->getClassName(); |
2408 | 2408 | |
2409 | 2409 | if ($entityClassName !== $rootClass->getClassName()) { |
2410 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2410 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
2411 | 2411 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
2412 | 2412 | } |
2413 | 2413 | } |
@@ -2419,6 +2419,6 @@ discard block |
||
2419 | 2419 | $sqlParameterList[] = $this->conn->quote($discriminator); |
2420 | 2420 | } |
2421 | 2421 | |
2422 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
2422 | + return '('.implode(', ', $sqlParameterList).')'; |
|
2423 | 2423 | } |
2424 | 2424 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Internal\Hydration; |
6 | 6 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | { |
148 | 148 | $row = $this->stmt->fetch(PDO::FETCH_ASSOC); |
149 | 149 | |
150 | - if (! $row) { |
|
150 | + if ( ! $row) { |
|
151 | 151 | $this->cleanup(); |
152 | 152 | |
153 | 153 | return false; |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | // If there are field name collisions in the child class, then we need |
280 | 280 | // to only hydrate if we are looking at the correct discriminator value |
281 | 281 | if ( |
282 | - isset($cacheKeyInfo['discriminatorColumn'],$data[$cacheKeyInfo['discriminatorColumn']]) && |
|
282 | + isset($cacheKeyInfo['discriminatorColumn'], $data[$cacheKeyInfo['discriminatorColumn']]) && |
|
283 | 283 | // Note: loose comparison required. See https://github.com/doctrine/doctrine2/pull/6304#issuecomment-323294442 |
284 | 284 | $data[$cacheKeyInfo['discriminatorColumn']] != $cacheKeyInfo['discriminatorValue'] |
285 | 285 | ) { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | : $value; |
299 | 299 | |
300 | 300 | if ($cacheKeyInfo['isIdentifier'] && $value !== null) { |
301 | - $id[$dqlAlias] .= '|' . $value; |
|
301 | + $id[$dqlAlias] .= '|'.$value; |
|
302 | 302 | $nonemptyComponents[$dqlAlias] = true; |
303 | 303 | } |
304 | 304 | break; |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | if ( ! isset($cacheKeyInfo['isScalar'])) { |
337 | 337 | $dqlAlias = $cacheKeyInfo['dqlAlias']; |
338 | 338 | $type = $cacheKeyInfo['type']; |
339 | - $fieldName = $dqlAlias . '_' . $fieldName; |
|
339 | + $fieldName = $dqlAlias.'_'.$fieldName; |
|
340 | 340 | $value = $type |
341 | 341 | ? $type->convertToPHPValue($value, $this->platform) |
342 | 342 | : $value; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Persisters; |
6 | 6 | |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | |
85 | 85 | switch ($expr->getType()) { |
86 | 86 | case CompositeExpression::TYPE_AND: |
87 | - return '(' . implode(' AND ', $expressionList) . ')'; |
|
87 | + return '('.implode(' AND ', $expressionList).')'; |
|
88 | 88 | |
89 | 89 | case CompositeExpression::TYPE_OR: |
90 | - return '(' . implode(' OR ', $expressionList) . ')'; |
|
90 | + return '('.implode(' OR ', $expressionList).')'; |
|
91 | 91 | |
92 | 92 | default: |
93 | - throw new \RuntimeException("Unknown composite " . $expr->getType()); |
|
93 | + throw new \RuntimeException("Unknown composite ".$expr->getType()); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 |
@@ -247,7 +247,7 @@ |
||
247 | 247 | |
248 | 248 | // 2) Build insert table records into temporary table |
249 | 249 | $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
250 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
250 | + . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
251 | 251 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
252 | 252 | |
253 | 253 | $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
@@ -306,8 +306,8 @@ discard block |
||
306 | 306 | |
307 | 307 | // FIXME: Order with composite keys might not be correct |
308 | 308 | $sql = 'SELECT ' . $columnName |
309 | - . ' FROM ' . $tableName |
|
310 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
309 | + . ' FROM ' . $tableName |
|
310 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
311 | 311 | |
312 | 312 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
313 | 313 | $versionType = $versionProperty->getType(); |
@@ -511,8 +511,8 @@ discard block |
||
511 | 511 | } |
512 | 512 | |
513 | 513 | $sql = 'UPDATE ' . $quotedTableName |
514 | - . ' SET ' . implode(', ', $set) |
|
515 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
514 | + . ' SET ' . implode(', ', $set) |
|
515 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
516 | 516 | |
517 | 517 | $result = $this->conn->executeUpdate($sql, $params, $types); |
518 | 518 | |
@@ -1646,9 +1646,9 @@ discard block |
||
1646 | 1646 | $lock = $this->getLockTablesSql($lockMode); |
1647 | 1647 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
1648 | 1648 | $sql = 'SELECT 1 ' |
1649 | - . $lock |
|
1650 | - . $where |
|
1651 | - . $lockSql; |
|
1649 | + . $lock |
|
1650 | + . $where |
|
1651 | + . $lockSql; |
|
1652 | 1652 | |
1653 | 1653 | list($params, $types) = $this->expandParameters($criteria); |
1654 | 1654 | |
@@ -2127,8 +2127,8 @@ discard block |
||
2127 | 2127 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
2128 | 2128 | |
2129 | 2129 | $sql = 'SELECT 1 ' |
2130 | - . $this->getLockTablesSql(null) |
|
2131 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2130 | + . $this->getLockTablesSql(null) |
|
2131 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2132 | 2132 | |
2133 | 2133 | list($params, $types) = $this->expandParameters($criteria); |
2134 | 2134 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM\Persisters\Entity; |
6 | 6 | |
@@ -300,14 +300,14 @@ discard block |
||
300 | 300 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
301 | 301 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
302 | 302 | $identifier = array_map( |
303 | - function ($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
303 | + function($columnName) { return $this->platform->quoteIdentifier($columnName); }, |
|
304 | 304 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
305 | 305 | ); |
306 | 306 | |
307 | 307 | // FIXME: Order with composite keys might not be correct |
308 | - $sql = 'SELECT ' . $columnName |
|
309 | - . ' FROM ' . $tableName |
|
310 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
308 | + $sql = 'SELECT '.$columnName |
|
309 | + . ' FROM '.$tableName |
|
310 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
311 | 311 | |
312 | 312 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
313 | 313 | $versionType = $versionProperty->getType(); |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | |
394 | 394 | if (($value = $identifier[$field]) !== null) { |
395 | 395 | // @todo guilhermeblanco Make sure we do not have flat association values. |
396 | - if (! is_array($value)) { |
|
396 | + if ( ! is_array($value)) { |
|
397 | 397 | $value = [$targetClass->identifier[0] => $value]; |
398 | 398 | } |
399 | 399 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
407 | 407 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
408 | 408 | |
409 | - if (! $joinColumn->getType()) { |
|
409 | + if ( ! $joinColumn->getType()) { |
|
410 | 410 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
411 | 411 | } |
412 | 412 | |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
475 | 475 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
476 | 476 | |
477 | - if (! $joinColumn->getType()) { |
|
477 | + if ( ! $joinColumn->getType()) { |
|
478 | 478 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
479 | 479 | } |
480 | 480 | |
@@ -501,18 +501,18 @@ discard block |
||
501 | 501 | case Type::SMALLINT: |
502 | 502 | case Type::INTEGER: |
503 | 503 | case Type::BIGINT: |
504 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
504 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
505 | 505 | break; |
506 | 506 | |
507 | 507 | case Type::DATETIME: |
508 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
508 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
509 | 509 | break; |
510 | 510 | } |
511 | 511 | } |
512 | 512 | |
513 | - $sql = 'UPDATE ' . $quotedTableName |
|
514 | - . ' SET ' . implode(', ', $set) |
|
515 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
513 | + $sql = 'UPDATE '.$quotedTableName |
|
514 | + . ' SET '.implode(', ', $set) |
|
515 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
516 | 516 | |
517 | 517 | $result = $this->conn->executeUpdate($sql, $params, $types); |
518 | 518 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | protected function deleteJoinTableRecords($identifier) |
532 | 532 | { |
533 | 533 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
534 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
534 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
535 | 535 | continue; |
536 | 536 | } |
537 | 537 | |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | $keys = []; |
545 | 545 | |
546 | 546 | if ( ! $owningAssociation->isOwningSide()) { |
547 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
547 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
548 | 548 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
549 | 549 | } |
550 | 550 | |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | } |
657 | 657 | |
658 | 658 | // Only owning side of x-1 associations can have a FK column. |
659 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
659 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
660 | 660 | continue; |
661 | 661 | } |
662 | 662 | |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | /** @var JoinColumnMetadata $joinColumn */ |
677 | 677 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
678 | 678 | |
679 | - if (! $joinColumn->getType()) { |
|
679 | + if ( ! $joinColumn->getType()) { |
|
680 | 680 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
681 | 681 | } |
682 | 682 | |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | $propertyName = $this->class->fieldNames[$columnName]; |
706 | 706 | $property = $this->class->getProperty($propertyName); |
707 | 707 | |
708 | - if (! $property) { |
|
708 | + if ( ! $property) { |
|
709 | 709 | return null; |
710 | 710 | } |
711 | 711 | |
@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | /** @var JoinColumnMetadata $joinColumn */ |
725 | 725 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
726 | 726 | |
727 | - if (! $joinColumn->getType()) { |
|
727 | + if ( ! $joinColumn->getType()) { |
|
728 | 728 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
729 | 729 | } |
730 | 730 | |
@@ -1061,7 +1061,7 @@ discard block |
||
1061 | 1061 | $criteria = []; |
1062 | 1062 | $parameters = []; |
1063 | 1063 | |
1064 | - if (! $association->isOwningSide()) { |
|
1064 | + if ( ! $association->isOwningSide()) { |
|
1065 | 1065 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
1066 | 1066 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
1067 | 1067 | } |
@@ -1089,7 +1089,7 @@ discard block |
||
1089 | 1089 | $value = $value[$targetClass->identifier[0]]; |
1090 | 1090 | } |
1091 | 1091 | |
1092 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
1092 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
1093 | 1093 | $parameters[] = [ |
1094 | 1094 | 'value' => $value, |
1095 | 1095 | 'field' => $fieldName, |
@@ -1140,11 +1140,11 @@ discard block |
||
1140 | 1140 | |
1141 | 1141 | switch ($lockMode) { |
1142 | 1142 | case LockMode::PESSIMISTIC_READ: |
1143 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
1143 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
1144 | 1144 | break; |
1145 | 1145 | |
1146 | 1146 | case LockMode::PESSIMISTIC_WRITE: |
1147 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
1147 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
1148 | 1148 | break; |
1149 | 1149 | } |
1150 | 1150 | |
@@ -1155,14 +1155,14 @@ discard block |
||
1155 | 1155 | |
1156 | 1156 | if ('' !== $filterSql) { |
1157 | 1157 | $conditionSql = $conditionSql |
1158 | - ? $conditionSql . ' AND ' . $filterSql |
|
1158 | + ? $conditionSql.' AND '.$filterSql |
|
1159 | 1159 | : $filterSql; |
1160 | 1160 | } |
1161 | 1161 | |
1162 | - $select = 'SELECT ' . $columnList; |
|
1163 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
1164 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
1165 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
1162 | + $select = 'SELECT '.$columnList; |
|
1163 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
1164 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
1165 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
1166 | 1166 | $lock = $this->platform->appendLockHint($from, $lockMode); |
1167 | 1167 | $query = $select |
1168 | 1168 | . $lock |
@@ -1170,7 +1170,7 @@ discard block |
||
1170 | 1170 | . $where |
1171 | 1171 | . $orderBySql; |
1172 | 1172 | |
1173 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
1173 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
1174 | 1174 | } |
1175 | 1175 | |
1176 | 1176 | /** |
@@ -1189,13 +1189,13 @@ discard block |
||
1189 | 1189 | |
1190 | 1190 | if ('' !== $filterSql) { |
1191 | 1191 | $conditionSql = $conditionSql |
1192 | - ? $conditionSql . ' AND ' . $filterSql |
|
1192 | + ? $conditionSql.' AND '.$filterSql |
|
1193 | 1193 | : $filterSql; |
1194 | 1194 | } |
1195 | 1195 | |
1196 | 1196 | $sql = 'SELECT COUNT(*) ' |
1197 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
1198 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
1197 | + . 'FROM '.$tableName.' '.$tableAlias |
|
1198 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
1199 | 1199 | |
1200 | 1200 | return $sql; |
1201 | 1201 | } |
@@ -1212,7 +1212,7 @@ discard block |
||
1212 | 1212 | */ |
1213 | 1213 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
1214 | 1214 | { |
1215 | - if (! $orderBy) { |
|
1215 | + if ( ! $orderBy) { |
|
1216 | 1216 | return ''; |
1217 | 1217 | } |
1218 | 1218 | |
@@ -1221,7 +1221,7 @@ discard block |
||
1221 | 1221 | foreach ($orderBy as $fieldName => $orientation) { |
1222 | 1222 | $orientation = strtoupper(trim($orientation)); |
1223 | 1223 | |
1224 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
1224 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
1225 | 1225 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
1226 | 1226 | } |
1227 | 1227 | |
@@ -1231,11 +1231,11 @@ discard block |
||
1231 | 1231 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1232 | 1232 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1233 | 1233 | |
1234 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
1234 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
1235 | 1235 | |
1236 | 1236 | continue; |
1237 | 1237 | } elseif ($property instanceof AssociationMetadata) { |
1238 | - if (! $property->isOwningSide()) { |
|
1238 | + if ( ! $property->isOwningSide()) { |
|
1239 | 1239 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName); |
1240 | 1240 | } |
1241 | 1241 | |
@@ -1248,7 +1248,7 @@ discard block |
||
1248 | 1248 | /* @var JoinColumnMetadata $joinColumn */ |
1249 | 1249 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1250 | 1250 | |
1251 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
1251 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
1252 | 1252 | } |
1253 | 1253 | |
1254 | 1254 | continue; |
@@ -1257,7 +1257,7 @@ discard block |
||
1257 | 1257 | throw ORMException::unrecognizedField($fieldName); |
1258 | 1258 | } |
1259 | 1259 | |
1260 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
1260 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
1261 | 1261 | } |
1262 | 1262 | |
1263 | 1263 | /** |
@@ -1279,7 +1279,7 @@ discard block |
||
1279 | 1279 | |
1280 | 1280 | |
1281 | 1281 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
1282 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
1282 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
1283 | 1283 | |
1284 | 1284 | $eagerAliasCounter = 0; |
1285 | 1285 | $columnList = []; |
@@ -1315,7 +1315,7 @@ discard block |
||
1315 | 1315 | break; // now this is why you shouldn't use inheritance |
1316 | 1316 | } |
1317 | 1317 | |
1318 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
1318 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
1319 | 1319 | |
1320 | 1320 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
1321 | 1321 | |
@@ -1340,14 +1340,14 @@ discard block |
||
1340 | 1340 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
1341 | 1341 | } |
1342 | 1342 | |
1343 | - if (! $property->isOwningSide()) { |
|
1343 | + if ( ! $property->isOwningSide()) { |
|
1344 | 1344 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
1345 | 1345 | } |
1346 | 1346 | |
1347 | 1347 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
1348 | 1348 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
1349 | 1349 | |
1350 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
1350 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
1351 | 1351 | |
1352 | 1352 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
1353 | 1353 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1369,7 +1369,7 @@ discard block |
||
1369 | 1369 | $joinCondition[] = $filterSql; |
1370 | 1370 | } |
1371 | 1371 | |
1372 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
1372 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
1373 | 1373 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
1374 | 1374 | |
1375 | 1375 | break; |
@@ -1393,7 +1393,7 @@ discard block |
||
1393 | 1393 | */ |
1394 | 1394 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
1395 | 1395 | { |
1396 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1396 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
1397 | 1397 | return ''; |
1398 | 1398 | } |
1399 | 1399 | |
@@ -1408,7 +1408,7 @@ discard block |
||
1408 | 1408 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1409 | 1409 | $resultColumnName = $this->getSQLColumnAlias(); |
1410 | 1410 | |
1411 | - if (! $joinColumn->getType()) { |
|
1411 | + if ( ! $joinColumn->getType()) { |
|
1412 | 1412 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1413 | 1413 | } |
1414 | 1414 | |
@@ -1440,7 +1440,7 @@ discard block |
||
1440 | 1440 | $owningAssociation = $association; |
1441 | 1441 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
1442 | 1442 | |
1443 | - if (! $association->isOwningSide()) { |
|
1443 | + if ( ! $association->isOwningSide()) { |
|
1444 | 1444 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
1445 | 1445 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
1446 | 1446 | } |
@@ -1462,7 +1462,7 @@ discard block |
||
1462 | 1462 | ); |
1463 | 1463 | } |
1464 | 1464 | |
1465 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
1465 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
1466 | 1466 | } |
1467 | 1467 | |
1468 | 1468 | /** |
@@ -1557,7 +1557,7 @@ discard block |
||
1557 | 1557 | $columnName = $joinColumn->getColumnName(); |
1558 | 1558 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
1559 | 1559 | |
1560 | - if (! $joinColumn->getType()) { |
|
1560 | + if ( ! $joinColumn->getType()) { |
|
1561 | 1561 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
1562 | 1562 | } |
1563 | 1563 | |
@@ -1596,7 +1596,7 @@ discard block |
||
1596 | 1596 | |
1597 | 1597 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
1598 | 1598 | |
1599 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
1599 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
1600 | 1600 | } |
1601 | 1601 | |
1602 | 1602 | /** |
@@ -1610,14 +1610,14 @@ discard block |
||
1610 | 1610 | protected function getSQLTableAlias($tableName, $assocName = '') |
1611 | 1611 | { |
1612 | 1612 | if ($tableName) { |
1613 | - $tableName .= '#' . $assocName; |
|
1613 | + $tableName .= '#'.$assocName; |
|
1614 | 1614 | } |
1615 | 1615 | |
1616 | 1616 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
1617 | 1617 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
1618 | 1618 | } |
1619 | 1619 | |
1620 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
1620 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
1621 | 1621 | |
1622 | 1622 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
1623 | 1623 | |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | } |
1645 | 1645 | |
1646 | 1646 | $lock = $this->getLockTablesSql($lockMode); |
1647 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
1647 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
1648 | 1648 | $sql = 'SELECT 1 ' |
1649 | 1649 | . $lock |
1650 | 1650 | . $where |
@@ -1667,7 +1667,7 @@ discard block |
||
1667 | 1667 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
1668 | 1668 | |
1669 | 1669 | return $this->platform->appendLockHint( |
1670 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
1670 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
1671 | 1671 | $lockMode |
1672 | 1672 | ); |
1673 | 1673 | } |
@@ -1720,19 +1720,19 @@ discard block |
||
1720 | 1720 | |
1721 | 1721 | if (null !== $comparison) { |
1722 | 1722 | // special case null value handling |
1723 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
1724 | - $selectedColumns[] = $column . ' IS NULL'; |
|
1723 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
1724 | + $selectedColumns[] = $column.' IS NULL'; |
|
1725 | 1725 | |
1726 | 1726 | continue; |
1727 | 1727 | } |
1728 | 1728 | |
1729 | 1729 | if ($comparison === Comparison::NEQ && null === $value) { |
1730 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
1730 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
1731 | 1731 | |
1732 | 1732 | continue; |
1733 | 1733 | } |
1734 | 1734 | |
1735 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1735 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
1736 | 1736 | |
1737 | 1737 | continue; |
1738 | 1738 | } |
@@ -1781,7 +1781,7 @@ discard block |
||
1781 | 1781 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
1782 | 1782 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
1783 | 1783 | |
1784 | - return [$tableAlias . '.' . $columnName]; |
|
1784 | + return [$tableAlias.'.'.$columnName]; |
|
1785 | 1785 | } |
1786 | 1786 | |
1787 | 1787 | if ($property instanceof AssociationMetadata) { |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | |
1791 | 1791 | // Many-To-Many requires join table check for joinColumn |
1792 | 1792 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
1793 | - if (! $owningAssociation->isOwningSide()) { |
|
1793 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1794 | 1794 | $owningAssociation = $association; |
1795 | 1795 | } |
1796 | 1796 | |
@@ -1804,14 +1804,14 @@ discard block |
||
1804 | 1804 | foreach ($joinColumns as $joinColumn) { |
1805 | 1805 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1806 | 1806 | |
1807 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
1807 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
1808 | 1808 | } |
1809 | 1809 | } else { |
1810 | - if (! $owningAssociation->isOwningSide()) { |
|
1810 | + if ( ! $owningAssociation->isOwningSide()) { |
|
1811 | 1811 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field); |
1812 | 1812 | } |
1813 | 1813 | |
1814 | - $class = $this->class->isInheritedProperty($field) |
|
1814 | + $class = $this->class->isInheritedProperty($field) |
|
1815 | 1815 | ? $owningAssociation->getDeclaringClass() |
1816 | 1816 | : $this->class |
1817 | 1817 | ; |
@@ -1820,7 +1820,7 @@ discard block |
||
1820 | 1820 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
1821 | 1821 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
1822 | 1822 | |
1823 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
1823 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
1824 | 1824 | } |
1825 | 1825 | } |
1826 | 1826 | |
@@ -1933,7 +1933,7 @@ discard block |
||
1933 | 1933 | $value = $value[$targetClass->identifier[0]]; |
1934 | 1934 | } |
1935 | 1935 | |
1936 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
1936 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
1937 | 1937 | $parameters[] = [ |
1938 | 1938 | 'value' => $value, |
1939 | 1939 | 'field' => $fieldName, |
@@ -2020,7 +2020,7 @@ discard block |
||
2020 | 2020 | case ($property instanceof AssociationMetadata): |
2021 | 2021 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2022 | 2022 | |
2023 | - if (! $property->isOwningSide()) { |
|
2023 | + if ( ! $property->isOwningSide()) { |
|
2024 | 2024 | $property = $class->getProperty($property->getMappedBy()); |
2025 | 2025 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
2026 | 2026 | } |
@@ -2034,7 +2034,7 @@ discard block |
||
2034 | 2034 | /** @var JoinColumnMetadata $joinColumn */ |
2035 | 2035 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
2036 | 2036 | |
2037 | - if (! $joinColumn->getType()) { |
|
2037 | + if ( ! $joinColumn->getType()) { |
|
2038 | 2038 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
2039 | 2039 | } |
2040 | 2040 | |
@@ -2049,7 +2049,7 @@ discard block |
||
2049 | 2049 | } |
2050 | 2050 | |
2051 | 2051 | if (is_array($value)) { |
2052 | - return array_map(function ($type) { |
|
2052 | + return array_map(function($type) { |
|
2053 | 2053 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
2054 | 2054 | }, $types); |
2055 | 2055 | } |
@@ -2128,12 +2128,12 @@ discard block |
||
2128 | 2128 | |
2129 | 2129 | $sql = 'SELECT 1 ' |
2130 | 2130 | . $this->getLockTablesSql(null) |
2131 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
2131 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
2132 | 2132 | |
2133 | 2133 | list($params, $types) = $this->expandParameters($criteria); |
2134 | 2134 | |
2135 | 2135 | if (null !== $extraConditions) { |
2136 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
2136 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
2137 | 2137 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
2138 | 2138 | |
2139 | 2139 | $params = array_merge($params, $criteriaParams); |
@@ -2141,7 +2141,7 @@ discard block |
||
2141 | 2141 | } |
2142 | 2142 | |
2143 | 2143 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
2144 | - $sql .= ' AND ' . $filterSql; |
|
2144 | + $sql .= ' AND '.$filterSql; |
|
2145 | 2145 | } |
2146 | 2146 | |
2147 | 2147 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2156,13 +2156,13 @@ discard block |
||
2156 | 2156 | */ |
2157 | 2157 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
2158 | 2158 | { |
2159 | - if (! $association->isOwningSide()) { |
|
2159 | + if ( ! $association->isOwningSide()) { |
|
2160 | 2160 | return 'LEFT JOIN'; |
2161 | 2161 | } |
2162 | 2162 | |
2163 | 2163 | // if one of the join columns is nullable, return left join |
2164 | 2164 | foreach ($association->getJoinColumns() as $joinColumn) { |
2165 | - if (! $joinColumn->isNullable()) { |
|
2165 | + if ( ! $joinColumn->isNullable()) { |
|
2166 | 2166 | continue; |
2167 | 2167 | } |
2168 | 2168 | |
@@ -2179,7 +2179,7 @@ discard block |
||
2179 | 2179 | */ |
2180 | 2180 | public function getSQLColumnAlias() |
2181 | 2181 | { |
2182 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
2182 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
2183 | 2183 | } |
2184 | 2184 | |
2185 | 2185 | /** |
@@ -2196,13 +2196,13 @@ discard block |
||
2196 | 2196 | |
2197 | 2197 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
2198 | 2198 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
2199 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
2199 | + $filterClauses[] = '('.$filterExpr.')'; |
|
2200 | 2200 | } |
2201 | 2201 | } |
2202 | 2202 | |
2203 | 2203 | $sql = implode(' AND ', $filterClauses); |
2204 | 2204 | |
2205 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2205 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
2206 | 2206 | } |
2207 | 2207 | |
2208 | 2208 | /** |
@@ -1344,9 +1344,9 @@ discard block |
||
1344 | 1344 | private function getDQLForDelete() |
1345 | 1345 | { |
1346 | 1346 | return 'DELETE' |
1347 | - . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1348 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1349 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1347 | + . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1348 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1349 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1350 | 1350 | } |
1351 | 1351 | |
1352 | 1352 | /** |
@@ -1355,10 +1355,10 @@ discard block |
||
1355 | 1355 | private function getDQLForUpdate() |
1356 | 1356 | { |
1357 | 1357 | return 'UPDATE' |
1358 | - . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1359 | - . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1360 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1361 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1358 | + . $this->getReducedDQLQueryPart('from', ['pre' => ' ', 'separator' => ', ']) |
|
1359 | + . $this->getReducedDQLQueryPart('set', ['pre' => ' SET ', 'separator' => ', ']) |
|
1360 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1361 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1362 | 1362 | } |
1363 | 1363 | |
1364 | 1364 | /** |
@@ -1367,8 +1367,8 @@ discard block |
||
1367 | 1367 | private function getDQLForSelect() |
1368 | 1368 | { |
1369 | 1369 | $dql = 'SELECT' |
1370 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1371 | - . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1370 | + . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1371 | + . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
|
1372 | 1372 | |
1373 | 1373 | $fromParts = $this->getDQLPart('from'); |
1374 | 1374 | $joinParts = $this->getDQLPart('join'); |
@@ -1392,10 +1392,10 @@ discard block |
||
1392 | 1392 | } |
1393 | 1393 | |
1394 | 1394 | $dql .= implode(', ', $fromClauses) |
1395 | - . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1396 | - . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1397 | - . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1398 | - . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1395 | + . $this->getReducedDQLQueryPart('where', ['pre' => ' WHERE ']) |
|
1396 | + . $this->getReducedDQLQueryPart('groupBy', ['pre' => ' GROUP BY ', 'separator' => ', ']) |
|
1397 | + . $this->getReducedDQLQueryPart('having', ['pre' => ' HAVING ']) |
|
1398 | + . $this->getReducedDQLQueryPart('orderBy', ['pre' => ' ORDER BY ', 'separator' => ', ']); |
|
1399 | 1399 | |
1400 | 1400 | return $dql; |
1401 | 1401 | } |
@@ -1415,8 +1415,8 @@ discard block |
||
1415 | 1415 | } |
1416 | 1416 | |
1417 | 1417 | return ($options['pre'] ?? '') |
1418 | - . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1419 | - . ($options['post'] ?? ''); |
|
1418 | + . (is_array($queryPart) ? implode($options['separator'], $queryPart) : $queryPart) |
|
1419 | + . ($options['post'] ?? ''); |
|
1420 | 1420 | } |
1421 | 1421 | |
1422 | 1422 | /** |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace Doctrine\ORM; |
6 | 6 | |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | public function getParameter($key) |
589 | 589 | { |
590 | 590 | $filteredParameters = $this->parameters->filter( |
591 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
591 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
592 | 592 | $parameterName = $parameter->getName(); |
593 | 593 | |
594 | 594 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | } |
671 | 671 | |
672 | 672 | $isMultiple = is_array($this->dqlParts[$dqlPartName]) |
673 | - && !($dqlPartName == 'join' && !$append); |
|
673 | + && ! ($dqlPartName == 'join' && ! $append); |
|
674 | 674 | |
675 | 675 | // Allow adding any part retrieved from self::getDQLParts(). |
676 | 676 | if (is_array($dqlPart) && $dqlPartName != 'join') { |
@@ -887,7 +887,7 @@ discard block |
||
887 | 887 | { |
888 | 888 | $rootAliases = $this->getRootAliases(); |
889 | 889 | |
890 | - if (!in_array($alias, $rootAliases)) { |
|
890 | + if ( ! in_array($alias, $rootAliases)) { |
|
891 | 891 | throw new Query\QueryException( |
892 | 892 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
893 | 893 | ); |
@@ -1287,14 +1287,14 @@ discard block |
||
1287 | 1287 | foreach ($criteria->getOrderings() as $sort => $order) { |
1288 | 1288 | $hasValidAlias = false; |
1289 | 1289 | foreach ($allAliases as $alias) { |
1290 | - if (strpos($sort . '.', $alias . '.') === 0) { |
|
1290 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
1291 | 1291 | $hasValidAlias = true; |
1292 | 1292 | break; |
1293 | 1293 | } |
1294 | 1294 | } |
1295 | 1295 | |
1296 | - if (!$hasValidAlias) { |
|
1297 | - $sort = $allAliases[0] . '.' . $sort; |
|
1296 | + if ( ! $hasValidAlias) { |
|
1297 | + $sort = $allAliases[0].'.'.$sort; |
|
1298 | 1298 | } |
1299 | 1299 | |
1300 | 1300 | $this->addOrderBy($sort, $order); |
@@ -1367,7 +1367,7 @@ discard block |
||
1367 | 1367 | private function getDQLForSelect() |
1368 | 1368 | { |
1369 | 1369 | $dql = 'SELECT' |
1370 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
1370 | + . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
1371 | 1371 | . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
1372 | 1372 | |
1373 | 1373 | $fromParts = $this->getDQLPart('from'); |
@@ -1383,7 +1383,7 @@ discard block |
||
1383 | 1383 | |
1384 | 1384 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
1385 | 1385 | foreach ($joinParts[$from->getAlias()] as $join) { |
1386 | - $fromClause .= ' ' . ((string) $join); |
|
1386 | + $fromClause .= ' '.((string) $join); |
|
1387 | 1387 | } |
1388 | 1388 | } |
1389 | 1389 |