@@ -60,9 +60,9 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function __construct($case = CASE_LOWER, bool $numberAware = false) |
| 62 | 62 | { |
| 63 | - if (! $numberAware) { |
|
| 63 | + if ( ! $numberAware) { |
|
| 64 | 64 | @trigger_error( |
| 65 | - 'Creating ' . self::class . ' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.', |
|
| 65 | + 'Creating '.self::class.' without making it number aware is deprecated and will be removed in Doctrine ORM 3.0.', |
|
| 66 | 66 | E_USER_DEPRECATED |
| 67 | 67 | ); |
| 68 | 68 | } |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function referenceColumnName() |
| 127 | 127 | { |
| 128 | - return $this->case === CASE_UPPER ? 'ID' : 'id'; |
|
| 128 | + return $this->case === CASE_UPPER ? 'ID' : 'id'; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | /** |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | public function joinColumnName($propertyName, $className = null) |
| 135 | 135 | { |
| 136 | - return $this->underscore($propertyName) . '_' . $this->referenceColumnName(); |
|
| 136 | + return $this->underscore($propertyName).'_'.$this->referenceColumnName(); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function joinTableName($sourceEntity, $targetEntity, $propertyName = null) |
| 143 | 143 | { |
| 144 | - return $this->classToTableName($sourceEntity) . '_' . $this->classToTableName($targetEntity); |
|
| 144 | + return $this->classToTableName($sourceEntity).'_'.$this->classToTableName($targetEntity); |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /** |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | */ |
| 150 | 150 | public function joinKeyColumnName($entityName, $referencedColumnName = null) |
| 151 | 151 | { |
| 152 | - return $this->classToTableName($entityName) . '_' . |
|
| 152 | + return $this->classToTableName($entityName).'_'. |
|
| 153 | 153 | ($referencedColumnName ?: $this->referenceColumnName()); |
| 154 | 154 | } |
| 155 | 155 | |
@@ -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 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $this->ignoredDeprecations = []; |
| 31 | 31 | |
| 32 | 32 | $this->originalHandler = set_error_handler( |
| 33 | - function (int $errorNumber, string $errorMessage) : void { |
|
| 33 | + function(int $errorNumber, string $errorMessage) : void { |
|
| 34 | 34 | if (in_array($errorMessage, $this->ignoredDeprecations, true)) { |
| 35 | 35 | return; |
| 36 | 36 | } |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | $targetEntity = current( |
| 227 | 227 | array_filter( |
| 228 | 228 | $classes, |
| 229 | - function (ClassMetadata $class) use ($idMapping) : bool { |
|
| 229 | + function(ClassMetadata $class) use ($idMapping) : bool { |
|
| 230 | 230 | return $class->name === $idMapping['targetEntity']; |
| 231 | 231 | } |
| 232 | 232 | ) |
@@ -646,8 +646,8 @@ discard block |
||
| 646 | 646 | |
| 647 | 647 | if ( ! $definingClass) { |
| 648 | 648 | throw new \Doctrine\ORM\ORMException( |
| 649 | - 'Column name `' . $joinColumn['referencedColumnName'] . '` referenced for relation from ' |
|
| 650 | - . $mapping['sourceEntity'] . ' towards ' . $mapping['targetEntity'] . ' does not exist.' |
|
| 649 | + 'Column name `'.$joinColumn['referencedColumnName'].'` referenced for relation from ' |
|
| 650 | + . $mapping['sourceEntity'].' towards '.$mapping['targetEntity'].' does not exist.' |
|
| 651 | 651 | ); |
| 652 | 652 | } |
| 653 | 653 | |
@@ -742,7 +742,7 @@ discard block |
||
| 742 | 742 | */ |
| 743 | 743 | private function gatherColumnOptions(array $mapping) : array |
| 744 | 744 | { |
| 745 | - if (! isset($mapping['options'])) { |
|
| 745 | + if ( ! isset($mapping['options'])) { |
|
| 746 | 746 | return []; |
| 747 | 747 | } |
| 748 | 748 | |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | if ($table->hasPrimaryKey()) { |
| 849 | 849 | $columns = $table->getPrimaryKey()->getColumns(); |
| 850 | 850 | if (count($columns) == 1) { |
| 851 | - $checkSequence = $table->getName() . '_' . $columns[0] . '_seq'; |
|
| 851 | + $checkSequence = $table->getName().'_'.$columns[0].'_seq'; |
|
| 852 | 852 | if ($fullSchema->hasSequence($checkSequence)) { |
| 853 | 853 | $visitor->acceptSequence($fullSchema->getSequence($checkSequence)); |
| 854 | 854 | } |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | } |
| 923 | 923 | |
| 924 | 924 | // whitelist assets we already know about in $toSchema, use the existing filter otherwise |
| 925 | - $config->setSchemaAssetsFilter(static function ($asset) use ($previousFilter, $toSchema) : bool { |
|
| 925 | + $config->setSchemaAssetsFilter(static function($asset) use ($previousFilter, $toSchema) : bool { |
|
| 926 | 926 | $assetName = $asset instanceof AbstractAsset ? $asset->getName() : $asset; |
| 927 | 927 | |
| 928 | 928 | return $toSchema->hasTable($assetName) || $toSchema->hasSequence($assetName) || $previousFilter($asset); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | */ |
| 39 | 39 | private function filterCreateTable(array $sqls, string $tableName) : array |
| 40 | 40 | { |
| 41 | - return array_filter($sqls, static function (string $sql) use ($tableName) : bool { |
|
| 41 | + return array_filter($sqls, static function(string $sql) use ($tableName) : bool { |
|
| 42 | 42 | return strpos($sql, sprintf('CREATE TABLE %s (', $tableName)) === 0; |
| 43 | 43 | }); |
| 44 | 44 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | $this->_em->getConnection()->exec(current($sqls)); |
| 56 | 56 | |
| 57 | - $sqls = array_filter($tool->getUpdateSchemaSql($classes), static function (string $sql) : bool { |
|
| 57 | + $sqls = array_filter($tool->getUpdateSchemaSql($classes), static function(string $sql) : bool { |
|
| 58 | 58 | return strpos($sql, ' gh7875_my_entity ') !== false; |
| 59 | 59 | }); |
| 60 | 60 | |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | ['/^(?!my_enti)/', null], |
| 78 | 78 | [ |
| 79 | 79 | null, |
| 80 | - static function ($assetName) : bool { |
|
| 80 | + static function($assetName) : bool { |
|
| 81 | 81 | return $assetName !== 'gh7875_my_entity'; |
| 82 | 82 | }, |
| 83 | 83 | ], |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | $previousFilter = $config->getSchemaAssetsFilter(); |
| 107 | 107 | |
| 108 | 108 | $sqls = $tool->getUpdateSchemaSql($classes); |
| 109 | - $sqls = array_filter($sqls, static function (string $sql) : bool { |
|
| 109 | + $sqls = array_filter($sqls, static function(string $sql) : bool { |
|
| 110 | 110 | return strpos($sql, ' gh7875_my_entity ') !== false; |
| 111 | 111 | }); |
| 112 | 112 | |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | try { |
| 383 | 383 | // Collection deletions (deletions of complete collections) |
| 384 | 384 | foreach ($this->collectionDeletions as $collectionToDelete) { |
| 385 | - if (! $collectionToDelete instanceof PersistentCollection) { |
|
| 385 | + if ( ! $collectionToDelete instanceof PersistentCollection) { |
|
| 386 | 386 | $this->getCollectionPersister($collectionToDelete->getMapping())->delete($collectionToDelete); |
| 387 | 387 | |
| 388 | 388 | continue; |
@@ -514,7 +514,7 @@ discard block |
||
| 514 | 514 | $state = $this->getEntityState($entity); |
| 515 | 515 | |
| 516 | 516 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
| 517 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
| 517 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
| 518 | 518 | } |
| 519 | 519 | |
| 520 | 520 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -570,7 +570,7 @@ discard block |
||
| 570 | 570 | $oid = spl_object_hash($entity); |
| 571 | 571 | $data = []; |
| 572 | 572 | |
| 573 | - if (!isset($this->entityChangeSets[$oid])) { |
|
| 573 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 574 | 574 | return $data; |
| 575 | 575 | } |
| 576 | 576 | |
@@ -733,7 +733,7 @@ discard block |
||
| 733 | 733 | if ($owner === null) { // cloned |
| 734 | 734 | $actualValue->setOwner($entity, $assoc); |
| 735 | 735 | } else if ($owner !== $entity) { // no clone, we have to fix |
| 736 | - if (!$actualValue->isInitialized()) { |
|
| 736 | + if ( ! $actualValue->isInitialized()) { |
|
| 737 | 737 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 738 | 738 | } |
| 739 | 739 | $newValue = clone $actualValue; |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
| 880 | 880 | |
| 881 | 881 | foreach ($unwrappedValue as $key => $entry) { |
| 882 | - if (! ($entry instanceof $targetClass->name)) { |
|
| 882 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
| 883 | 883 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
| 884 | 884 | } |
| 885 | 885 | |
@@ -957,7 +957,7 @@ discard block |
||
| 957 | 957 | |
| 958 | 958 | // Some identifiers may be foreign keys to new entities. |
| 959 | 959 | // In this case, we don't have the value yet and should treat it as if we have a post-insert generator |
| 960 | - if (! $this->hasMissingIdsWhichAreForeignKeys($class, $idValue)) { |
|
| 960 | + if ( ! $this->hasMissingIdsWhichAreForeignKeys($class, $idValue)) { |
|
| 961 | 961 | $this->entityIdentifiers[$oid] = $idValue; |
| 962 | 962 | } |
| 963 | 963 | } |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | } |
| 1107 | 1107 | } else { |
| 1108 | 1108 | foreach ($insertionsForClass as $oid => $entity) { |
| 1109 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
| 1109 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
| 1110 | 1110 | //entity was not added to identity map because some identifiers are foreign keys to new entities. |
| 1111 | 1111 | //add it now |
| 1112 | 1112 | $this->addToEntityIdentifiersAndEntityMap($class, $oid, $entity); |
@@ -1210,7 +1210,7 @@ discard block |
||
| 1210 | 1210 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1211 | 1211 | // is obtained by a new entity because the old one went out of scope. |
| 1212 | 1212 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1213 | - if (!$class->isIdentifierNatural() && |
|
| 1213 | + if ( ! $class->isIdentifierNatural() && |
|
| 1214 | 1214 | method_exists($class->reflFields[$class->identifier[0]], 'getType') && |
| 1215 | 1215 | $class->reflFields[$class->identifier[0]]->getType()->allowsNull()) { |
| 1216 | 1216 | $class->reflFields[$class->identifier[0]]->setValue($entity, null); |
@@ -1273,7 +1273,7 @@ discard block |
||
| 1273 | 1273 | |
| 1274 | 1274 | $joinColumns = reset($assoc['joinColumns']); |
| 1275 | 1275 | |
| 1276 | - $calc->addDependency($targetClass->name, $class->name, (int)empty($joinColumns['nullable'])); |
|
| 1276 | + $calc->addDependency($targetClass->name, $class->name, (int) empty($joinColumns['nullable'])); |
|
| 1277 | 1277 | |
| 1278 | 1278 | // If the target class has mapped subclasses, these share the same dependency. |
| 1279 | 1279 | if ( ! $targetClass->subClasses) { |
@@ -1796,7 +1796,7 @@ discard block |
||
| 1796 | 1796 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
| 1797 | 1797 | |
| 1798 | 1798 | default: |
| 1799 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1799 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1800 | 1800 | } |
| 1801 | 1801 | |
| 1802 | 1802 | $this->cascadePersist($entity, $visited); |
@@ -1866,7 +1866,7 @@ discard block |
||
| 1866 | 1866 | case self::STATE_DETACHED: |
| 1867 | 1867 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
| 1868 | 1868 | default: |
| 1869 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
| 1869 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
| 1870 | 1870 | } |
| 1871 | 1871 | |
| 1872 | 1872 | } |
@@ -2005,7 +2005,7 @@ discard block |
||
| 2005 | 2005 | */ |
| 2006 | 2006 | private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy) |
| 2007 | 2007 | { |
| 2008 | - if (! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
| 2008 | + if ( ! ($class->isVersioned && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) { |
|
| 2009 | 2009 | return; |
| 2010 | 2010 | } |
| 2011 | 2011 | |
@@ -2030,7 +2030,7 @@ discard block |
||
| 2030 | 2030 | */ |
| 2031 | 2031 | private function isLoaded($entity) |
| 2032 | 2032 | { |
| 2033 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 2033 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
| 2034 | 2034 | } |
| 2035 | 2035 | |
| 2036 | 2036 | /** |
@@ -2190,7 +2190,7 @@ discard block |
||
| 2190 | 2190 | |
| 2191 | 2191 | $associationMappings = array_filter( |
| 2192 | 2192 | $class->associationMappings, |
| 2193 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2193 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
| 2194 | 2194 | ); |
| 2195 | 2195 | |
| 2196 | 2196 | foreach ($associationMappings as $assoc) { |
@@ -2233,7 +2233,7 @@ discard block |
||
| 2233 | 2233 | |
| 2234 | 2234 | $associationMappings = array_filter( |
| 2235 | 2235 | $class->associationMappings, |
| 2236 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2236 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
| 2237 | 2237 | ); |
| 2238 | 2238 | |
| 2239 | 2239 | foreach ($associationMappings as $assoc) { |
@@ -2277,7 +2277,7 @@ discard block |
||
| 2277 | 2277 | |
| 2278 | 2278 | $associationMappings = array_filter( |
| 2279 | 2279 | $class->associationMappings, |
| 2280 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2280 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
| 2281 | 2281 | ); |
| 2282 | 2282 | |
| 2283 | 2283 | foreach ($associationMappings as $assoc) { |
@@ -2316,7 +2316,7 @@ discard block |
||
| 2316 | 2316 | |
| 2317 | 2317 | $associationMappings = array_filter( |
| 2318 | 2318 | $class->associationMappings, |
| 2319 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
| 2319 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
| 2320 | 2320 | ); |
| 2321 | 2321 | |
| 2322 | 2322 | foreach ($associationMappings as $assoc) { |
@@ -2345,7 +2345,7 @@ discard block |
||
| 2345 | 2345 | break; |
| 2346 | 2346 | |
| 2347 | 2347 | case ($relatedEntities !== null): |
| 2348 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2348 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
| 2349 | 2349 | throw ORMInvalidArgumentException::invalidAssociation( |
| 2350 | 2350 | $this->em->getClassMetadata($assoc['targetEntity']), |
| 2351 | 2351 | $assoc, |
@@ -2376,13 +2376,13 @@ discard block |
||
| 2376 | 2376 | |
| 2377 | 2377 | $associationMappings = array_filter( |
| 2378 | 2378 | $class->associationMappings, |
| 2379 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2379 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
| 2380 | 2380 | ); |
| 2381 | 2381 | |
| 2382 | 2382 | $entitiesToCascade = []; |
| 2383 | 2383 | |
| 2384 | 2384 | foreach ($associationMappings as $assoc) { |
| 2385 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2385 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2386 | 2386 | $entity->__load(); |
| 2387 | 2387 | } |
| 2388 | 2388 | |
@@ -2446,7 +2446,7 @@ discard block |
||
| 2446 | 2446 | return; |
| 2447 | 2447 | } |
| 2448 | 2448 | |
| 2449 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
| 2449 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
| 2450 | 2450 | $entity->__load(); |
| 2451 | 2451 | } |
| 2452 | 2452 | |
@@ -2461,7 +2461,7 @@ discard block |
||
| 2461 | 2461 | case LockMode::NONE === $lockMode: |
| 2462 | 2462 | case LockMode::PESSIMISTIC_READ === $lockMode: |
| 2463 | 2463 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
| 2464 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
| 2464 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 2465 | 2465 | throw TransactionRequiredException::transactionRequired(); |
| 2466 | 2466 | } |
| 2467 | 2467 | |
@@ -2786,7 +2786,7 @@ discard block |
||
| 2786 | 2786 | // then we can append this entity for eager loading! |
| 2787 | 2787 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
| 2788 | 2788 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2789 | - !$targetClass->isIdentifierComposite && |
|
| 2789 | + ! $targetClass->isIdentifierComposite && |
|
| 2790 | 2790 | $newValue instanceof Proxy && |
| 2791 | 2791 | $newValue->__isInitialized__ === false) { |
| 2792 | 2792 | |
@@ -3151,7 +3151,7 @@ discard block |
||
| 3151 | 3151 | public function getCollectionPersister(array $association) |
| 3152 | 3152 | { |
| 3153 | 3153 | $role = isset($association['cache']) |
| 3154 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
| 3154 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
| 3155 | 3155 | : $association['type']; |
| 3156 | 3156 | |
| 3157 | 3157 | if (isset($this->collectionPersisters[$role])) { |
@@ -3369,7 +3369,7 @@ discard block |
||
| 3369 | 3369 | */ |
| 3370 | 3370 | private function afterTransactionComplete() |
| 3371 | 3371 | { |
| 3372 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3372 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3373 | 3373 | $persister->afterTransactionComplete(); |
| 3374 | 3374 | }); |
| 3375 | 3375 | } |
@@ -3379,7 +3379,7 @@ discard block |
||
| 3379 | 3379 | */ |
| 3380 | 3380 | private function afterTransactionRolledBack() |
| 3381 | 3381 | { |
| 3382 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 3382 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 3383 | 3383 | $persister->afterTransactionRolledBack(); |
| 3384 | 3384 | }); |
| 3385 | 3385 | } |
@@ -3475,11 +3475,11 @@ discard block |
||
| 3475 | 3475 | */ |
| 3476 | 3476 | private function mergeEntityStateIntoManagedCopy($entity, $managedCopy) |
| 3477 | 3477 | { |
| 3478 | - if (! $this->isLoaded($entity)) { |
|
| 3478 | + if ( ! $this->isLoaded($entity)) { |
|
| 3479 | 3479 | return; |
| 3480 | 3480 | } |
| 3481 | 3481 | |
| 3482 | - if (! $this->isLoaded($managedCopy)) { |
|
| 3482 | + if ( ! $this->isLoaded($managedCopy)) { |
|
| 3483 | 3483 | $managedCopy->__load(); |
| 3484 | 3484 | } |
| 3485 | 3485 | |
@@ -3502,7 +3502,7 @@ discard block |
||
| 3502 | 3502 | if ($other === null) { |
| 3503 | 3503 | $prop->setValue($managedCopy, null); |
| 3504 | 3504 | } else { |
| 3505 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
| 3505 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
| 3506 | 3506 | // do not merge fields marked lazy that have not been fetched. |
| 3507 | 3507 | continue; |
| 3508 | 3508 | } |
@@ -3589,7 +3589,7 @@ discard block |
||
| 3589 | 3589 | */ |
| 3590 | 3590 | private function clearIdentityMapForEntityName($entityName) |
| 3591 | 3591 | { |
| 3592 | - if (! isset($this->identityMap[$entityName])) { |
|
| 3592 | + if ( ! isset($this->identityMap[$entityName])) { |
|
| 3593 | 3593 | return; |
| 3594 | 3594 | } |
| 3595 | 3595 | |