@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @param string $field |
| 121 | 121 | * @param array $args |
| 122 | 122 | * |
| 123 | - * @return object |
|
| 123 | + * @return PersistentObject |
|
| 124 | 124 | * |
| 125 | 125 | * @throws \BadMethodCallException When no persistent field exists by that name. |
| 126 | 126 | * @throws \InvalidArgumentException When the wrong target object type is passed to an association. |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | * @param string $field |
| 208 | 208 | * @param array $args |
| 209 | 209 | * |
| 210 | - * @return object |
|
| 210 | + * @return PersistentObject |
|
| 211 | 211 | * |
| 212 | 212 | * @throws \BadMethodCallException |
| 213 | 213 | * @throws \InvalidArgumentException |
@@ -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 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | if ($entityManager !== self::$entityManager) { |
| 91 | 91 | throw new \RuntimeException( |
| 92 | - "Trying to use PersistentObject with different EntityManager instances. " . |
|
| 92 | + "Trying to use PersistentObject with different EntityManager instances. ". |
|
| 93 | 93 | "Was PersistentObject::setEntityManager() called?" |
| 94 | 94 | ); |
| 95 | 95 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | $property = $this->cm->getProperty($field); |
| 116 | 116 | |
| 117 | - if (! $property) { |
|
| 117 | + if ( ! $property) { |
|
| 118 | 118 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $property = $this->cm->getProperty($field); |
| 155 | 155 | |
| 156 | - if (! $property) { |
|
| 156 | + if ( ! $property) { |
|
| 157 | 157 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $mappedByField = $property->getMappedBy(); |
| 180 | 180 | $targetMetadata = self::$entityManager->getClassMetadata($property->getTargetEntity()); |
| 181 | 181 | $targetProperty = $targetMetadata->getProperty($mappedByField); |
| 182 | - $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set') . $mappedByField; |
|
| 182 | + $setterMethodName = ($targetProperty instanceof ToManyAssociationMetadata ? 'add' : 'set').$mappedByField; |
|
| 183 | 183 | |
| 184 | 184 | $targetObject->$setterMethodName($this); |
| 185 | 185 | } |
@@ -201,21 +201,21 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | $property = $this->cm->getProperty($field); |
| 203 | 203 | |
| 204 | - if (! $property) { |
|
| 204 | + if ( ! $property) { |
|
| 205 | 205 | throw new \BadMethodCallException("no field with name '".$field."' exists on '".$this->cm->getClassName()."'"); |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | - if (! ($property instanceof ToManyAssociationMetadata)) { |
|
| 208 | + if ( ! ($property instanceof ToManyAssociationMetadata)) { |
|
| 209 | 209 | throw new \BadMethodCallException("There is no method add".$field."() on ".$this->cm->getClassName()); |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | $targetClassName = $property->getTargetEntity(); |
| 213 | 213 | |
| 214 | - if (! ($args[0] instanceof $targetClassName)) { |
|
| 214 | + if ( ! ($args[0] instanceof $targetClassName)) { |
|
| 215 | 215 | throw new \InvalidArgumentException("Expected persistent object of type '".$targetClassName."'"); |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | - if (! ($this->$field instanceof Collection)) { |
|
| 218 | + if ( ! ($this->$field instanceof Collection)) { |
|
| 219 | 219 | $this->$field = new ArrayCollection($this->$field ?: []); |
| 220 | 220 | } |
| 221 | 221 | |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | return; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - if (!self::$entityManager) { |
|
| 242 | + if ( ! self::$entityManager) { |
|
| 243 | 243 | throw new \RuntimeException("No runtime entity manager set. Call PersistentObject#setEntityManager()."); |
| 244 | 244 | } |
| 245 | 245 | |
@@ -22,7 +22,6 @@ |
||
| 22 | 22 | namespace Doctrine\ORM\Persisters\Collection; |
| 23 | 23 | |
| 24 | 24 | use Doctrine\Common\Collections\Criteria; |
| 25 | -use Doctrine\ORM\Mapping\AssociationMetadata; |
|
| 26 | 25 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 27 | 26 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
| 28 | 27 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
@@ -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\Collection; |
| 6 | 6 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $association = $collection->getMapping(); |
| 33 | 33 | |
| 34 | - if (! $association->isOwningSide()) { |
|
| 34 | + if ( ! $association->isOwningSide()) { |
|
| 35 | 35 | return; // ignore inverse side |
| 36 | 36 | } |
| 37 | 37 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $association = $collection->getMapping(); |
| 58 | 58 | |
| 59 | - if (! $association->isOwningSide()) { |
|
| 59 | + if ( ! $association->isOwningSide()) { |
|
| 60 | 60 | return; // ignore inverse side |
| 61 | 61 | } |
| 62 | 62 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | $association = $collection->getMapping(); |
| 89 | 89 | |
| 90 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 90 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 91 | 91 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
| 92 | 92 | } |
| 93 | 93 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | : $association->getMappedBy() |
| 98 | 98 | ; |
| 99 | 99 | |
| 100 | - $criteria = [ |
|
| 100 | + $criteria = [ |
|
| 101 | 101 | $mappedKey => $collection->getOwner(), |
| 102 | 102 | $association->getIndexedBy() => $index, |
| 103 | 103 | ]; |
@@ -133,11 +133,11 @@ discard block |
||
| 133 | 133 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 134 | 134 | $referencedName = $joinColumn->getReferencedColumnName(); |
| 135 | 135 | |
| 136 | - if (! $joinColumn->getType()) { |
|
| 136 | + if ( ! $joinColumn->getType()) { |
|
| 137 | 137 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em)); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - $conditions[] = 't.' . $quotedColumnName . ' = ?'; |
|
| 140 | + $conditions[] = 't.'.$quotedColumnName.' = ?'; |
|
| 141 | 141 | $params[] = $id[$sourceClass->fieldNames[$referencedName]]; |
| 142 | 142 | $types[] = $joinColumn->getType(); |
| 143 | 143 | } |
@@ -166,9 +166,9 @@ discard block |
||
| 166 | 166 | }*/ |
| 167 | 167 | |
| 168 | 168 | $sql = 'SELECT COUNT(*)' |
| 169 | - . ' FROM ' . $joinTableName . ' t' |
|
| 169 | + . ' FROM '.$joinTableName.' t' |
|
| 170 | 170 | . $joinTargetEntitySQL |
| 171 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
| 171 | + . ' WHERE '.implode(' AND ', $conditions); |
|
| 172 | 172 | |
| 173 | 173 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
| 174 | 174 | } |
@@ -190,13 +190,13 @@ discard block |
||
| 190 | 190 | { |
| 191 | 191 | $association = $collection->getMapping(); |
| 192 | 192 | |
| 193 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 193 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 194 | 194 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
| 198 | 198 | |
| 199 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 199 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 200 | 200 | |
| 201 | 201 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 202 | 202 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
| 214 | 214 | |
| 215 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 215 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 216 | 216 | |
| 217 | 217 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 218 | 218 | } |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | |
| 229 | 229 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false); |
| 230 | 230 | |
| 231 | - $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 231 | + $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 232 | 232 | |
| 233 | 233 | return (bool) $this->conn->executeUpdate($sql, $params, $types); |
| 234 | 234 | } |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $onConditions = $this->getOnConditionSQL($association); |
| 247 | 247 | $whereClauses = $params = $types = []; |
| 248 | 248 | |
| 249 | - if (! $association->isOwningSide()) { |
|
| 249 | + if ( ! $association->isOwningSide()) { |
|
| 250 | 250 | $association = $targetClass->getProperty($association->getMappedBy()); |
| 251 | 251 | $joinColumns = $association->getJoinTable()->getInverseJoinColumns(); |
| 252 | 252 | } else { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 258 | 258 | $referencedName = $joinColumn->getReferencedColumnName(); |
| 259 | 259 | |
| 260 | - if (! $joinColumn->getType()) { |
|
| 260 | + if ( ! $joinColumn->getType()) { |
|
| 261 | 261 | $joinColumn->setType( |
| 262 | 262 | PersisterHelper::getTypeOfColumn($referencedName, $ownerMetadata, $this->em) |
| 263 | 263 | ); |
@@ -287,11 +287,11 @@ discard block |
||
| 287 | 287 | |
| 288 | 288 | $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te'); |
| 289 | 289 | |
| 290 | - $sql = 'SELECT ' . $resultSetMapping->generateSelectClause() |
|
| 291 | - . ' FROM ' . $tableName . ' te' |
|
| 292 | - . ' JOIN ' . $joinTableName . ' t ON' |
|
| 290 | + $sql = 'SELECT '.$resultSetMapping->generateSelectClause() |
|
| 291 | + . ' FROM '.$tableName.' te' |
|
| 292 | + . ' JOIN '.$joinTableName.' t ON' |
|
| 293 | 293 | . implode(' AND ', $onConditions) |
| 294 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 294 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
| 295 | 295 | |
| 296 | 296 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
| 297 | 297 | $sql .= $this->getLimitSql($criteria); |
@@ -328,8 +328,8 @@ discard block |
||
| 328 | 328 | |
| 329 | 329 | // A join is needed if there is filtering on the target entity |
| 330 | 330 | $tableName = $rootClass->table->getQuotedQualifiedName($this->platform); |
| 331 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
| 332 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($association)); |
|
| 331 | + $joinSql = ' JOIN '.$tableName.' te' |
|
| 332 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($association)); |
|
| 333 | 333 | |
| 334 | 334 | return [$joinSql, $filterSql]; |
| 335 | 335 | } |
@@ -348,18 +348,18 @@ discard block |
||
| 348 | 348 | |
| 349 | 349 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 350 | 350 | if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 351 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 351 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | - if (! $filterClauses) { |
|
| 355 | + if ( ! $filterClauses) { |
|
| 356 | 356 | return ''; |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | $filterSql = implode(' AND ', $filterClauses); |
| 360 | 360 | |
| 361 | 361 | return count($filterClauses) > 1 |
| 362 | - ? '(' . $filterSql . ')' |
|
| 362 | + ? '('.$filterSql.')' |
|
| 363 | 363 | : $filterSql |
| 364 | 364 | ; |
| 365 | 365 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 391 | 391 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
| 392 | 392 | |
| 393 | - $conditions[] = ' t.' . $quotedColumnName . ' = ' . 'te.' . $quotedReferencedColumnName; |
|
| 393 | + $conditions[] = ' t.'.$quotedColumnName.' = '.'te.'.$quotedReferencedColumnName; |
|
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | return $conditions; |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | - return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 415 | + return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /** |
@@ -603,7 +603,7 @@ discard block |
||
| 603 | 603 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 604 | 604 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
| 605 | 605 | |
| 606 | - if (! $owningAssociation->isOwningSide()) { |
|
| 606 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 607 | 607 | $owningAssociation = $targetClass->getProperty($owningAssociation->getMappedBy()); |
| 608 | 608 | $joinTable = $owningAssociation->getJoinTable(); |
| 609 | 609 | $joinColumns = $joinTable->getJoinColumns(); |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | $joinTableName = $joinTable->getQuotedQualifiedName($this->platform); |
| 618 | - $quotedJoinTable = $joinTableName . ' t'; |
|
| 618 | + $quotedJoinTable = $joinTableName.' t'; |
|
| 619 | 619 | $whereClauses = []; |
| 620 | 620 | $params = []; |
| 621 | 621 | $types = []; |
@@ -628,39 +628,39 @@ discard block |
||
| 628 | 628 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 629 | 629 | $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName()); |
| 630 | 630 | |
| 631 | - $joinConditions[] = ' t.' . $quotedColumnName . ' = ' . 'tr.' . $quotedReferencedColumnName; |
|
| 631 | + $joinConditions[] = ' t.'.$quotedColumnName.' = '.'tr.'.$quotedReferencedColumnName; |
|
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
| 635 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
| 635 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
| 636 | 636 | $columnName = $targetClass->getProperty($indexBy)->getColumnName(); |
| 637 | 637 | |
| 638 | - $whereClauses[] = 'tr.' . $this->platform->quoteIdentifier($columnName) . ' = ?'; |
|
| 638 | + $whereClauses[] = 'tr.'.$this->platform->quoteIdentifier($columnName).' = ?'; |
|
| 639 | 639 | $params[] = $key; |
| 640 | 640 | $types[] = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em); |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | foreach ($inverseJoinColumns as $joinColumn) { |
| 644 | - if (! $joinColumn->getType()) { |
|
| 644 | + if ( ! $joinColumn->getType()) { |
|
| 645 | 645 | $joinColumn->setType( |
| 646 | 646 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $sourceClass, $this->em) |
| 647 | 647 | ); |
| 648 | 648 | } |
| 649 | 649 | |
| 650 | - $whereClauses[] = 't.' . $this->platform->quoteIdentifier($joinColumn->getColumnName()) . ' = ?'; |
|
| 650 | + $whereClauses[] = 't.'.$this->platform->quoteIdentifier($joinColumn->getColumnName()).' = ?'; |
|
| 651 | 651 | $params[] = $id[$sourceClass->fieldNames[$joinColumn->getReferencedColumnName()]]; |
| 652 | 652 | $types[] = $joinColumn->getType(); |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | if ( ! $joinNeeded) { |
| 656 | 656 | foreach ($joinColumns as $joinColumn) { |
| 657 | - if (! $joinColumn->getType()) { |
|
| 657 | + if ( ! $joinColumn->getType()) { |
|
| 658 | 658 | $joinColumn->setType( |
| 659 | 659 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
| 660 | 660 | ); |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | - $whereClauses[] = 't.' . $this->platform->quoteIdentifier($joinColumn->getColumnName()) . ' = ?'; |
|
| 663 | + $whereClauses[] = 't.'.$this->platform->quoteIdentifier($joinColumn->getColumnName()).' = ?'; |
|
| 664 | 664 | $params[] = $key; |
| 665 | 665 | $types[] = $joinColumn->getType(); |
| 666 | 666 | } |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
| 671 | 671 | |
| 672 | 672 | if ($filterSql) { |
| 673 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 673 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 674 | 674 | $whereClauses[] = $filterSql; |
| 675 | 675 | } |
| 676 | 676 | } |
@@ -694,7 +694,7 @@ discard block |
||
| 694 | 694 | $association = $collection->getMapping(); |
| 695 | 695 | $owningAssociation = $association; |
| 696 | 696 | |
| 697 | - if (! $association->isOwningSide()) { |
|
| 697 | + if ( ! $association->isOwningSide()) { |
|
| 698 | 698 | $sourceClass = $this->em->getClassMetadata($association->getTargetEntity()); |
| 699 | 699 | $targetClass = $this->em->getClassMetadata($association->getSourceEntity()); |
| 700 | 700 | $sourceId = $this->uow->getEntityIdentifier($element); |
@@ -719,13 +719,13 @@ discard block |
||
| 719 | 719 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 720 | 720 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 721 | 721 | |
| 722 | - if (! $joinColumn->getType()) { |
|
| 722 | + if ( ! $joinColumn->getType()) { |
|
| 723 | 723 | $joinColumn->setType( |
| 724 | 724 | PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em) |
| 725 | 725 | ); |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
| 728 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
| 729 | 729 | $params[] = $sourceId[$sourceClass->fieldNames[$referencedColumnName]]; |
| 730 | 730 | $types[] = $joinColumn->getType(); |
| 731 | 731 | } |
@@ -734,13 +734,13 @@ discard block |
||
| 734 | 734 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 735 | 735 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 736 | 736 | |
| 737 | - if (! $joinColumn->getType()) { |
|
| 737 | + if ( ! $joinColumn->getType()) { |
|
| 738 | 738 | $joinColumn->setType( |
| 739 | 739 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
| 740 | 740 | ); |
| 741 | 741 | } |
| 742 | 742 | |
| 743 | - $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?'; |
|
| 743 | + $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?'; |
|
| 744 | 744 | $params[] = $targetId[$targetClass->fieldNames[$referencedColumnName]]; |
| 745 | 745 | $types[] = $joinColumn->getType(); |
| 746 | 746 | } |
@@ -751,7 +751,7 @@ discard block |
||
| 751 | 751 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association); |
| 752 | 752 | |
| 753 | 753 | if ($filterSql) { |
| 754 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 754 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 755 | 755 | $whereClauses[] = $filterSql; |
| 756 | 756 | } |
| 757 | 757 | } |
@@ -800,10 +800,10 @@ discard block |
||
| 800 | 800 | $property = $targetClass->getProperty($name); |
| 801 | 801 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 802 | 802 | |
| 803 | - $orderBy[] = $columnName . ' ' . $direction; |
|
| 803 | + $orderBy[] = $columnName.' '.$direction; |
|
| 804 | 804 | } |
| 805 | 805 | |
| 806 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
| 806 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
| 807 | 807 | } |
| 808 | 808 | return ''; |
| 809 | 809 | } |
@@ -22,7 +22,6 @@ |
||
| 22 | 22 | namespace Doctrine\ORM\Persisters\Collection; |
| 23 | 23 | |
| 24 | 24 | use Doctrine\Common\Collections\Criteria; |
| 25 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
| 26 | 25 | use Doctrine\ORM\Mapping\InheritanceType; |
| 27 | 26 | use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
| 28 | 27 | use Doctrine\ORM\PersistentCollection; |
@@ -145,9 +145,9 @@ discard block |
||
| 145 | 145 | return (bool) $persister->count($criteria); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - /** |
|
| 149 | - * {@inheritdoc} |
|
| 150 | - */ |
|
| 148 | + /** |
|
| 149 | + * {@inheritdoc} |
|
| 150 | + */ |
|
| 151 | 151 | public function contains(PersistentCollection $collection, $element) |
| 152 | 152 | { |
| 153 | 153 | if ( ! $this->isValidEntityState($element)) { |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | |
| 266 | 266 | // 2) Build insert table records into temporary table |
| 267 | 267 | $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
| 268 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
| 268 | + . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
| 269 | 269 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
| 270 | 270 | |
| 271 | 271 | $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
@@ -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\Collection; |
| 6 | 6 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | // the entire collection with a new would trigger this operation. |
| 31 | 31 | $association = $collection->getMapping(); |
| 32 | 32 | |
| 33 | - if (! $association->isOrphanRemoval()) { |
|
| 33 | + if ( ! $association->isOrphanRemoval()) { |
|
| 34 | 34 | // Handling non-orphan removal should never happen, as @OneToMany |
| 35 | 35 | // can only be inverse side. For owning side one to many, it is |
| 36 | 36 | // required to have a join table, which would classify as a ManyToManyPersister. |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | { |
| 63 | 63 | $association = $collection->getMapping(); |
| 64 | 64 | |
| 65 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 65 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 66 | 66 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
| 67 | 67 | } |
| 68 | 68 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | { |
| 112 | 112 | $association = $collection->getMapping(); |
| 113 | 113 | |
| 114 | - if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 114 | + if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) { |
|
| 115 | 115 | throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections."); |
| 116 | 116 | } |
| 117 | 117 | |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | // only works with single id identifier entities. Will throw an |
| 121 | 121 | // exception in Entity Persisters if that is not the case for the |
| 122 | 122 | // 'mappedBy' field. |
| 123 | - $criteria = [ |
|
| 123 | + $criteria = [ |
|
| 124 | 124 | $association->getMappedBy() => $collection->getOwner(), |
| 125 | 125 | $association->getIndexedBy() => $key, |
| 126 | 126 | ]; |
@@ -157,12 +157,12 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | $association = $collection->getMapping(); |
| 159 | 159 | |
| 160 | - if (! $association->isOrphanRemoval()) { |
|
| 160 | + if ( ! $association->isOrphanRemoval()) { |
|
| 161 | 161 | // no-op: this is not the owning side, therefore no operations should be applied |
| 162 | 162 | return false; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | - if (! $this->isValidEntityState($element)) { |
|
| 165 | + if ( ! $this->isValidEntityState($element)) { |
|
| 166 | 166 | return false; |
| 167 | 167 | } |
| 168 | 168 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | $tableName = $targetClass->table->getQuotedQualifiedName($this->platform); |
| 205 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 205 | + $statement = 'DELETE FROM '.$tableName.' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 206 | 206 | |
| 207 | 207 | return $this->conn->executeUpdate($statement, $parameters); |
| 208 | 208 | } |
@@ -241,17 +241,17 @@ discard block |
||
| 241 | 241 | ]; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $statement = $this->platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable |
|
| 245 | - . ' (' . $this->platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 244 | + $statement = $this->platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable |
|
| 245 | + . ' ('.$this->platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 246 | 246 | |
| 247 | 247 | $this->conn->executeUpdate($statement); |
| 248 | 248 | |
| 249 | 249 | // 2) Build insert table records into temporary table |
| 250 | - $dql = ' SELECT t0.' . implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
| 251 | - . ' FROM ' . $targetClass->getClassName() . ' t0 WHERE t0.' . $association->getMappedBy() . ' = :owner'; |
|
| 250 | + $dql = ' SELECT t0.'.implode(', t0.', $rootClass->getIdentifierFieldNames()) |
|
| 251 | + . ' FROM '.$targetClass->getClassName().' t0 WHERE t0.'.$association->getMappedBy().' = :owner'; |
|
| 252 | 252 | $query = $this->em->createQuery($dql)->setParameter('owner', $collection->getOwner()); |
| 253 | 253 | |
| 254 | - $statement = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ') ' . $query->getSQL(); |
|
| 254 | + $statement = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.') '.$query->getSQL(); |
|
| 255 | 255 | $parameters = array_values($sourcePersister->getIdentifier($collection->getOwner())); |
| 256 | 256 | $numDeleted = $this->conn->executeUpdate($statement, $parameters); |
| 257 | 257 | |
@@ -265,8 +265,8 @@ discard block |
||
| 265 | 265 | foreach (array_reverse($classNames) as $className) { |
| 266 | 266 | $parentClass = $this->em->getClassMetadata($className); |
| 267 | 267 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 268 | - $statement = 'DELETE FROM ' . $tableName . ' WHERE (' . $idColumnNameList . ')' |
|
| 269 | - . ' IN (SELECT ' . $idColumnNameList . ' FROM ' . $tempTable . ')'; |
|
| 268 | + $statement = 'DELETE FROM '.$tableName.' WHERE ('.$idColumnNameList.')' |
|
| 269 | + . ' IN (SELECT '.$idColumnNameList.' FROM '.$tempTable.')'; |
|
| 270 | 270 | |
| 271 | 271 | $this->conn->executeUpdate($statement); |
| 272 | 272 | } |
@@ -1409,7 +1409,6 @@ |
||
| 1409 | 1409 | * Gets the SQL join fragment used when selecting entities from a |
| 1410 | 1410 | * many-to-many association. |
| 1411 | 1411 | * |
| 1412 | - * @param ManyToManyAssociationMetadata $manyToMany |
|
| 1413 | 1412 | * |
| 1414 | 1413 | * @return string |
| 1415 | 1414 | */ |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | |
| 324 | 324 | // FIXME: Order with composite keys might not be correct |
| 325 | 325 | $sql = 'SELECT ' . $columnName |
| 326 | - . ' FROM ' . $tableName |
|
| 327 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 326 | + . ' FROM ' . $tableName |
|
| 327 | + . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 328 | 328 | |
| 329 | 329 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 330 | 330 | $versionType = $versionProperty->getType(); |
@@ -457,8 +457,8 @@ discard block |
||
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | $sql = 'UPDATE ' . $quotedTableName |
| 460 | - . ' SET ' . implode(', ', $set) |
|
| 461 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 460 | + . ' SET ' . implode(', ', $set) |
|
| 461 | + . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 462 | 462 | |
| 463 | 463 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 464 | 464 | |
@@ -1626,9 +1626,9 @@ discard block |
||
| 1626 | 1626 | $lock = $this->getLockTablesSql($lockMode); |
| 1627 | 1627 | $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
| 1628 | 1628 | $sql = 'SELECT 1 ' |
| 1629 | - . $lock |
|
| 1630 | - . $where |
|
| 1631 | - . $lockSql; |
|
| 1629 | + . $lock |
|
| 1630 | + . $where |
|
| 1631 | + . $lockSql; |
|
| 1632 | 1632 | |
| 1633 | 1633 | list($params, $types) = $this->expandParameters($criteria); |
| 1634 | 1634 | |
@@ -2107,8 +2107,8 @@ discard block |
||
| 2107 | 2107 | $alias = $this->getSQLTableAlias($this->class->getTableName()); |
| 2108 | 2108 | |
| 2109 | 2109 | $sql = 'SELECT 1 ' |
| 2110 | - . $this->getLockTablesSql(null) |
|
| 2111 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2110 | + . $this->getLockTablesSql(null) |
|
| 2111 | + . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2112 | 2112 | |
| 2113 | 2113 | list($params, $types) = $this->expandParameters($criteria); |
| 2114 | 2114 | |
@@ -2142,9 +2142,9 @@ discard block |
||
| 2142 | 2142 | |
| 2143 | 2143 | // if one of the join columns is nullable, return left join |
| 2144 | 2144 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2145 | - if (! $joinColumn->isNullable()) { |
|
| 2146 | - continue; |
|
| 2147 | - } |
|
| 2145 | + if (! $joinColumn->isNullable()) { |
|
| 2146 | + continue; |
|
| 2147 | + } |
|
| 2148 | 2148 | |
| 2149 | 2149 | return 'LEFT JOIN'; |
| 2150 | 2150 | } |
@@ -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 | $quotedJoinColumnName = $this->platform->quoteIdentifier($joinColumnName); |
| 407 | 407 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 408 | 408 | |
| 409 | - if (! $joinColumn->getType()) { |
|
| 409 | + if ( ! $joinColumn->getType()) { |
|
| 410 | 410 | $joinColumn->setType( |
| 411 | 411 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
| 412 | 412 | ); |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | $type = $column->getType(); |
| 449 | 449 | $placeholder = $type->convertToDatabaseValueSQL('?', $this->platform); |
| 450 | 450 | |
| 451 | - $set[] = $quotedColumnName . ' = ' . $placeholder; |
|
| 451 | + $set[] = $quotedColumnName.' = '.$placeholder; |
|
| 452 | 452 | $params[] = $value; |
| 453 | 453 | $types[] = $type; |
| 454 | 454 | } |
@@ -475,7 +475,7 @@ discard block |
||
| 475 | 475 | /** @var JoinColumnMetadata $joinColumn */ |
| 476 | 476 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 477 | 477 | |
| 478 | - if (! $joinColumn->getType()) { |
|
| 478 | + if ( ! $joinColumn->getType()) { |
|
| 479 | 479 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 480 | 480 | |
| 481 | 481 | $joinColumn->setType( |
@@ -504,18 +504,18 @@ discard block |
||
| 504 | 504 | case Type::SMALLINT: |
| 505 | 505 | case Type::INTEGER: |
| 506 | 506 | case Type::BIGINT: |
| 507 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 507 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 508 | 508 | break; |
| 509 | 509 | |
| 510 | 510 | case Type::DATETIME: |
| 511 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 511 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 512 | 512 | break; |
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 517 | - . ' SET ' . implode(', ', $set) |
|
| 518 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 516 | + $sql = 'UPDATE '.$quotedTableName |
|
| 517 | + . ' SET '.implode(', ', $set) |
|
| 518 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 519 | 519 | |
| 520 | 520 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 521 | 521 | |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | protected function deleteJoinTableRecords($identifier) |
| 535 | 535 | { |
| 536 | 536 | foreach ($this->class->getProperties() as $association) { |
| 537 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 537 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 538 | 538 | continue; |
| 539 | 539 | } |
| 540 | 540 | |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $keys = []; |
| 548 | 548 | |
| 549 | 549 | if ( ! $owningAssociation->isOwningSide()) { |
| 550 | - $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 550 | + $class = $this->em->getClassMetadata($association->getTargetEntity()); |
|
| 551 | 551 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 552 | 552 | } |
| 553 | 553 | |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | // Only owning side of x-1 associations can have a FK column. |
| 662 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 662 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 663 | 663 | continue; |
| 664 | 664 | } |
| 665 | 665 | |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | /** @var JoinColumnMetadata $joinColumn */ |
| 680 | 680 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 681 | 681 | |
| 682 | - if (! $joinColumn->getType()) { |
|
| 682 | + if ( ! $joinColumn->getType()) { |
|
| 683 | 683 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 684 | 684 | |
| 685 | 685 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
@@ -710,7 +710,7 @@ discard block |
||
| 710 | 710 | $propertyName = $this->class->fieldNames[$columnName]; |
| 711 | 711 | $property = $this->class->getProperty($propertyName); |
| 712 | 712 | |
| 713 | - if (! $property) { |
|
| 713 | + if ( ! $property) { |
|
| 714 | 714 | return null; |
| 715 | 715 | } |
| 716 | 716 | |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | /** @var JoinColumnMetadata $joinColumn */ |
| 729 | 729 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 730 | 730 | |
| 731 | - if (! $joinColumn->getType()) { |
|
| 731 | + if ( ! $joinColumn->getType()) { |
|
| 732 | 732 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 733 | 733 | |
| 734 | 734 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | // unset the old value and set the new sql aliased value here. By definition |
| 848 | 848 | // unset($identifier[$targetKeyColumn] works here with how UnitOfWork::createEntity() calls this method. |
| 849 | 849 | // @todo guilhermeblanco In master we have: $identifier[$targetClass->getFieldForColumn($targetKeyColumn)] = |
| 850 | - $identifier[$targetTableAlias . "." . $targetKeyColumn] = $value; |
|
| 850 | + $identifier[$targetTableAlias.".".$targetKeyColumn] = $value; |
|
| 851 | 851 | |
| 852 | 852 | unset($identifier[$targetKeyColumn]); |
| 853 | 853 | } |
@@ -1067,7 +1067,7 @@ discard block |
||
| 1067 | 1067 | $criteria = []; |
| 1068 | 1068 | $parameters = []; |
| 1069 | 1069 | |
| 1070 | - if (! $association->isOwningSide()) { |
|
| 1070 | + if ( ! $association->isOwningSide()) { |
|
| 1071 | 1071 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1072 | 1072 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1073 | 1073 | } |
@@ -1095,7 +1095,7 @@ discard block |
||
| 1095 | 1095 | $value = $value[$targetClass->identifier[0]]; |
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1098 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1099 | 1099 | $parameters[] = [ |
| 1100 | 1100 | 'value' => $value, |
| 1101 | 1101 | 'field' => $fieldName, |
@@ -1146,11 +1146,11 @@ discard block |
||
| 1146 | 1146 | |
| 1147 | 1147 | switch ($lockMode) { |
| 1148 | 1148 | case LockMode::PESSIMISTIC_READ: |
| 1149 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1149 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1150 | 1150 | break; |
| 1151 | 1151 | |
| 1152 | 1152 | case LockMode::PESSIMISTIC_WRITE: |
| 1153 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1153 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1154 | 1154 | break; |
| 1155 | 1155 | } |
| 1156 | 1156 | |
@@ -1161,14 +1161,14 @@ discard block |
||
| 1161 | 1161 | |
| 1162 | 1162 | if ('' !== $filterSql) { |
| 1163 | 1163 | $conditionSql = $conditionSql |
| 1164 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1164 | + ? $conditionSql.' AND '.$filterSql |
|
| 1165 | 1165 | : $filterSql; |
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | - $select = 'SELECT ' . $columnList; |
|
| 1169 | - $from = ' FROM ' . $tableName . ' '. $tableAlias; |
|
| 1170 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1171 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1168 | + $select = 'SELECT '.$columnList; |
|
| 1169 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1170 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1171 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1172 | 1172 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1173 | 1173 | $query = $select |
| 1174 | 1174 | . $lock |
@@ -1176,7 +1176,7 @@ discard block |
||
| 1176 | 1176 | . $where |
| 1177 | 1177 | . $orderBySql; |
| 1178 | 1178 | |
| 1179 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1179 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | 1182 | /** |
@@ -1195,13 +1195,13 @@ discard block |
||
| 1195 | 1195 | |
| 1196 | 1196 | if ('' !== $filterSql) { |
| 1197 | 1197 | $conditionSql = $conditionSql |
| 1198 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1198 | + ? $conditionSql.' AND '.$filterSql |
|
| 1199 | 1199 | : $filterSql; |
| 1200 | 1200 | } |
| 1201 | 1201 | |
| 1202 | 1202 | $sql = 'SELECT COUNT(*) ' |
| 1203 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1204 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1203 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1204 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1205 | 1205 | |
| 1206 | 1206 | return $sql; |
| 1207 | 1207 | } |
@@ -1218,7 +1218,7 @@ discard block |
||
| 1218 | 1218 | */ |
| 1219 | 1219 | protected final function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1220 | 1220 | { |
| 1221 | - if (! $orderBy) { |
|
| 1221 | + if ( ! $orderBy) { |
|
| 1222 | 1222 | return ''; |
| 1223 | 1223 | } |
| 1224 | 1224 | |
@@ -1227,7 +1227,7 @@ discard block |
||
| 1227 | 1227 | foreach ($orderBy as $fieldName => $orientation) { |
| 1228 | 1228 | $orientation = strtoupper(trim($orientation)); |
| 1229 | 1229 | |
| 1230 | - if (! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1230 | + if ( ! in_array($orientation, ['ASC', 'DESC'])) { |
|
| 1231 | 1231 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
| 1232 | 1232 | } |
| 1233 | 1233 | |
@@ -1237,11 +1237,11 @@ discard block |
||
| 1237 | 1237 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1238 | 1238 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1239 | 1239 | |
| 1240 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1240 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1241 | 1241 | |
| 1242 | 1242 | continue; |
| 1243 | 1243 | } else if ($property instanceof AssociationMetadata) { |
| 1244 | - if (! $property->isOwningSide()) { |
|
| 1244 | + if ( ! $property->isOwningSide()) { |
|
| 1245 | 1245 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName); |
| 1246 | 1246 | } |
| 1247 | 1247 | |
@@ -1254,7 +1254,7 @@ discard block |
||
| 1254 | 1254 | /* @var JoinColumnMetadata $joinColumn */ |
| 1255 | 1255 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1256 | 1256 | |
| 1257 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1257 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | 1260 | continue; |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | throw ORMException::unrecognizedField($fieldName); |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1266 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1267 | 1267 | } |
| 1268 | 1268 | |
| 1269 | 1269 | /** |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | |
| 1286 | 1286 | |
| 1287 | 1287 | $this->currentPersisterContext->rsm->addEntityResult($this->class->getClassName(), 'r'); // r for root |
| 1288 | - $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1288 | + $this->currentPersisterContext->selectJoinSql = ''; |
|
| 1289 | 1289 | |
| 1290 | 1290 | $eagerAliasCounter = 0; |
| 1291 | 1291 | $columnList = []; |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | break; // now this is why you shouldn't use inheritance |
| 1322 | 1322 | } |
| 1323 | 1323 | |
| 1324 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1324 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1325 | 1325 | |
| 1326 | 1326 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1327 | 1327 | |
@@ -1345,14 +1345,14 @@ discard block |
||
| 1345 | 1345 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | - if (! $property->isOwningSide()) { |
|
| 1348 | + if ( ! $property->isOwningSide()) { |
|
| 1349 | 1349 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1350 | 1350 | } |
| 1351 | 1351 | |
| 1352 | 1352 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1353 | 1353 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1354 | 1354 | |
| 1355 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1355 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1356 | 1356 | |
| 1357 | 1357 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1358 | 1358 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | $joinCondition[] = $filterSql; |
| 1375 | 1375 | } |
| 1376 | 1376 | |
| 1377 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1377 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1378 | 1378 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1379 | 1379 | |
| 1380 | 1380 | break; |
@@ -1398,7 +1398,7 @@ discard block |
||
| 1398 | 1398 | */ |
| 1399 | 1399 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1400 | 1400 | { |
| 1401 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1401 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1402 | 1402 | return ''; |
| 1403 | 1403 | } |
| 1404 | 1404 | |
@@ -1411,7 +1411,7 @@ discard block |
||
| 1411 | 1411 | $quotedColumnName = $this->platform->quoteIdentifier($columnName); |
| 1412 | 1412 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1413 | 1413 | |
| 1414 | - if (! $joinColumn->getType()) { |
|
| 1414 | + if ( ! $joinColumn->getType()) { |
|
| 1415 | 1415 | $joinColumn->setType( |
| 1416 | 1416 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
| 1417 | 1417 | ); |
@@ -1445,7 +1445,7 @@ discard block |
||
| 1445 | 1445 | $owningAssociation = $association; |
| 1446 | 1446 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1447 | 1447 | |
| 1448 | - if (! $association->isOwningSide()) { |
|
| 1448 | + if ( ! $association->isOwningSide()) { |
|
| 1449 | 1449 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1450 | 1450 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1451 | 1451 | } |
@@ -1467,7 +1467,7 @@ discard block |
||
| 1467 | 1467 | ); |
| 1468 | 1468 | } |
| 1469 | 1469 | |
| 1470 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1470 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1471 | 1471 | } |
| 1472 | 1472 | |
| 1473 | 1473 | /** |
@@ -1561,7 +1561,7 @@ discard block |
||
| 1561 | 1561 | $columnName = $joinColumn->getColumnName(); |
| 1562 | 1562 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1563 | 1563 | |
| 1564 | - if (! $joinColumn->getType()) { |
|
| 1564 | + if ( ! $joinColumn->getType()) { |
|
| 1565 | 1565 | $joinColumn->setType( |
| 1566 | 1566 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
| 1567 | 1567 | ); |
@@ -1602,7 +1602,7 @@ discard block |
||
| 1602 | 1602 | |
| 1603 | 1603 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1604 | 1604 | |
| 1605 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1605 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1606 | 1606 | } |
| 1607 | 1607 | |
| 1608 | 1608 | /** |
@@ -1616,14 +1616,14 @@ discard block |
||
| 1616 | 1616 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1617 | 1617 | { |
| 1618 | 1618 | if ($tableName) { |
| 1619 | - $tableName .= '#' . $assocName; |
|
| 1619 | + $tableName .= '#'.$assocName; |
|
| 1620 | 1620 | } |
| 1621 | 1621 | |
| 1622 | 1622 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1623 | 1623 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1626 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1627 | 1627 | |
| 1628 | 1628 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1629 | 1629 | |
@@ -1650,7 +1650,7 @@ discard block |
||
| 1650 | 1650 | } |
| 1651 | 1651 | |
| 1652 | 1652 | $lock = $this->getLockTablesSql($lockMode); |
| 1653 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1653 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1654 | 1654 | $sql = 'SELECT 1 ' |
| 1655 | 1655 | . $lock |
| 1656 | 1656 | . $where |
@@ -1673,7 +1673,7 @@ discard block |
||
| 1673 | 1673 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1674 | 1674 | |
| 1675 | 1675 | return $this->platform->appendLockHint( |
| 1676 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1676 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1677 | 1677 | $lockMode |
| 1678 | 1678 | ); |
| 1679 | 1679 | } |
@@ -1726,19 +1726,19 @@ discard block |
||
| 1726 | 1726 | |
| 1727 | 1727 | if (null !== $comparison) { |
| 1728 | 1728 | // special case null value handling |
| 1729 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null ===$value) { |
|
| 1730 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1729 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && null === $value) { |
|
| 1730 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1731 | 1731 | |
| 1732 | 1732 | continue; |
| 1733 | 1733 | } |
| 1734 | 1734 | |
| 1735 | 1735 | if ($comparison === Comparison::NEQ && null === $value) { |
| 1736 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1736 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1737 | 1737 | |
| 1738 | 1738 | continue; |
| 1739 | 1739 | } |
| 1740 | 1740 | |
| 1741 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1741 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1742 | 1742 | |
| 1743 | 1743 | continue; |
| 1744 | 1744 | } |
@@ -1787,7 +1787,7 @@ discard block |
||
| 1787 | 1787 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1788 | 1788 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1789 | 1789 | |
| 1790 | - return [$tableAlias . '.' . $columnName]; |
|
| 1790 | + return [$tableAlias.'.'.$columnName]; |
|
| 1791 | 1791 | } |
| 1792 | 1792 | |
| 1793 | 1793 | if ($property instanceof AssociationMetadata) { |
@@ -1796,7 +1796,7 @@ discard block |
||
| 1796 | 1796 | |
| 1797 | 1797 | // Many-To-Many requires join table check for joinColumn |
| 1798 | 1798 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1799 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1799 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1800 | 1800 | $owningAssociation = $association; |
| 1801 | 1801 | } |
| 1802 | 1802 | |
@@ -1810,15 +1810,15 @@ discard block |
||
| 1810 | 1810 | foreach ($joinColumns as $joinColumn) { |
| 1811 | 1811 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1812 | 1812 | |
| 1813 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1813 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1814 | 1814 | } |
| 1815 | 1815 | |
| 1816 | 1816 | } else { |
| 1817 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1817 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1818 | 1818 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field); |
| 1819 | 1819 | } |
| 1820 | 1820 | |
| 1821 | - $class = $this->class->isInheritedProperty($field) |
|
| 1821 | + $class = $this->class->isInheritedProperty($field) |
|
| 1822 | 1822 | ? $owningAssociation->getDeclaringClass() |
| 1823 | 1823 | : $this->class |
| 1824 | 1824 | ; |
@@ -1827,7 +1827,7 @@ discard block |
||
| 1827 | 1827 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1828 | 1828 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1829 | 1829 | |
| 1830 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1830 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1831 | 1831 | } |
| 1832 | 1832 | } |
| 1833 | 1833 | |
@@ -1940,7 +1940,7 @@ discard block |
||
| 1940 | 1940 | $value = $value[$targetClass->identifier[0]]; |
| 1941 | 1941 | } |
| 1942 | 1942 | |
| 1943 | - $criteria[$tableAlias . "." . $quotedColumnName] = $value; |
|
| 1943 | + $criteria[$tableAlias.".".$quotedColumnName] = $value; |
|
| 1944 | 1944 | $parameters[] = [ |
| 1945 | 1945 | 'value' => $value, |
| 1946 | 1946 | 'field' => $fieldName, |
@@ -2027,7 +2027,7 @@ discard block |
||
| 2027 | 2027 | case ($property instanceof AssociationMetadata): |
| 2028 | 2028 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2029 | 2029 | |
| 2030 | - if (! $property->isOwningSide()) { |
|
| 2030 | + if ( ! $property->isOwningSide()) { |
|
| 2031 | 2031 | $property = $class->getProperty($property->getMappedBy()); |
| 2032 | 2032 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2033 | 2033 | } |
@@ -2038,7 +2038,7 @@ discard block |
||
| 2038 | 2038 | ; |
| 2039 | 2039 | |
| 2040 | 2040 | foreach ($joinColumns as $joinColumn) { |
| 2041 | - if (! $joinColumn->getType()) { |
|
| 2041 | + if ( ! $joinColumn->getType()) { |
|
| 2042 | 2042 | $joinColumn->setType( |
| 2043 | 2043 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $class, $this->em) |
| 2044 | 2044 | ); |
@@ -2055,7 +2055,7 @@ discard block |
||
| 2055 | 2055 | } |
| 2056 | 2056 | |
| 2057 | 2057 | if (is_array($value)) { |
| 2058 | - return array_map(function ($type) { |
|
| 2058 | + return array_map(function($type) { |
|
| 2059 | 2059 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2060 | 2060 | }, $types); |
| 2061 | 2061 | } |
@@ -2134,12 +2134,12 @@ discard block |
||
| 2134 | 2134 | |
| 2135 | 2135 | $sql = 'SELECT 1 ' |
| 2136 | 2136 | . $this->getLockTablesSql(null) |
| 2137 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2137 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2138 | 2138 | |
| 2139 | 2139 | list($params, $types) = $this->expandParameters($criteria); |
| 2140 | 2140 | |
| 2141 | 2141 | if (null !== $extraConditions) { |
| 2142 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2142 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2143 | 2143 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2144 | 2144 | |
| 2145 | 2145 | $params = array_merge($params, $criteriaParams); |
@@ -2147,7 +2147,7 @@ discard block |
||
| 2147 | 2147 | } |
| 2148 | 2148 | |
| 2149 | 2149 | if ($filterSql = $this->generateFilterConditionSQL($this->class, $alias)) { |
| 2150 | - $sql .= ' AND ' . $filterSql; |
|
| 2150 | + $sql .= ' AND '.$filterSql; |
|
| 2151 | 2151 | } |
| 2152 | 2152 | |
| 2153 | 2153 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2162,13 +2162,13 @@ discard block |
||
| 2162 | 2162 | */ |
| 2163 | 2163 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2164 | 2164 | { |
| 2165 | - if (! $association->isOwningSide()) { |
|
| 2165 | + if ( ! $association->isOwningSide()) { |
|
| 2166 | 2166 | return 'LEFT JOIN'; |
| 2167 | 2167 | } |
| 2168 | 2168 | |
| 2169 | 2169 | // if one of the join columns is nullable, return left join |
| 2170 | 2170 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2171 | - if (! $joinColumn->isNullable()) { |
|
| 2171 | + if ( ! $joinColumn->isNullable()) { |
|
| 2172 | 2172 | continue; |
| 2173 | 2173 | } |
| 2174 | 2174 | |
@@ -2185,7 +2185,7 @@ discard block |
||
| 2185 | 2185 | */ |
| 2186 | 2186 | public function getSQLColumnAlias() |
| 2187 | 2187 | { |
| 2188 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2188 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2189 | 2189 | } |
| 2190 | 2190 | |
| 2191 | 2191 | /** |
@@ -2202,13 +2202,13 @@ discard block |
||
| 2202 | 2202 | |
| 2203 | 2203 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 2204 | 2204 | if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 2205 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2205 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2206 | 2206 | } |
| 2207 | 2207 | } |
| 2208 | 2208 | |
| 2209 | 2209 | $sql = implode(' AND ', $filterClauses); |
| 2210 | 2210 | |
| 2211 | - return $sql ? "(" . $sql . ")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2211 | + return $sql ? "(".$sql.")" : ""; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2212 | 2212 | } |
| 2213 | 2213 | |
| 2214 | 2214 | /** |
@@ -25,8 +25,6 @@ |
||
| 25 | 25 | use Doctrine\DBAL\LockMode; |
| 26 | 26 | use Doctrine\DBAL\Types\Type; |
| 27 | 27 | use Doctrine\ORM\Mapping\AssociationMetadata; |
| 28 | -use Doctrine\ORM\Mapping\ClassMetadata; |
|
| 29 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
| 30 | 28 | use Doctrine\ORM\Mapping\FieldMetadata; |
| 31 | 29 | use Doctrine\ORM\Mapping\GeneratorType; |
| 32 | 30 | use Doctrine\ORM\Mapping\ManyToManyAssociationMetadata; |
@@ -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 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | foreach ($data as $columnName => $value) { |
| 114 | - if (!is_array($id) || !isset($id[$columnName])) { |
|
| 114 | + if ( ! is_array($id) || ! isset($id[$columnName])) { |
|
| 115 | 115 | $type = $this->columns[$columnName]->getType(); |
| 116 | 116 | |
| 117 | 117 | $stmt->bindValue($paramIndex++, $value, $type); |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | if ($filterSql = $this->generateFilterConditionSQL($rootClass, $tableAlias)) { |
| 237 | 237 | $conditionSql .= $conditionSql |
| 238 | - ? ' AND ' . $filterSql |
|
| 238 | + ? ' AND '.$filterSql |
|
| 239 | 239 | : $filterSql; |
| 240 | 240 | } |
| 241 | 241 | |
@@ -243,26 +243,26 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | switch ($lockMode) { |
| 245 | 245 | case LockMode::PESSIMISTIC_READ: |
| 246 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 246 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 247 | 247 | break; |
| 248 | 248 | |
| 249 | 249 | case LockMode::PESSIMISTIC_WRITE: |
| 250 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 250 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 251 | 251 | break; |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 255 | - $from = ' FROM ' . $tableName . ' ' . $baseTableAlias; |
|
| 256 | - $where = $conditionSql !== '' ? ' WHERE ' . $conditionSql : ''; |
|
| 255 | + $from = ' FROM '.$tableName.' '.$baseTableAlias; |
|
| 256 | + $where = $conditionSql !== '' ? ' WHERE '.$conditionSql : ''; |
|
| 257 | 257 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 258 | 258 | $columnList = $this->getSelectColumnsSQL(); |
| 259 | - $query = 'SELECT ' . $columnList |
|
| 259 | + $query = 'SELECT '.$columnList |
|
| 260 | 260 | . $lock |
| 261 | 261 | . $joinSql |
| 262 | 262 | . $where |
| 263 | 263 | . $orderBySql; |
| 264 | 264 | |
| 265 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 265 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | /** |
@@ -284,14 +284,14 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | if ('' !== $filterSql) { |
| 286 | 286 | $conditionSql = $conditionSql |
| 287 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 287 | + ? $conditionSql.' AND '.$filterSql |
|
| 288 | 288 | : $filterSql; |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | $sql = 'SELECT COUNT(*) ' |
| 292 | - . 'FROM ' . $tableName . ' ' . $baseTableAlias |
|
| 292 | + . 'FROM '.$tableName.' '.$baseTableAlias |
|
| 293 | 293 | . $joinSql |
| 294 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 294 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 295 | 295 | |
| 296 | 296 | return $sql; |
| 297 | 297 | } |
@@ -311,18 +311,18 @@ discard block |
||
| 311 | 311 | $parentClass = $this->em->getClassMetadata($parentClassName); |
| 312 | 312 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 313 | 313 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 314 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 314 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 315 | 315 | |
| 316 | 316 | foreach ($identifierColumns as $idColumn) { |
| 317 | 317 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 318 | 318 | |
| 319 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 319 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | $joinSql .= implode(' AND ', $conditions); |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | - return parent::getLockTablesSql($lockMode) . $joinSql; |
|
| 325 | + return parent::getLockTablesSql($lockMode).$joinSql; |
|
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /** |
@@ -349,14 +349,14 @@ discard block |
||
| 349 | 349 | continue; |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | - if (! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 352 | + if ( ! ($property instanceof ToOneAssociationMetadata) || ! $property->isOwningSide()) { |
|
| 353 | 353 | continue; |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 357 | 357 | |
| 358 | 358 | foreach ($property->getJoinColumns() as $joinColumn) { |
| 359 | - if (! $joinColumn->getType()) { |
|
| 359 | + if ( ! $joinColumn->getType()) { |
|
| 360 | 360 | $joinColumn->setType( |
| 361 | 361 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
| 362 | 362 | ); |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
| 377 | 377 | |
| 378 | 378 | $columnList[] = $discrColumnType->convertToDatabaseValueSQL( |
| 379 | - $this->getSQLTableAlias($discrColumn->getTableName()) . '.' . $discrColumnName, |
|
| 379 | + $this->getSQLTableAlias($discrColumn->getTableName()).'.'.$discrColumnName, |
|
| 380 | 380 | $this->platform |
| 381 | 381 | ); |
| 382 | 382 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 404 | 404 | |
| 405 | 405 | foreach ($property->getJoinColumns() as $joinColumn) { |
| 406 | - if (! $joinColumn->getType()) { |
|
| 406 | + if ( ! $joinColumn->getType()) { |
|
| 407 | 407 | $joinColumn->setType( |
| 408 | 408 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
| 409 | 409 | ); |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | $columnName = $joinColumn->getColumnName(); |
| 452 | 452 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 453 | 453 | |
| 454 | - if (! $joinColumn->getType()) { |
|
| 454 | + if ( ! $joinColumn->getType()) { |
|
| 455 | 455 | $joinColumn->setType( |
| 456 | 456 | PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em) |
| 457 | 457 | ); |
@@ -509,12 +509,12 @@ discard block |
||
| 509 | 509 | $parentClass = $this->em->getClassMetadata($parentClassName); |
| 510 | 510 | $tableName = $parentClass->table->getQuotedQualifiedName($this->platform); |
| 511 | 511 | $tableAlias = $this->getSQLTableAlias($parentClass->getTableName()); |
| 512 | - $joinSql .= ' INNER JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 512 | + $joinSql .= ' INNER JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 513 | 513 | |
| 514 | 514 | foreach ($identifierColumns as $idColumn) { |
| 515 | 515 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 516 | 516 | |
| 517 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 517 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | $joinSql .= implode(' AND ', $conditions); |
@@ -526,12 +526,12 @@ discard block |
||
| 526 | 526 | $subClass = $this->em->getClassMetadata($subClassName); |
| 527 | 527 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 528 | 528 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName()); |
| 529 | - $joinSql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 529 | + $joinSql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 530 | 530 | |
| 531 | 531 | foreach ($identifierColumns as $idColumn) { |
| 532 | 532 | $quotedColumnName = $this->platform->quoteIdentifier($idColumn->getColumnName()); |
| 533 | 533 | |
| 534 | - $conditions[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 534 | + $conditions[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 535 | 535 | } |
| 536 | 536 | |
| 537 | 537 | $joinSql .= implode(' AND ', $conditions); |
@@ -25,7 +25,6 @@ |
||
| 25 | 25 | use Doctrine\ORM\Mapping\ClassMetadata; |
| 26 | 26 | use Doctrine\Common\Collections\Criteria; |
| 27 | 27 | use Doctrine\ORM\Mapping\FieldMetadata; |
| 28 | -use Doctrine\ORM\Mapping\ToManyAssociationMetadata; |
|
| 29 | 28 | use Doctrine\ORM\Mapping\ToOneAssociationMetadata; |
| 30 | 29 | use Doctrine\ORM\Utility\PersisterHelper; |
| 31 | 30 | |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | $rootClass = $this->em->getClassMetadata($this->class->getRootClassName()); |
| 57 | 57 | $tableAlias = $this->getSQLTableAlias($rootClass->getTableName()); |
| 58 | 58 | |
| 59 | - // Append discriminator column |
|
| 59 | + // Append discriminator column |
|
| 60 | 60 | $discrColumn = $this->class->discriminatorColumn; |
| 61 | 61 | $discrColumnName = $discrColumn->getColumnName(); |
| 62 | 62 | $discrColumnType = $discrColumn->getType(); |
@@ -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 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $this->currentPersisterContext->rsm->setDiscriminatorColumn('r', $resultColumnName); |
| 50 | 50 | $this->currentPersisterContext->rsm->addMetaResult('r', $resultColumnName, $discrColumnName, false, $discrColumnType); |
| 51 | 51 | |
| 52 | - $columnList[] = $discrColumnType->convertToDatabaseValueSQL($tableAlias . '.' . $quotedColumnName, $this->platform); |
|
| 52 | + $columnList[] = $discrColumnType->convertToDatabaseValueSQL($tableAlias.'.'.$quotedColumnName, $this->platform); |
|
| 53 | 53 | |
| 54 | 54 | // Append subclass columns |
| 55 | 55 | foreach ($this->class->getSubClasses() as $subClassName) { |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 71 | 71 | |
| 72 | 72 | foreach ($property->getJoinColumns() as $joinColumn) { |
| 73 | - if (! $joinColumn->getType()) { |
|
| 73 | + if ( ! $joinColumn->getType()) { |
|
| 74 | 74 | $joinColumn->setType( |
| 75 | 75 | PersisterHelper::getTypeOfColumn($joinColumn->getReferencedColumnName(), $targetClass, $this->em) |
| 76 | 76 | ); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $conditionSql .= ' AND '; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | - return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL(); |
|
| 129 | + return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL(); |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | $conditionSql .= ' AND '; |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - return $conditionSql . $this->getSelectConditionDiscriminatorValueSQL(); |
|
| 143 | + return $conditionSql.$this->getSelectConditionDiscriminatorValueSQL(); |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | |
| 168 | 168 | return sprintf( |
| 169 | 169 | '%s IN (%s)', |
| 170 | - $discrColumnType->convertToDatabaseValueSQL($tableAlias . '.' . $quotedColumnName, $this->platform), |
|
| 170 | + $discrColumnType->convertToDatabaseValueSQL($tableAlias.'.'.$quotedColumnName, $this->platform), |
|
| 171 | 171 | implode(', ', $values) |
| 172 | 172 | ); |
| 173 | 173 | } |
@@ -22,9 +22,7 @@ |
||
| 22 | 22 | namespace Doctrine\ORM\Query\Exec; |
| 23 | 23 | |
| 24 | 24 | use Doctrine\DBAL\Connection; |
| 25 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
| 26 | 25 | use Doctrine\ORM\Query\AST; |
| 27 | -use Doctrine\ORM\Utility\PersisterHelper; |
|
| 28 | 26 | |
| 29 | 27 | /** |
| 30 | 28 | * Executes the SQL statements for bulk DQL DELETE statements on classes in |
@@ -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\Exec; |
| 6 | 6 | |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
| 62 | 62 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $primaryDqlAlias); |
| 63 | 63 | |
| 64 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
| 65 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
| 64 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
| 65 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
| 66 | 66 | |
| 67 | 67 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $primaryDqlAlias); |
| 68 | 68 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | // 2. Create ID subselect statement used in DELETE ... WHERE ... IN (subselect) |
| 77 | - $idSubselect = 'SELECT ' . $idColumnNameList . ' FROM ' . $tempTable; |
|
| 77 | + $idSubselect = 'SELECT '.$idColumnNameList.' FROM '.$tempTable; |
|
| 78 | 78 | |
| 79 | 79 | // 3. Create and store DELETE statements |
| 80 | 80 | $classNames = array_merge( |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | $parentClass = $em->getClassMetadata($className); |
| 88 | 88 | $tableName = $parentClass->table->getQuotedQualifiedName($platform); |
| 89 | 89 | |
| 90 | - $this->sqlStatements[] = 'DELETE FROM ' . $tableName |
|
| 91 | - . ' WHERE (' . $idColumnNameList . ') IN (' . $idSubselect . ')'; |
|
| 90 | + $this->sqlStatements[] = 'DELETE FROM '.$tableName |
|
| 91 | + . ' WHERE ('.$idColumnNameList.') IN ('.$idSubselect.')'; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // 4. Store DDL for temporary identifier table. |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | ]; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
| 105 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 104 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
| 105 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 106 | 106 | |
| 107 | 107 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
| 108 | 108 | } |
@@ -22,10 +22,8 @@ |
||
| 22 | 22 | namespace Doctrine\ORM\Query\Exec; |
| 23 | 23 | |
| 24 | 24 | use Doctrine\DBAL\Connection; |
| 25 | -use Doctrine\ORM\Mapping\ColumnMetadata; |
|
| 26 | 25 | use Doctrine\ORM\Query\AST; |
| 27 | 26 | use Doctrine\ORM\Query\ParameterTypeInferer; |
| 28 | -use Doctrine\ORM\Utility\PersisterHelper; |
|
| 29 | 27 | |
| 30 | 28 | /** |
| 31 | 29 | * Executes the SQL statements for bulk DQL UPDATE statements on classes in |
@@ -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\Exec; |
| 6 | 6 | |
@@ -72,8 +72,8 @@ discard block |
||
| 72 | 72 | // 1. Create an INSERT INTO temptable ... SELECT identifiers WHERE $AST->getWhereClause() |
| 73 | 73 | $sqlWalker->setSQLTableAlias($primaryClass->getTableName(), 'i0', $updateClause->aliasIdentificationVariable); |
| 74 | 74 | |
| 75 | - $this->insertSql = 'INSERT INTO ' . $tempTable . ' (' . $idColumnNameList . ')' |
|
| 76 | - . ' SELECT i0.' . implode(', i0.', array_keys($idColumns)); |
|
| 75 | + $this->insertSql = 'INSERT INTO '.$tempTable.' ('.$idColumnNameList.')' |
|
| 76 | + . ' SELECT i0.'.implode(', i0.', array_keys($idColumns)); |
|
| 77 | 77 | |
| 78 | 78 | $rangeDecl = new AST\RangeVariableDeclaration($primaryClass->getClassName(), $updateClause->aliasIdentificationVariable); |
| 79 | 79 | $fromClause = new AST\FromClause([new AST\IdentificationVariableDeclaration($rangeDecl, null, [])]); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $this->insertSql .= $sqlWalker->walkFromClause($fromClause); |
| 82 | 82 | |
| 83 | 83 | // 2. Create ID subselect statement used in UPDATE ... WHERE ... IN (subselect) |
| 84 | - $idSubselect = 'SELECT ' . $idColumnNameList . ' FROM ' . $tempTable; |
|
| 84 | + $idSubselect = 'SELECT '.$idColumnNameList.' FROM '.$tempTable; |
|
| 85 | 85 | |
| 86 | 86 | // 3. Create and store UPDATE statements |
| 87 | 87 | $classNames = array_merge( |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $affected = false; |
| 97 | 97 | $class = $em->getClassMetadata($className); |
| 98 | 98 | $tableName = $class->table->getQuotedQualifiedName($platform); |
| 99 | - $updateSql = 'UPDATE ' . $tableName . ' SET '; |
|
| 99 | + $updateSql = 'UPDATE '.$tableName.' SET '; |
|
| 100 | 100 | |
| 101 | 101 | foreach ($updateItems as $updateItem) { |
| 102 | 102 | $field = $updateItem->pathExpression->field; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | if ($affected) { |
| 126 | - $this->sqlStatements[$i] = $updateSql . ' WHERE (' . $idColumnNameList . ') IN (' . $idSubselect . ')'; |
|
| 126 | + $this->sqlStatements[$i] = $updateSql.' WHERE ('.$idColumnNameList.') IN ('.$idSubselect.')'; |
|
| 127 | 127 | } |
| 128 | 128 | } |
| 129 | 129 | |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | ]; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL() . ' ' . $tempTable . ' (' |
|
| 146 | - . $platform->getColumnDeclarationListSQL($columnDefinitions) . ')'; |
|
| 145 | + $this->createTempTableSql = $platform->getCreateTemporaryTableSnippetSQL().' '.$tempTable.' (' |
|
| 146 | + . $platform->getColumnDeclarationListSQL($columnDefinitions).')'; |
|
| 147 | 147 | |
| 148 | 148 | $this->dropTempTableSql = $platform->getDropTemporaryTableSQL($tempTable); |
| 149 | 149 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * @param string $entityName Full or partial entity name |
| 166 | 166 | * @param EntityManagerInterface $entityManager |
| 167 | 167 | * |
| 168 | - * @return \Doctrine\ORM\Mapping\ClassMetadata |
|
| 168 | + * @return \Doctrine\Common\Persistence\Mapping\ClassMetadata |
|
| 169 | 169 | */ |
| 170 | 170 | private function getClassMetadata($entityName, EntityManagerInterface $entityManager) |
| 171 | 171 | { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @param string $label Label for the value |
| 249 | 249 | * @param mixed $value A Value to show |
| 250 | 250 | * |
| 251 | - * @return array |
|
| 251 | + * @return string[] |
|
| 252 | 252 | */ |
| 253 | 253 | private function formatField($label, $value) |
| 254 | 254 | { |
@@ -347,7 +347,7 @@ discard block |
||
| 347 | 347 | * |
| 348 | 348 | * @param array $entityListeners |
| 349 | 349 | * |
| 350 | - * @return array |
|
| 350 | + * @return string[] |
|
| 351 | 351 | */ |
| 352 | 352 | private function formatEntityListeners(array $entityListeners) |
| 353 | 353 | { |
@@ -298,7 +298,7 @@ |
||
| 298 | 298 | |
| 299 | 299 | if ($property instanceof FieldMetadata) { |
| 300 | 300 | $output = array_merge($output, $this->formatColumn($property)); |
| 301 | - } else if ($property instanceof AssociationMetadata) { |
|
| 301 | + } else if ($property instanceof AssociationMetadata) { |
|
| 302 | 302 | // @todo guilhermeblanco Fix me! We are trying to iterate through an AssociationMetadata instance |
| 303 | 303 | foreach ($property as $field => $value) { |
| 304 | 304 | $output[] = $this->formatField(sprintf(' %s', $field), $this->formatValue($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\Tools\Console\Command; |
| 6 | 6 | |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | |
| 160 | 160 | $matches = array_filter( |
| 161 | 161 | $this->getMappedEntities($entityManager), |
| 162 | - function ($mappedEntity) use ($entityName) { |
|
| 163 | - return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity); |
|
| 162 | + function($mappedEntity) use ($entityName) { |
|
| 163 | + return preg_match('{'.preg_quote($entityName).'}', $mappedEntity); |
|
| 164 | 164 | } |
| 165 | 165 | ); |
| 166 | 166 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | if (is_bool($value)) { |
| 202 | - return '<comment>' . ($value ? 'True' : 'False') . '</comment>'; |
|
| 202 | + return '<comment>'.($value ? 'True' : 'False').'</comment>'; |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | if (empty($value)) { |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | if ($property instanceof FieldMetadata) { |
| 283 | 283 | $output = array_merge($output, $this->formatColumn($property)); |
| 284 | - } else if ($property instanceof AssociationMetadata) { |
|
| 284 | + } else if ($property instanceof AssociationMetadata) { |
|
| 285 | 285 | // @todo guilhermeblanco Fix me! We are trying to iterate through an AssociationMetadata instance |
| 286 | 286 | foreach ($property as $field => $value) { |
| 287 | 287 | $output[] = $this->formatField(sprintf(' %s', $field), $this->formatValue($value)); |
@@ -337,7 +337,7 @@ discard block |
||
| 337 | 337 | return $this->formatField( |
| 338 | 338 | 'Entity listeners', |
| 339 | 339 | array_map( |
| 340 | - function ($entityListener) { |
|
| 340 | + function($entityListener) { |
|
| 341 | 341 | return get_class($entityListener); |
| 342 | 342 | }, |
| 343 | 343 | $entityListeners |