@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | $queryCount = $this->getCurrentQueryCount(); |
| 303 | 303 | $this->assertFalse($user->articles->contains($article)); |
| 304 | - $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), 'Checking for contains of persisted entity should cause one query to be executed.'); |
|
| 304 | + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Checking for contains of persisted entity should cause one query to be executed.'); |
|
| 305 | 305 | $this->assertFalse($user->articles->isInitialized(), 'Post-Condition: Collection is not initialized.'); |
| 306 | 306 | |
| 307 | 307 | // Test One to Many existence with state managed |
@@ -468,7 +468,7 @@ discard block |
||
| 468 | 468 | |
| 469 | 469 | $queryCount = $this->getCurrentQueryCount(); |
| 470 | 470 | $this->assertTrue($group->users->contains($user)); |
| 471 | - $this->assertEquals($queryCount+1, $this->getCurrentQueryCount(), 'Checking for contains of managed entity should cause one query to be executed.'); |
|
| 471 | + $this->assertEquals($queryCount + 1, $this->getCurrentQueryCount(), 'Checking for contains of managed entity should cause one query to be executed.'); |
|
| 472 | 472 | $this->assertFalse($user->groups->isInitialized(), 'Post-Condition: Collection is not initialized.'); |
| 473 | 473 | |
| 474 | 474 | $newUser = new CmsUser(); |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | $user->tweets->removeElement($tweet); |
| 51 | 51 | |
| 52 | - $tweets = $user->tweets->map(static function (GH7864Tweet $tweet) { |
|
| 52 | + $tweets = $user->tweets->map(static function(GH7864Tweet $tweet) { |
|
| 53 | 53 | return $tweet->content; |
| 54 | 54 | }); |
| 55 | 55 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | foreach ($joinColumns as $joinColumn) { |
| 132 | 132 | $columnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $sourceClass, $this->platform); |
| 133 | 133 | $referencedName = $joinColumn['referencedColumnName']; |
| 134 | - $conditions[] = 't.' . $columnName . ' = ?'; |
|
| 134 | + $conditions[] = 't.'.$columnName.' = ?'; |
|
| 135 | 135 | $params[] = $id[$sourceClass->getFieldForColumn($referencedName)]; |
| 136 | 136 | $types[] = PersisterHelper::getTypeOfColumn($referencedName, $sourceClass, $this->em); |
| 137 | 137 | } |
@@ -160,9 +160,9 @@ discard block |
||
| 160 | 160 | }*/ |
| 161 | 161 | |
| 162 | 162 | $sql = 'SELECT COUNT(*)' |
| 163 | - . ' FROM ' . $joinTableName . ' t' |
|
| 163 | + . ' FROM '.$joinTableName.' t' |
|
| 164 | 164 | . $joinTargetEntitySQL |
| 165 | - . ' WHERE ' . implode(' AND ', $conditions); |
|
| 165 | + . ' WHERE '.implode(' AND ', $conditions); |
|
| 166 | 166 | |
| 167 | 167 | return $this->conn->fetchColumn($sql, $params, 0, $types); |
| 168 | 168 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true); |
| 192 | 192 | |
| 193 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 193 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 194 | 194 | |
| 195 | 195 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 196 | 196 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true); |
| 208 | 208 | |
| 209 | - $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 209 | + $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses); |
|
| 210 | 210 | |
| 211 | 211 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
| 212 | 212 | } |
@@ -256,11 +256,11 @@ discard block |
||
| 256 | 256 | $rsm = new Query\ResultSetMappingBuilder($this->em); |
| 257 | 257 | $rsm->addRootEntityFromClassMetadata($targetClass->name, 'te'); |
| 258 | 258 | |
| 259 | - $sql = 'SELECT ' . $rsm->generateSelectClause() |
|
| 260 | - . ' FROM ' . $tableName . ' te' |
|
| 261 | - . ' JOIN ' . $joinTable . ' t ON' |
|
| 259 | + $sql = 'SELECT '.$rsm->generateSelectClause() |
|
| 260 | + . ' FROM '.$tableName.' te' |
|
| 261 | + . ' JOIN '.$joinTable.' t ON' |
|
| 262 | 262 | . implode(' AND ', $onConditions) |
| 263 | - . ' WHERE ' . implode(' AND ', $whereClauses); |
|
| 263 | + . ' WHERE '.implode(' AND ', $whereClauses); |
|
| 264 | 264 | |
| 265 | 265 | $sql .= $this->getOrderingSql($criteria, $targetClass); |
| 266 | 266 | |
@@ -301,8 +301,8 @@ discard block |
||
| 301 | 301 | |
| 302 | 302 | // A join is needed if there is filtering on the target entity |
| 303 | 303 | $tableName = $this->quoteStrategy->getTableName($rootClass, $this->platform); |
| 304 | - $joinSql = ' JOIN ' . $tableName . ' te' |
|
| 305 | - . ' ON' . implode(' AND ', $this->getOnConditionSQL($mapping)); |
|
| 304 | + $joinSql = ' JOIN '.$tableName.' te' |
|
| 305 | + . ' ON'.implode(' AND ', $this->getOnConditionSQL($mapping)); |
|
| 306 | 306 | |
| 307 | 307 | return [$joinSql, $filterSql]; |
| 308 | 308 | } |
@@ -321,12 +321,12 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | foreach ($this->em->getFilters()->getEnabledFilters() as $filter) { |
| 323 | 323 | if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) { |
| 324 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 324 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 325 | 325 | } |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | return $filterClauses |
| 329 | - ? '(' . implode(' AND ', $filterClauses) . ')' |
|
| 329 | + ? '('.implode(' AND ', $filterClauses).')' |
|
| 330 | 330 | : ''; |
| 331 | 331 | } |
| 332 | 332 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $joinColumnName = $this->quoteStrategy->getJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 355 | 355 | $refColumnName = $this->quoteStrategy->getReferencedJoinColumnName($joinColumn, $targetClass, $this->platform); |
| 356 | 356 | |
| 357 | - $conditions[] = ' t.' . $joinColumnName . ' = ' . 'te.' . $refColumnName; |
|
| 357 | + $conditions[] = ' t.'.$joinColumnName.' = '.'te.'.$refColumnName; |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | return $conditions; |
@@ -376,8 +376,8 @@ discard block |
||
| 376 | 376 | $columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform); |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | - return 'DELETE FROM ' . $joinTable |
|
| 380 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?'; |
|
| 379 | + return 'DELETE FROM '.$joinTable |
|
| 380 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?'; |
|
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | /** |
@@ -436,8 +436,8 @@ discard block |
||
| 436 | 436 | } |
| 437 | 437 | |
| 438 | 438 | return [ |
| 439 | - 'DELETE FROM ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
| 440 | - . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?', |
|
| 439 | + 'DELETE FROM '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
| 440 | + . ' WHERE '.implode(' = ? AND ', $columns).' = ?', |
|
| 441 | 441 | $types, |
| 442 | 442 | ]; |
| 443 | 443 | } |
@@ -485,10 +485,10 @@ discard block |
||
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | return [ |
| 488 | - 'INSERT INTO ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
| 489 | - . ' (' . implode(', ', $columns) . ')' |
|
| 488 | + 'INSERT INTO '.$this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform) |
|
| 489 | + . ' ('.implode(', ', $columns).')' |
|
| 490 | 490 | . ' VALUES' |
| 491 | - . ' (' . implode(', ', array_fill(0, count($columns), '?')) . ')', |
|
| 491 | + . ' ('.implode(', ', array_fill(0, count($columns), '?')).')', |
|
| 492 | 492 | $types, |
| 493 | 493 | ]; |
| 494 | 494 | } |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | $sourceClass = $this->em->getClassMetadata($mapping['sourceEntity']); |
| 575 | 575 | $targetClass = $this->em->getClassMetadata($mapping['targetEntity']); |
| 576 | 576 | |
| 577 | - if (! $mapping['isOwningSide']) { |
|
| 577 | + if ( ! $mapping['isOwningSide']) { |
|
| 578 | 578 | $associationSourceClass = $this->em->getClassMetadata($mapping['targetEntity']); |
| 579 | 579 | $mapping = $associationSourceClass->associationMappings[$mapping['mappedBy']]; |
| 580 | 580 | $joinColumns = $mapping['joinTable']['joinColumns']; |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | $targetRelationMode = 'relationToTargetKeyColumns'; |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | - $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform). ' t'; |
|
| 590 | + $quotedJoinTable = $this->quoteStrategy->getJoinTableName($mapping, $associationSourceClass, $this->platform).' t'; |
|
| 591 | 591 | $whereClauses = []; |
| 592 | 592 | $params = []; |
| 593 | 593 | $types = []; |
@@ -598,14 +598,14 @@ discard block |
||
| 598 | 598 | $joinConditions = []; |
| 599 | 599 | |
| 600 | 600 | foreach ($joinColumns as $joinTableColumn) { |
| 601 | - $joinConditions[] = 't.' . $joinTableColumn['name'] . ' = tr.' . $joinTableColumn['referencedColumnName']; |
|
| 601 | + $joinConditions[] = 't.'.$joinTableColumn['name'].' = tr.'.$joinTableColumn['referencedColumnName']; |
|
| 602 | 602 | } |
| 603 | 603 | |
| 604 | 604 | $tableName = $this->quoteStrategy->getTableName($targetClass, $this->platform); |
| 605 | - $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions); |
|
| 605 | + $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions); |
|
| 606 | 606 | $columnName = $targetClass->getColumnName($indexBy); |
| 607 | 607 | |
| 608 | - $whereClauses[] = 'tr.' . $columnName . ' = ?'; |
|
| 608 | + $whereClauses[] = 'tr.'.$columnName.' = ?'; |
|
| 609 | 609 | $params[] = $key; |
| 610 | 610 | $types[] = PersisterHelper::getTypeOfColumn($columnName, $targetClass, $this->em); |
| 611 | 611 | } |
@@ -613,7 +613,7 @@ discard block |
||
| 613 | 613 | foreach ($mapping['joinTableColumns'] as $joinTableColumn) { |
| 614 | 614 | if (isset($mapping[$sourceRelationMode][$joinTableColumn])) { |
| 615 | 615 | $column = $mapping[$sourceRelationMode][$joinTableColumn]; |
| 616 | - $whereClauses[] = 't.' . $joinTableColumn . ' = ?'; |
|
| 616 | + $whereClauses[] = 't.'.$joinTableColumn.' = ?'; |
|
| 617 | 617 | $params[] = $sourceClass->containsForeignIdentifier |
| 618 | 618 | ? $id[$sourceClass->getFieldForColumn($column)] |
| 619 | 619 | : $id[$sourceClass->fieldNames[$column]]; |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | } elseif ( ! $joinNeeded) { |
| 622 | 622 | $column = $mapping[$targetRelationMode][$joinTableColumn]; |
| 623 | 623 | |
| 624 | - $whereClauses[] = 't.' . $joinTableColumn . ' = ?'; |
|
| 624 | + $whereClauses[] = 't.'.$joinTableColumn.' = ?'; |
|
| 625 | 625 | $params[] = $key; |
| 626 | 626 | $types[] = PersisterHelper::getTypeOfColumn($column, $targetClass, $this->em); |
| 627 | 627 | } |
@@ -631,7 +631,7 @@ discard block |
||
| 631 | 631 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); |
| 632 | 632 | |
| 633 | 633 | if ($filterSql) { |
| 634 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 634 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 635 | 635 | $whereClauses[] = $filterSql; |
| 636 | 636 | } |
| 637 | 637 | } |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | $types = []; |
| 676 | 676 | |
| 677 | 677 | foreach ($mapping['joinTableColumns'] as $joinTableColumn) { |
| 678 | - $whereClauses[] = ($addFilters ? 't.' : '') . $joinTableColumn . ' = ?'; |
|
| 678 | + $whereClauses[] = ($addFilters ? 't.' : '').$joinTableColumn.' = ?'; |
|
| 679 | 679 | |
| 680 | 680 | if (isset($mapping['relationToTargetKeyColumns'][$joinTableColumn])) { |
| 681 | 681 | $targetColumn = $mapping['relationToTargetKeyColumns'][$joinTableColumn]; |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($filterMapping); |
| 698 | 698 | |
| 699 | 699 | if ($filterSql) { |
| 700 | - $quotedJoinTable .= ' ' . $joinTargetEntitySQL; |
|
| 700 | + $quotedJoinTable .= ' '.$joinTargetEntitySQL; |
|
| 701 | 701 | $whereClauses[] = $filterSql; |
| 702 | 702 | } |
| 703 | 703 | } |
@@ -746,10 +746,10 @@ discard block |
||
| 746 | 746 | $targetClass, |
| 747 | 747 | $this->platform |
| 748 | 748 | ); |
| 749 | - $orderBy[] = $field . ' ' . $direction; |
|
| 749 | + $orderBy[] = $field.' '.$direction; |
|
| 750 | 750 | } |
| 751 | 751 | |
| 752 | - return ' ORDER BY ' . implode(', ', $orderBy); |
|
| 752 | + return ' ORDER BY '.implode(', ', $orderBy); |
|
| 753 | 753 | } |
| 754 | 754 | return ''; |
| 755 | 755 | } |