@@ -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 | |
@@ -294,8 +294,8 @@ discard block |
||
| 294 | 294 | */ |
| 295 | 295 | private function resolveMagicCall($method, $by, array $arguments) |
| 296 | 296 | { |
| 297 | - if (! $arguments) { |
|
| 298 | - throw InvalidMagicMethodCall::onMissingParameter($method . $by); |
|
| 297 | + if ( ! $arguments) { |
|
| 298 | + throw InvalidMagicMethodCall::onMissingParameter($method.$by); |
|
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | $fieldName = lcfirst(Inflector::classify($by)); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | throw InvalidMagicMethodCall::becauseFieldNotFoundIn( |
| 305 | 305 | $this->entityName, |
| 306 | 306 | $fieldName, |
| 307 | - $method . $by |
|
| 307 | + $method.$by |
|
| 308 | 308 | ); |
| 309 | 309 | } |
| 310 | 310 | |
@@ -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 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | { |
| 280 | 280 | $query = new Query($this); |
| 281 | 281 | |
| 282 | - if (! empty($dql)) { |
|
| 282 | + if ( ! empty($dql)) { |
|
| 283 | 283 | $query->setDQL($dql); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -388,7 +388,7 @@ discard block |
||
| 388 | 388 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
| 389 | 389 | $className = $class->getClassName(); |
| 390 | 390 | |
| 391 | - if (! is_array($id)) { |
|
| 391 | + if ( ! is_array($id)) { |
|
| 392 | 392 | if ($class->isIdentifierComposite()) { |
| 393 | 393 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
| 394 | 394 | } |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | $sortedId = []; |
| 410 | 410 | |
| 411 | 411 | foreach ($class->identifier as $identifier) { |
| 412 | - if (! isset($id[$identifier])) { |
|
| 412 | + if ( ! isset($id[$identifier])) { |
|
| 413 | 413 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
| 414 | 414 | } |
| 415 | 415 | |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | // Check identity map first |
| 427 | 427 | $entity = $unitOfWork->tryGetById($sortedId, $class->getRootClassName()); |
| 428 | 428 | if ($entity !== false) { |
| 429 | - if (! ($entity instanceof $className)) { |
|
| 429 | + if ( ! ($entity instanceof $className)) { |
|
| 430 | 430 | return null; |
| 431 | 431 | } |
| 432 | 432 | |
@@ -450,7 +450,7 @@ discard block |
||
| 450 | 450 | |
| 451 | 451 | switch (true) { |
| 452 | 452 | case $lockMode === LockMode::OPTIMISTIC: |
| 453 | - if (! $class->isVersioned()) { |
|
| 453 | + if ( ! $class->isVersioned()) { |
|
| 454 | 454 | throw OptimisticLockException::notVersioned($className); |
| 455 | 455 | } |
| 456 | 456 | |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | case $lockMode === LockMode::PESSIMISTIC_READ: |
| 464 | 464 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
| 465 | - if (! $this->getConnection()->isTransactionActive()) { |
|
| 465 | + if ( ! $this->getConnection()->isTransactionActive()) { |
|
| 466 | 466 | throw TransactionRequiredException::transactionRequired(); |
| 467 | 467 | } |
| 468 | 468 | |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
| 482 | 482 | $className = $class->getClassName(); |
| 483 | 483 | |
| 484 | - if (! is_array($id)) { |
|
| 484 | + if ( ! is_array($id)) { |
|
| 485 | 485 | if ($class->isIdentifierComposite()) { |
| 486 | 486 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
| 487 | 487 | } |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | $sortedId = []; |
| 507 | 507 | |
| 508 | 508 | foreach ($class->identifier as $identifier) { |
| 509 | - if (! isset($scalarId[$identifier])) { |
|
| 509 | + if ( ! isset($scalarId[$identifier])) { |
|
| 510 | 510 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
| 511 | 511 | } |
| 512 | 512 | |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | $class = $this->metadataFactory->getMetadataFor(ltrim($entityName, '\\')); |
| 548 | 548 | $className = $class->getClassName(); |
| 549 | 549 | |
| 550 | - if (! is_array($id)) { |
|
| 550 | + if ( ! is_array($id)) { |
|
| 551 | 551 | if ($class->isIdentifierComposite()) { |
| 552 | 552 | throw ORMInvalidArgumentException::invalidCompositeIdentifier(); |
| 553 | 553 | } |
@@ -568,7 +568,7 @@ discard block |
||
| 568 | 568 | $sortedId = []; |
| 569 | 569 | |
| 570 | 570 | foreach ($class->identifier as $identifier) { |
| 571 | - if (! isset($id[$identifier])) { |
|
| 571 | + if ( ! isset($id[$identifier])) { |
|
| 572 | 572 | throw MissingIdentifierField::fromFieldAndClass($identifier, $className); |
| 573 | 573 | } |
| 574 | 574 | |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | */ |
| 643 | 643 | public function persist($entity) |
| 644 | 644 | { |
| 645 | - if (! is_object($entity)) { |
|
| 645 | + if ( ! is_object($entity)) { |
|
| 646 | 646 | throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity); |
| 647 | 647 | } |
| 648 | 648 | |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | */ |
| 666 | 666 | public function remove($entity) |
| 667 | 667 | { |
| 668 | - if (! is_object($entity)) { |
|
| 668 | + if ( ! is_object($entity)) { |
|
| 669 | 669 | throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity); |
| 670 | 670 | } |
| 671 | 671 | |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | */ |
| 687 | 687 | public function refresh($entity) |
| 688 | 688 | { |
| 689 | - if (! is_object($entity)) { |
|
| 689 | + if ( ! is_object($entity)) { |
|
| 690 | 690 | throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity); |
| 691 | 691 | } |
| 692 | 692 | |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | */ |
| 843 | 843 | public static function create($connection, Configuration $config, ?EventManager $eventManager = null) |
| 844 | 844 | { |
| 845 | - if (! $config->getMetadataDriverImpl()) { |
|
| 845 | + if ( ! $config->getMetadataDriverImpl()) { |
|
| 846 | 846 | throw MissingMappingDriverImplementation::create(); |
| 847 | 847 | } |
| 848 | 848 | |
@@ -869,12 +869,12 @@ discard block |
||
| 869 | 869 | return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager()); |
| 870 | 870 | } |
| 871 | 871 | |
| 872 | - if (! $connection instanceof Connection) { |
|
| 872 | + if ( ! $connection instanceof Connection) { |
|
| 873 | 873 | throw new \InvalidArgumentException( |
| 874 | 874 | sprintf( |
| 875 | 875 | 'Invalid $connection argument of type %s given%s.', |
| 876 | 876 | is_object($connection) ? get_class($connection) : gettype($connection), |
| 877 | - is_object($connection) ? '' : ': "' . $connection . '"' |
|
| 877 | + is_object($connection) ? '' : ': "'.$connection.'"' |
|
| 878 | 878 | ) |
| 879 | 879 | ); |
| 880 | 880 | } |
@@ -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 | |
@@ -287,16 +287,16 @@ discard block |
||
| 287 | 287 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 288 | 288 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 289 | 289 | $identifier = array_map( |
| 290 | - function ($columnName) { |
|
| 290 | + function($columnName) { |
|
| 291 | 291 | return $this->platform->quoteIdentifier($columnName); |
| 292 | 292 | }, |
| 293 | 293 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 294 | 294 | ); |
| 295 | 295 | |
| 296 | 296 | // FIXME: Order with composite keys might not be correct |
| 297 | - $sql = 'SELECT ' . $columnName |
|
| 298 | - . ' FROM ' . $tableName |
|
| 299 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 297 | + $sql = 'SELECT '.$columnName |
|
| 298 | + . ' FROM '.$tableName |
|
| 299 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 300 | 300 | |
| 301 | 301 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 302 | 302 | $versionType = $versionProperty->getType(); |
@@ -335,13 +335,13 @@ discard block |
||
| 335 | 335 | $tableName = $this->class->getTableName(); |
| 336 | 336 | $updateData = $this->prepareUpdateData($entity); |
| 337 | 337 | |
| 338 | - if (! isset($updateData[$tableName])) { |
|
| 338 | + if ( ! isset($updateData[$tableName])) { |
|
| 339 | 339 | return; |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | $data = $updateData[$tableName]; |
| 343 | 343 | |
| 344 | - if (! $data) { |
|
| 344 | + if ( ! $data) { |
|
| 345 | 345 | return; |
| 346 | 346 | } |
| 347 | 347 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | |
| 395 | 395 | if ($value !== null) { |
| 396 | 396 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 397 | - if (! is_array($value)) { |
|
| 397 | + if ( ! is_array($value)) { |
|
| 398 | 398 | $value = [$targetClass->identifier[0] => $value]; |
| 399 | 399 | } |
| 400 | 400 | |
@@ -407,7 +407,7 @@ discard block |
||
| 407 | 407 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 408 | 408 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 409 | 409 | |
| 410 | - if (! $joinColumn->getType()) { |
|
| 410 | + if ( ! $joinColumn->getType()) { |
|
| 411 | 411 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 412 | 412 | } |
| 413 | 413 | |
@@ -473,7 +473,7 @@ discard block |
||
| 473 | 473 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 474 | 474 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 475 | 475 | |
| 476 | - if (! $joinColumn->getType()) { |
|
| 476 | + if ( ! $joinColumn->getType()) { |
|
| 477 | 477 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 478 | 478 | } |
| 479 | 479 | |
@@ -500,18 +500,18 @@ discard block |
||
| 500 | 500 | case Type::SMALLINT: |
| 501 | 501 | case Type::INTEGER: |
| 502 | 502 | case Type::BIGINT: |
| 503 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 503 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 504 | 504 | break; |
| 505 | 505 | |
| 506 | 506 | case Type::DATETIME: |
| 507 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 507 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 508 | 508 | break; |
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 513 | - . ' SET ' . implode(', ', $set) |
|
| 514 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 512 | + $sql = 'UPDATE '.$quotedTableName |
|
| 513 | + . ' SET '.implode(', ', $set) |
|
| 514 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 515 | 515 | |
| 516 | 516 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 517 | 517 | |
@@ -528,7 +528,7 @@ discard block |
||
| 528 | 528 | protected function deleteJoinTableRecords($identifier) |
| 529 | 529 | { |
| 530 | 530 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 531 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 531 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 532 | 532 | continue; |
| 533 | 533 | } |
| 534 | 534 | |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | $otherKeys = []; |
| 541 | 541 | $keys = []; |
| 542 | 542 | |
| 543 | - if (! $owningAssociation->isOwningSide()) { |
|
| 543 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 544 | 544 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 545 | 545 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 546 | 546 | } |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | // Only owning side of x-1 associations can have a FK column. |
| 656 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 656 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 657 | 657 | continue; |
| 658 | 658 | } |
| 659 | 659 | |
@@ -673,7 +673,7 @@ discard block |
||
| 673 | 673 | /** @var JoinColumnMetadata $joinColumn */ |
| 674 | 674 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 675 | 675 | |
| 676 | - if (! $joinColumn->getType()) { |
|
| 676 | + if ( ! $joinColumn->getType()) { |
|
| 677 | 677 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 678 | 678 | } |
| 679 | 679 | |
@@ -701,7 +701,7 @@ discard block |
||
| 701 | 701 | $propertyName = $this->class->fieldNames[$columnName]; |
| 702 | 702 | $property = $this->class->getProperty($propertyName); |
| 703 | 703 | |
| 704 | - if (! $property) { |
|
| 704 | + if ( ! $property) { |
|
| 705 | 705 | return null; |
| 706 | 706 | } |
| 707 | 707 | |
@@ -720,7 +720,7 @@ discard block |
||
| 720 | 720 | /** @var JoinColumnMetadata $joinColumn */ |
| 721 | 721 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 722 | 722 | |
| 723 | - if (! $joinColumn->getType()) { |
|
| 723 | + if ( ! $joinColumn->getType()) { |
|
| 724 | 724 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 725 | 725 | } |
| 726 | 726 | |
@@ -825,7 +825,7 @@ discard block |
||
| 825 | 825 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
| 826 | 826 | $targetKeyColumn = $joinColumn->getColumnName(); |
| 827 | 827 | |
| 828 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 828 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 829 | 829 | throw MappingException::joinColumnMustPointToMappedField( |
| 830 | 830 | $sourceClass->getClassName(), |
| 831 | 831 | $sourceKeyColumn |
@@ -1052,7 +1052,7 @@ discard block |
||
| 1052 | 1052 | $criteria = []; |
| 1053 | 1053 | $parameters = []; |
| 1054 | 1054 | |
| 1055 | - if (! $association->isOwningSide()) { |
|
| 1055 | + if ( ! $association->isOwningSide()) { |
|
| 1056 | 1056 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1057 | 1057 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1058 | 1058 | } |
@@ -1080,7 +1080,7 @@ discard block |
||
| 1080 | 1080 | $value = $value[$targetClass->identifier[0]]; |
| 1081 | 1081 | } |
| 1082 | 1082 | |
| 1083 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1083 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1084 | 1084 | $parameters[] = [ |
| 1085 | 1085 | 'value' => $value, |
| 1086 | 1086 | 'field' => $fieldName, |
@@ -1130,11 +1130,11 @@ discard block |
||
| 1130 | 1130 | |
| 1131 | 1131 | switch ($lockMode) { |
| 1132 | 1132 | case LockMode::PESSIMISTIC_READ: |
| 1133 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1133 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1134 | 1134 | break; |
| 1135 | 1135 | |
| 1136 | 1136 | case LockMode::PESSIMISTIC_WRITE: |
| 1137 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1137 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1138 | 1138 | break; |
| 1139 | 1139 | } |
| 1140 | 1140 | |
@@ -1145,14 +1145,14 @@ discard block |
||
| 1145 | 1145 | |
| 1146 | 1146 | if ($filterSql !== '') { |
| 1147 | 1147 | $conditionSql = $conditionSql |
| 1148 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1148 | + ? $conditionSql.' AND '.$filterSql |
|
| 1149 | 1149 | : $filterSql; |
| 1150 | 1150 | } |
| 1151 | 1151 | |
| 1152 | - $select = 'SELECT ' . $columnList; |
|
| 1153 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
| 1154 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1155 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1152 | + $select = 'SELECT '.$columnList; |
|
| 1153 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1154 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1155 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1156 | 1156 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1157 | 1157 | $query = $select |
| 1158 | 1158 | . $lock |
@@ -1160,7 +1160,7 @@ discard block |
||
| 1160 | 1160 | . $where |
| 1161 | 1161 | . $orderBySql; |
| 1162 | 1162 | |
| 1163 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1163 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | 1166 | /** |
@@ -1179,13 +1179,13 @@ discard block |
||
| 1179 | 1179 | |
| 1180 | 1180 | if ($filterSql !== '') { |
| 1181 | 1181 | $conditionSql = $conditionSql |
| 1182 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1182 | + ? $conditionSql.' AND '.$filterSql |
|
| 1183 | 1183 | : $filterSql; |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| 1186 | 1186 | $sql = 'SELECT COUNT(*) ' |
| 1187 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1188 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1187 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1188 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1189 | 1189 | |
| 1190 | 1190 | return $sql; |
| 1191 | 1191 | } |
@@ -1202,7 +1202,7 @@ discard block |
||
| 1202 | 1202 | */ |
| 1203 | 1203 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1204 | 1204 | { |
| 1205 | - if (! $orderBy) { |
|
| 1205 | + if ( ! $orderBy) { |
|
| 1206 | 1206 | return ''; |
| 1207 | 1207 | } |
| 1208 | 1208 | |
@@ -1211,7 +1211,7 @@ discard block |
||
| 1211 | 1211 | foreach ($orderBy as $fieldName => $orientation) { |
| 1212 | 1212 | $orientation = strtoupper(trim($orientation)); |
| 1213 | 1213 | |
| 1214 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1214 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1215 | 1215 | throw InvalidOrientation::fromClassNameAndField($this->class->getClassName(), $fieldName); |
| 1216 | 1216 | } |
| 1217 | 1217 | |
@@ -1221,11 +1221,11 @@ discard block |
||
| 1221 | 1221 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1222 | 1222 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1223 | 1223 | |
| 1224 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1224 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1225 | 1225 | |
| 1226 | 1226 | continue; |
| 1227 | 1227 | } elseif ($property instanceof AssociationMetadata) { |
| 1228 | - if (! $property->isOwningSide()) { |
|
| 1228 | + if ( ! $property->isOwningSide()) { |
|
| 1229 | 1229 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1230 | 1230 | $this->class->getClassName(), |
| 1231 | 1231 | $fieldName |
@@ -1241,7 +1241,7 @@ discard block |
||
| 1241 | 1241 | /* @var JoinColumnMetadata $joinColumn */ |
| 1242 | 1242 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1243 | 1243 | |
| 1244 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1244 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1245 | 1245 | } |
| 1246 | 1246 | |
| 1247 | 1247 | continue; |
@@ -1250,7 +1250,7 @@ discard block |
||
| 1250 | 1250 | throw UnrecognizedField::byName($fieldName); |
| 1251 | 1251 | } |
| 1252 | 1252 | |
| 1253 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1253 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1254 | 1254 | } |
| 1255 | 1255 | |
| 1256 | 1256 | /** |
@@ -1292,7 +1292,7 @@ discard block |
||
| 1292 | 1292 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
| 1293 | 1293 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
| 1294 | 1294 | |
| 1295 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1295 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1296 | 1296 | break; |
| 1297 | 1297 | } |
| 1298 | 1298 | |
@@ -1307,7 +1307,7 @@ discard block |
||
| 1307 | 1307 | break; // now this is why you shouldn't use inheritance |
| 1308 | 1308 | } |
| 1309 | 1309 | |
| 1310 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1310 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1311 | 1311 | |
| 1312 | 1312 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1313 | 1313 | |
@@ -1335,14 +1335,14 @@ discard block |
||
| 1335 | 1335 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1336 | 1336 | } |
| 1337 | 1337 | |
| 1338 | - if (! $property->isOwningSide()) { |
|
| 1338 | + if ( ! $property->isOwningSide()) { |
|
| 1339 | 1339 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1340 | 1340 | } |
| 1341 | 1341 | |
| 1342 | 1342 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1343 | 1343 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1344 | 1344 | |
| 1345 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1345 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1346 | 1346 | |
| 1347 | 1347 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1348 | 1348 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1366,7 +1366,7 @@ discard block |
||
| 1366 | 1366 | $joinCondition[] = $filterSql; |
| 1367 | 1367 | } |
| 1368 | 1368 | |
| 1369 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1369 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1370 | 1370 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1371 | 1371 | |
| 1372 | 1372 | break; |
@@ -1388,7 +1388,7 @@ discard block |
||
| 1388 | 1388 | */ |
| 1389 | 1389 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1390 | 1390 | { |
| 1391 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1391 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1392 | 1392 | return ''; |
| 1393 | 1393 | } |
| 1394 | 1394 | |
@@ -1403,7 +1403,7 @@ discard block |
||
| 1403 | 1403 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1404 | 1404 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1405 | 1405 | |
| 1406 | - if (! $joinColumn->getType()) { |
|
| 1406 | + if ( ! $joinColumn->getType()) { |
|
| 1407 | 1407 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1408 | 1408 | } |
| 1409 | 1409 | |
@@ -1435,7 +1435,7 @@ discard block |
||
| 1435 | 1435 | $owningAssociation = $association; |
| 1436 | 1436 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1437 | 1437 | |
| 1438 | - if (! $association->isOwningSide()) { |
|
| 1438 | + if ( ! $association->isOwningSide()) { |
|
| 1439 | 1439 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1440 | 1440 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1441 | 1441 | } |
@@ -1457,7 +1457,7 @@ discard block |
||
| 1457 | 1457 | ); |
| 1458 | 1458 | } |
| 1459 | 1459 | |
| 1460 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1460 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1461 | 1461 | } |
| 1462 | 1462 | |
| 1463 | 1463 | /** |
@@ -1552,7 +1552,7 @@ discard block |
||
| 1552 | 1552 | $columnName = $joinColumn->getColumnName(); |
| 1553 | 1553 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1554 | 1554 | |
| 1555 | - if (! $joinColumn->getType()) { |
|
| 1555 | + if ( ! $joinColumn->getType()) { |
|
| 1556 | 1556 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1557 | 1557 | } |
| 1558 | 1558 | |
@@ -1591,7 +1591,7 @@ discard block |
||
| 1591 | 1591 | |
| 1592 | 1592 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1593 | 1593 | |
| 1594 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1594 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | 1597 | /** |
@@ -1605,14 +1605,14 @@ discard block |
||
| 1605 | 1605 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1606 | 1606 | { |
| 1607 | 1607 | if ($tableName) { |
| 1608 | - $tableName .= '#' . $assocName; |
|
| 1608 | + $tableName .= '#'.$assocName; |
|
| 1609 | 1609 | } |
| 1610 | 1610 | |
| 1611 | 1611 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1612 | 1612 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1613 | 1613 | } |
| 1614 | 1614 | |
| 1615 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1615 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1616 | 1616 | |
| 1617 | 1617 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1618 | 1618 | |
@@ -1638,7 +1638,7 @@ discard block |
||
| 1638 | 1638 | } |
| 1639 | 1639 | |
| 1640 | 1640 | $lock = $this->getLockTablesSql($lockMode); |
| 1641 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1641 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1642 | 1642 | $sql = 'SELECT 1 ' |
| 1643 | 1643 | . $lock |
| 1644 | 1644 | . $where |
@@ -1661,7 +1661,7 @@ discard block |
||
| 1661 | 1661 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1662 | 1662 | |
| 1663 | 1663 | return $this->platform->appendLockHint( |
| 1664 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1664 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1665 | 1665 | $lockMode |
| 1666 | 1666 | ); |
| 1667 | 1667 | } |
@@ -1711,19 +1711,19 @@ discard block |
||
| 1711 | 1711 | |
| 1712 | 1712 | if ($comparison !== null) { |
| 1713 | 1713 | // special case null value handling |
| 1714 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
| 1715 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1714 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
| 1715 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1716 | 1716 | |
| 1717 | 1717 | continue; |
| 1718 | 1718 | } |
| 1719 | 1719 | |
| 1720 | 1720 | if ($comparison === Comparison::NEQ && $value === null) { |
| 1721 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1721 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1722 | 1722 | |
| 1723 | 1723 | continue; |
| 1724 | 1724 | } |
| 1725 | 1725 | |
| 1726 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1726 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1727 | 1727 | |
| 1728 | 1728 | continue; |
| 1729 | 1729 | } |
@@ -1771,7 +1771,7 @@ discard block |
||
| 1771 | 1771 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1772 | 1772 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1773 | 1773 | |
| 1774 | - return [$tableAlias . '.' . $columnName]; |
|
| 1774 | + return [$tableAlias.'.'.$columnName]; |
|
| 1775 | 1775 | } |
| 1776 | 1776 | |
| 1777 | 1777 | if ($property instanceof AssociationMetadata) { |
@@ -1780,7 +1780,7 @@ discard block |
||
| 1780 | 1780 | |
| 1781 | 1781 | // Many-To-Many requires join table check for joinColumn |
| 1782 | 1782 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1783 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1783 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1784 | 1784 | $owningAssociation = $association; |
| 1785 | 1785 | } |
| 1786 | 1786 | |
@@ -1794,17 +1794,17 @@ discard block |
||
| 1794 | 1794 | foreach ($joinColumns as $joinColumn) { |
| 1795 | 1795 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1796 | 1796 | |
| 1797 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1797 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1798 | 1798 | } |
| 1799 | 1799 | } else { |
| 1800 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1800 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1801 | 1801 | throw InvalidFindByCall::fromInverseSideUsage( |
| 1802 | 1802 | $this->class->getClassName(), |
| 1803 | 1803 | $field |
| 1804 | 1804 | ); |
| 1805 | 1805 | } |
| 1806 | 1806 | |
| 1807 | - $class = $this->class->isInheritedProperty($field) |
|
| 1807 | + $class = $this->class->isInheritedProperty($field) |
|
| 1808 | 1808 | ? $owningAssociation->getDeclaringClass() |
| 1809 | 1809 | : $this->class |
| 1810 | 1810 | ; |
@@ -1813,7 +1813,7 @@ discard block |
||
| 1813 | 1813 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1814 | 1814 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1815 | 1815 | |
| 1816 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1816 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1817 | 1817 | } |
| 1818 | 1818 | } |
| 1819 | 1819 | |
@@ -1921,7 +1921,7 @@ discard block |
||
| 1921 | 1921 | $value = $value[$targetClass->identifier[0]]; |
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
| 1924 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
| 1925 | 1925 | $parameters[] = [ |
| 1926 | 1926 | 'value' => $value, |
| 1927 | 1927 | 'field' => $fieldName, |
@@ -2007,7 +2007,7 @@ discard block |
||
| 2007 | 2007 | case ($property instanceof AssociationMetadata): |
| 2008 | 2008 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2009 | 2009 | |
| 2010 | - if (! $property->isOwningSide()) { |
|
| 2010 | + if ( ! $property->isOwningSide()) { |
|
| 2011 | 2011 | $property = $class->getProperty($property->getMappedBy()); |
| 2012 | 2012 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2013 | 2013 | } |
@@ -2021,7 +2021,7 @@ discard block |
||
| 2021 | 2021 | /** @var JoinColumnMetadata $joinColumn */ |
| 2022 | 2022 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2023 | 2023 | |
| 2024 | - if (! $joinColumn->getType()) { |
|
| 2024 | + if ( ! $joinColumn->getType()) { |
|
| 2025 | 2025 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2026 | 2026 | } |
| 2027 | 2027 | |
@@ -2036,7 +2036,7 @@ discard block |
||
| 2036 | 2036 | } |
| 2037 | 2037 | |
| 2038 | 2038 | if (is_array($value)) { |
| 2039 | - return array_map(function ($type) { |
|
| 2039 | + return array_map(function($type) { |
|
| 2040 | 2040 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2041 | 2041 | }, $types); |
| 2042 | 2042 | } |
@@ -2093,7 +2093,7 @@ discard block |
||
| 2093 | 2093 | */ |
| 2094 | 2094 | private function getIndividualValue($value) |
| 2095 | 2095 | { |
| 2096 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2096 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2097 | 2097 | return $value; |
| 2098 | 2098 | } |
| 2099 | 2099 | |
@@ -2107,7 +2107,7 @@ discard block |
||
| 2107 | 2107 | { |
| 2108 | 2108 | $criteria = $this->getIdentifier($entity); |
| 2109 | 2109 | |
| 2110 | - if (! $criteria) { |
|
| 2110 | + if ( ! $criteria) { |
|
| 2111 | 2111 | return false; |
| 2112 | 2112 | } |
| 2113 | 2113 | |
@@ -2115,12 +2115,12 @@ discard block |
||
| 2115 | 2115 | |
| 2116 | 2116 | $sql = 'SELECT 1 ' |
| 2117 | 2117 | . $this->getLockTablesSql(null) |
| 2118 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2118 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2119 | 2119 | |
| 2120 | 2120 | list($params, $types) = $this->expandParameters($criteria); |
| 2121 | 2121 | |
| 2122 | 2122 | if ($extraConditions !== null) { |
| 2123 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2123 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2124 | 2124 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2125 | 2125 | |
| 2126 | 2126 | $params = array_merge($params, $criteriaParams); |
@@ -2130,7 +2130,7 @@ discard block |
||
| 2130 | 2130 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
| 2131 | 2131 | |
| 2132 | 2132 | if ($filterSql) { |
| 2133 | - $sql .= ' AND ' . $filterSql; |
|
| 2133 | + $sql .= ' AND '.$filterSql; |
|
| 2134 | 2134 | } |
| 2135 | 2135 | |
| 2136 | 2136 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2143,13 +2143,13 @@ discard block |
||
| 2143 | 2143 | */ |
| 2144 | 2144 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2145 | 2145 | { |
| 2146 | - if (! $association->isOwningSide()) { |
|
| 2146 | + if ( ! $association->isOwningSide()) { |
|
| 2147 | 2147 | return 'LEFT JOIN'; |
| 2148 | 2148 | } |
| 2149 | 2149 | |
| 2150 | 2150 | // if one of the join columns is nullable, return left join |
| 2151 | 2151 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2152 | - if (! $joinColumn->isNullable()) { |
|
| 2152 | + if ( ! $joinColumn->isNullable()) { |
|
| 2153 | 2153 | continue; |
| 2154 | 2154 | } |
| 2155 | 2155 | |
@@ -2166,7 +2166,7 @@ discard block |
||
| 2166 | 2166 | */ |
| 2167 | 2167 | public function getSQLColumnAlias() |
| 2168 | 2168 | { |
| 2169 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2169 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2170 | 2170 | } |
| 2171 | 2171 | |
| 2172 | 2172 | /** |
@@ -2185,13 +2185,13 @@ discard block |
||
| 2185 | 2185 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 2186 | 2186 | |
| 2187 | 2187 | if ($filterExpr !== '') { |
| 2188 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2188 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2189 | 2189 | } |
| 2190 | 2190 | } |
| 2191 | 2191 | |
| 2192 | 2192 | $sql = implode(' AND ', $filterClauses); |
| 2193 | 2193 | |
| 2194 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2194 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2195 | 2195 | } |
| 2196 | 2196 | |
| 2197 | 2197 | /** |
@@ -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\Cache; |
| 6 | 6 | |
@@ -62,17 +62,17 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | public function get(QueryCacheKey $key, ResultSetMapping $rsm, array $hints = []) |
| 64 | 64 | { |
| 65 | - if (! ($key->cacheMode & Cache::MODE_GET)) { |
|
| 65 | + if ( ! ($key->cacheMode & Cache::MODE_GET)) { |
|
| 66 | 66 | return null; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | $cacheEntry = $this->region->get($key); |
| 70 | 70 | |
| 71 | - if (! $cacheEntry instanceof QueryCacheEntry) { |
|
| 71 | + if ( ! $cacheEntry instanceof QueryCacheEntry) { |
|
| 72 | 72 | return null; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - if (! $this->validator->isValid($key, $cacheEntry)) { |
|
| 75 | + if ( ! $this->validator->isValid($key, $cacheEntry)) { |
|
| 76 | 76 | $this->region->evict($key); |
| 77 | 77 | |
| 78 | 78 | return null; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $cm = $this->em->getClassMetadata($entityName); |
| 90 | 90 | |
| 91 | - $generateKeys = function (array $entry) use ($cm) : EntityCacheKey { |
|
| 91 | + $generateKeys = function(array $entry) use ($cm) : EntityCacheKey { |
|
| 92 | 92 | return new EntityCacheKey($cm->getRootClassName(), $entry['identifier']); |
| 93 | 93 | }; |
| 94 | 94 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | $this->cacheLogger->entityCacheHit($regionName, $cacheKeys->identifiers[$index]); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - if (! $hasRelation) { |
|
| 114 | + if ( ! $hasRelation) { |
|
| 115 | 115 | $result[$index] = $unitOfWork->createEntity( |
| 116 | 116 | $entityEntry->class, |
| 117 | 117 | $entityEntry->resolveAssociationEntries($this->em), |
@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | continue; |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | - if (! isset($assoc['list']) || empty($assoc['list'])) { |
|
| 159 | + if ( ! isset($assoc['list']) || empty($assoc['list'])) { |
|
| 160 | 160 | continue; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - $generateKeys = function ($id) use ($assocMetadata) : EntityCacheKey { |
|
| 163 | + $generateKeys = function($id) use ($assocMetadata) : EntityCacheKey { |
|
| 164 | 164 | return new EntityCacheKey($assocMetadata->getRootClassName(), $id); |
| 165 | 165 | }; |
| 166 | 166 | |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | throw FeatureNotImplemented::multipleRootEntities(); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | - if (! $rsm->isSelect) { |
|
| 241 | + if ( ! $rsm->isSelect) { |
|
| 242 | 242 | throw FeatureNotImplemented::nonSelectStatements(); |
| 243 | 243 | } |
| 244 | 244 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | throw FeatureNotImplemented::partialEntities(); |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | - if (! ($key->cacheMode & Cache::MODE_PUT)) { |
|
| 249 | + if ( ! ($key->cacheMode & Cache::MODE_PUT)) { |
|
| 250 | 250 | return false; |
| 251 | 251 | } |
| 252 | 252 | |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | $unitOfWork = $this->em->getUnitOfWork(); |
| 257 | 257 | $persister = $unitOfWork->getEntityPersister($entityName); |
| 258 | 258 | |
| 259 | - if (! ($persister instanceof CachedPersister)) { |
|
| 259 | + if ( ! ($persister instanceof CachedPersister)) { |
|
| 260 | 260 | throw NonCacheableEntity::fromEntity($entityName); |
| 261 | 261 | } |
| 262 | 262 | |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | if (($key->cacheMode & Cache::MODE_REFRESH) || ! $region->contains($entityKey)) { |
| 270 | 270 | // Cancel put result if entity put fail |
| 271 | - if (! $persister->storeEntityCache($entity, $entityKey)) { |
|
| 271 | + if ( ! $persister->storeEntityCache($entity, $entityKey)) { |
|
| 272 | 272 | return false; |
| 273 | 273 | } |
| 274 | 274 | } |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | // store single nested association |
| 305 | - if (! is_array($assocValue)) { |
|
| 305 | + if ( ! is_array($assocValue)) { |
|
| 306 | 306 | // Cancel put result if association put fail |
| 307 | 307 | if ($this->storeAssociationCache($key, $association, $assocValue) === null) { |
| 308 | 308 | return false; |
@@ -342,9 +342,9 @@ discard block |
||
| 342 | 342 | $assocIdentifier = $unitOfWork->getEntityIdentifier($assocValue); |
| 343 | 343 | $entityKey = new EntityCacheKey($assocMetadata->getRootClassName(), $assocIdentifier); |
| 344 | 344 | |
| 345 | - if ((! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
| 345 | + if (( ! $assocValue instanceof GhostObjectInterface && ($key->cacheMode & Cache::MODE_REFRESH)) || ! $assocRegion->contains($entityKey)) { |
|
| 346 | 346 | // Entity put fail |
| 347 | - if (! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
| 347 | + if ( ! $assocPersister->storeEntityCache($assocValue, $entityKey)) { |
|
| 348 | 348 | return null; |
| 349 | 349 | } |
| 350 | 350 | } |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | |
| 365 | 365 | if (($key->cacheMode & Cache::MODE_REFRESH) || ! $assocRegion->contains($entityKey)) { |
| 366 | 366 | // Entity put fail |
| 367 | - if (! $assocPersister->storeEntityCache($assocItem, $entityKey)) { |
|
| 367 | + if ( ! $assocPersister->storeEntityCache($assocItem, $entityKey)) { |
|
| 368 | 368 | return null; |
| 369 | 369 | } |
| 370 | 370 | } |
@@ -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 | |
@@ -341,7 +341,7 @@ discard block |
||
| 341 | 341 | |
| 342 | 342 | $this->computeChangeSets(); |
| 343 | 343 | |
| 344 | - if (! ($this->entityInsertions || |
|
| 344 | + if ( ! ($this->entityInsertions || |
|
| 345 | 345 | $this->entityDeletions || |
| 346 | 346 | $this->entityUpdates || |
| 347 | 347 | $this->collectionUpdates || |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | // Entity deletions come last and need to be in reverse commit order |
| 401 | 401 | if ($this->entityDeletions) { |
| 402 | 402 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 403 | - if (! $this->entityDeletions) { |
|
| 403 | + if ( ! $this->entityDeletions) { |
|
| 404 | 404 | break; // just a performance optimisation |
| 405 | 405 | } |
| 406 | 406 | |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | $oid = spl_object_id($entity); |
| 484 | 484 | $data = []; |
| 485 | 485 | |
| 486 | - if (! isset($this->entityChangeSets[$oid])) { |
|
| 486 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 487 | 487 | return $data; |
| 488 | 488 | } |
| 489 | 489 | |
@@ -564,12 +564,12 @@ discard block |
||
| 564 | 564 | || ! $class->getProperty($name) instanceof FieldMetadata |
| 565 | 565 | || ! $class->getProperty($name)->hasValueGenerator() |
| 566 | 566 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
| 567 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 567 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 568 | 568 | $actualData[$name] = $value; |
| 569 | 569 | } |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 572 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 573 | 573 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
| 574 | 574 | // These result in an INSERT. |
| 575 | 575 | $this->originalEntityData[$oid] = $actualData; |
@@ -596,7 +596,7 @@ discard block |
||
| 596 | 596 | |
| 597 | 597 | foreach ($actualData as $propName => $actualValue) { |
| 598 | 598 | // skip field, its a partially omitted one! |
| 599 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 599 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 600 | 600 | continue; |
| 601 | 601 | } |
| 602 | 602 | |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | if ($owner === null) { // cloned |
| 619 | 619 | $actualValue->setOwner($entity, $property); |
| 620 | 620 | } elseif ($owner !== $entity) { // no clone, we have to fix |
| 621 | - if (! $actualValue->isInitialized()) { |
|
| 621 | + if ( ! $actualValue->isInitialized()) { |
|
| 622 | 622 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 623 | 623 | } |
| 624 | 624 | |
@@ -656,7 +656,7 @@ discard block |
||
| 656 | 656 | // Check if original value exists |
| 657 | 657 | if ($orgValue instanceof PersistentCollection) { |
| 658 | 658 | // A PersistentCollection was de-referenced, so delete it. |
| 659 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 659 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 660 | 660 | $this->scheduleCollectionDeletion($orgValue); |
| 661 | 661 | |
| 662 | 662 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | |
| 680 | 680 | // Look for changes in associations of the entity |
| 681 | 681 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 682 | - if (! $property instanceof AssociationMetadata) { |
|
| 682 | + if ( ! $property instanceof AssociationMetadata) { |
|
| 683 | 683 | continue; |
| 684 | 684 | } |
| 685 | 685 | |
@@ -746,7 +746,7 @@ discard block |
||
| 746 | 746 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
| 747 | 747 | $oid = spl_object_id($entity); |
| 748 | 748 | |
| 749 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 749 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 750 | 750 | $this->computeChangeSet($class, $entity); |
| 751 | 751 | } |
| 752 | 752 | } |
@@ -783,13 +783,13 @@ discard block |
||
| 783 | 783 | $targetClass = $this->em->getClassMetadata($targetEntity); |
| 784 | 784 | |
| 785 | 785 | foreach ($unwrappedValue as $key => $entry) { |
| 786 | - if (! ($entry instanceof $targetEntity)) { |
|
| 786 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 787 | 787 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 791 | 791 | |
| 792 | - if (! ($entry instanceof $targetEntity)) { |
|
| 792 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 793 | 793 | throw UnexpectedAssociationValue::create( |
| 794 | 794 | $association->getSourceEntity(), |
| 795 | 795 | $association->getName(), |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | |
| 801 | 801 | switch ($state) { |
| 802 | 802 | case self::STATE_NEW: |
| 803 | - if (! in_array('persist', $association->getCascade(), true)) { |
|
| 803 | + if ( ! in_array('persist', $association->getCascade(), true)) { |
|
| 804 | 804 | $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry]; |
| 805 | 805 | |
| 806 | 806 | break; |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | $persister = $this->getEntityPersister($class->getClassName()); |
| 850 | 850 | $generationPlan->executeImmediate($this->em, $entity); |
| 851 | 851 | |
| 852 | - if (! $generationPlan->containsDeferred()) { |
|
| 852 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 853 | 853 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 854 | 854 | $this->entityIdentifiers[$oid] = $id; |
| 855 | 855 | } |
@@ -880,7 +880,7 @@ discard block |
||
| 880 | 880 | { |
| 881 | 881 | $oid = spl_object_id($entity); |
| 882 | 882 | |
| 883 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 883 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 884 | 884 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
| 885 | 885 | } |
| 886 | 886 | |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | break; |
| 903 | 903 | |
| 904 | 904 | case ($property instanceof FieldMetadata): |
| 905 | - if (! $property->isPrimaryKey() |
|
| 905 | + if ( ! $property->isPrimaryKey() |
|
| 906 | 906 | || ! $property->getValueGenerator() |
| 907 | 907 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 908 | 908 | $actualData[$name] = $property->getValue($entity); |
@@ -916,7 +916,7 @@ discard block |
||
| 916 | 916 | } |
| 917 | 917 | } |
| 918 | 918 | |
| 919 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 919 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 920 | 920 | throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
| 921 | 921 | } |
| 922 | 922 | |
@@ -934,7 +934,7 @@ discard block |
||
| 934 | 934 | if ($changeSet) { |
| 935 | 935 | if (isset($this->entityChangeSets[$oid])) { |
| 936 | 936 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
| 937 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
| 937 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
| 938 | 938 | $this->entityChangeSets[$oid] = $changeSet; |
| 939 | 939 | $this->entityUpdates[$oid] = $entity; |
| 940 | 940 | } |
@@ -1004,7 +1004,7 @@ discard block |
||
| 1004 | 1004 | $this->recomputeSingleEntityChangeSet($class, $entity); |
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | - if (! empty($this->entityChangeSets[$oid])) { |
|
| 1007 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
| 1008 | 1008 | // echo 'Update: '; |
| 1009 | 1009 | // \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3); |
| 1010 | 1010 | |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1048 | 1048 | // is obtained by a new entity because the old one went out of scope. |
| 1049 | 1049 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1050 | - if (! $class->isIdentifierComposite()) { |
|
| 1050 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1051 | 1051 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1052 | 1052 | |
| 1053 | 1053 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1094,13 +1094,13 @@ discard block |
||
| 1094 | 1094 | // Calculate dependencies for new nodes |
| 1095 | 1095 | while ($class = array_pop($newNodes)) { |
| 1096 | 1096 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1097 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1097 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1098 | 1098 | continue; |
| 1099 | 1099 | } |
| 1100 | 1100 | |
| 1101 | 1101 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 1102 | 1102 | |
| 1103 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
| 1103 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
| 1104 | 1104 | $calc->addNode($targetClass->getClassName(), $targetClass); |
| 1105 | 1105 | |
| 1106 | 1106 | $newNodes[] = $targetClass; |
@@ -1108,7 +1108,7 @@ discard block |
||
| 1108 | 1108 | |
| 1109 | 1109 | $weight = ! array_filter( |
| 1110 | 1110 | $property->getJoinColumns(), |
| 1111 | - function (JoinColumnMetadata $joinColumn) { |
|
| 1111 | + function(JoinColumnMetadata $joinColumn) { |
|
| 1112 | 1112 | return $joinColumn->isNullable(); |
| 1113 | 1113 | } |
| 1114 | 1114 | ); |
@@ -1116,14 +1116,14 @@ discard block |
||
| 1116 | 1116 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
| 1117 | 1117 | |
| 1118 | 1118 | // If the target class has mapped subclasses, these share the same dependency. |
| 1119 | - if (! $targetClass->getSubClasses()) { |
|
| 1119 | + if ( ! $targetClass->getSubClasses()) { |
|
| 1120 | 1120 | continue; |
| 1121 | 1121 | } |
| 1122 | 1122 | |
| 1123 | 1123 | foreach ($targetClass->getSubClasses() as $subClassName) { |
| 1124 | 1124 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
| 1125 | 1125 | |
| 1126 | - if (! $calc->hasNode($subClassName)) { |
|
| 1126 | + if ( ! $calc->hasNode($subClassName)) { |
|
| 1127 | 1127 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
| 1128 | 1128 | |
| 1129 | 1129 | $newNodes[] = $targetSubClass; |
@@ -1199,7 +1199,7 @@ discard block |
||
| 1199 | 1199 | { |
| 1200 | 1200 | $oid = spl_object_id($entity); |
| 1201 | 1201 | |
| 1202 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
| 1202 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
| 1203 | 1203 | throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update'); |
| 1204 | 1204 | } |
| 1205 | 1205 | |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update'); |
| 1208 | 1208 | } |
| 1209 | 1209 | |
| 1210 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1210 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1211 | 1211 | $this->entityUpdates[$oid] = $entity; |
| 1212 | 1212 | } |
| 1213 | 1213 | } |
@@ -1283,7 +1283,7 @@ discard block |
||
| 1283 | 1283 | return; // entity has not been persisted yet, so nothing more to do. |
| 1284 | 1284 | } |
| 1285 | 1285 | |
| 1286 | - if (! $this->isInIdentityMap($entity)) { |
|
| 1286 | + if ( ! $this->isInIdentityMap($entity)) { |
|
| 1287 | 1287 | return; |
| 1288 | 1288 | } |
| 1289 | 1289 | |
@@ -1291,7 +1291,7 @@ discard block |
||
| 1291 | 1291 | |
| 1292 | 1292 | unset($this->entityUpdates[$oid]); |
| 1293 | 1293 | |
| 1294 | - if (! isset($this->entityDeletions[$oid])) { |
|
| 1294 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
| 1295 | 1295 | $this->entityDeletions[$oid] = $entity; |
| 1296 | 1296 | $this->entityStates[$oid] = self::STATE_REMOVED; |
| 1297 | 1297 | } |
@@ -1393,7 +1393,7 @@ discard block |
||
| 1393 | 1393 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1394 | 1394 | $id = $persister->getIdentifier($entity); |
| 1395 | 1395 | |
| 1396 | - if (! $id) { |
|
| 1396 | + if ( ! $id) { |
|
| 1397 | 1397 | return self::STATE_NEW; |
| 1398 | 1398 | } |
| 1399 | 1399 | |
@@ -1753,7 +1753,7 @@ discard block |
||
| 1753 | 1753 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1754 | 1754 | |
| 1755 | 1755 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1756 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1756 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1757 | 1757 | continue; |
| 1758 | 1758 | } |
| 1759 | 1759 | |
@@ -1800,7 +1800,7 @@ discard block |
||
| 1800 | 1800 | } |
| 1801 | 1801 | |
| 1802 | 1802 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1803 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1803 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1804 | 1804 | continue; |
| 1805 | 1805 | } |
| 1806 | 1806 | |
@@ -1816,7 +1816,7 @@ discard block |
||
| 1816 | 1816 | |
| 1817 | 1817 | case ($relatedEntities instanceof Collection): |
| 1818 | 1818 | case (is_array($relatedEntities)): |
| 1819 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1819 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1820 | 1820 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1821 | 1821 | $this->em->getClassMetadata($targetEntity), |
| 1822 | 1822 | $association, |
@@ -1831,7 +1831,7 @@ discard block |
||
| 1831 | 1831 | break; |
| 1832 | 1832 | |
| 1833 | 1833 | case ($relatedEntities !== null): |
| 1834 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1834 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1835 | 1835 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1836 | 1836 | $this->em->getClassMetadata($targetEntity), |
| 1837 | 1837 | $association, |
@@ -1860,7 +1860,7 @@ discard block |
||
| 1860 | 1860 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1861 | 1861 | |
| 1862 | 1862 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1863 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1863 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1864 | 1864 | continue; |
| 1865 | 1865 | } |
| 1866 | 1866 | |
@@ -1919,7 +1919,7 @@ discard block |
||
| 1919 | 1919 | |
| 1920 | 1920 | switch (true) { |
| 1921 | 1921 | case $lockMode === LockMode::OPTIMISTIC: |
| 1922 | - if (! $class->isVersioned()) { |
|
| 1922 | + if ( ! $class->isVersioned()) { |
|
| 1923 | 1923 | throw OptimisticLockException::notVersioned($class->getClassName()); |
| 1924 | 1924 | } |
| 1925 | 1925 | |
@@ -1942,7 +1942,7 @@ discard block |
||
| 1942 | 1942 | case $lockMode === LockMode::NONE: |
| 1943 | 1943 | case $lockMode === LockMode::PESSIMISTIC_READ: |
| 1944 | 1944 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
| 1945 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
| 1945 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 1946 | 1946 | throw TransactionRequiredException::transactionRequired(); |
| 1947 | 1947 | } |
| 1948 | 1948 | |
@@ -2101,7 +2101,7 @@ discard block |
||
| 2101 | 2101 | $entity->addPropertyChangedListener($this); |
| 2102 | 2102 | } |
| 2103 | 2103 | } else { |
| 2104 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
| 2104 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
| 2105 | 2105 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
| 2106 | 2106 | return $entity; |
| 2107 | 2107 | } |
@@ -2149,7 +2149,7 @@ discard block |
||
| 2149 | 2149 | } |
| 2150 | 2150 | |
| 2151 | 2151 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2152 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2152 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2153 | 2153 | continue; |
| 2154 | 2154 | } |
| 2155 | 2155 | |
@@ -2198,7 +2198,7 @@ discard block |
||
| 2198 | 2198 | continue; |
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | - if (! $association->isOwningSide()) { |
|
| 2201 | + if ( ! $association->isOwningSide()) { |
|
| 2202 | 2202 | // use the given entity association |
| 2203 | 2203 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2204 | 2204 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2248,7 +2248,7 @@ discard block |
||
| 2248 | 2248 | $associatedId[$targetField] = $joinColumnValue; |
| 2249 | 2249 | } |
| 2250 | 2250 | |
| 2251 | - if (! $associatedId) { |
|
| 2251 | + if ( ! $associatedId) { |
|
| 2252 | 2252 | // Foreign key is NULL |
| 2253 | 2253 | $association->setValue($entity, null); |
| 2254 | 2254 | $this->originalEntityData[$oid][$field] = null; |
@@ -2257,7 +2257,7 @@ discard block |
||
| 2257 | 2257 | } |
| 2258 | 2258 | |
| 2259 | 2259 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2260 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2260 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2261 | 2261 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2262 | 2262 | } |
| 2263 | 2263 | |
@@ -2274,7 +2274,7 @@ discard block |
||
| 2274 | 2274 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2275 | 2275 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2276 | 2276 | // then we can append this entity for eager loading! |
| 2277 | - if (! $targetClass->isIdentifierComposite() && |
|
| 2277 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2278 | 2278 | $newValue instanceof GhostObjectInterface && |
| 2279 | 2279 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2280 | 2280 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2357,7 +2357,7 @@ discard block |
||
| 2357 | 2357 | |
| 2358 | 2358 | public function triggerEagerLoads() |
| 2359 | 2359 | { |
| 2360 | - if (! $this->eagerLoadingEntities) { |
|
| 2360 | + if ( ! $this->eagerLoadingEntities) { |
|
| 2361 | 2361 | return; |
| 2362 | 2362 | } |
| 2363 | 2363 | |
@@ -2366,7 +2366,7 @@ discard block |
||
| 2366 | 2366 | $this->eagerLoadingEntities = []; |
| 2367 | 2367 | |
| 2368 | 2368 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
| 2369 | - if (! $ids) { |
|
| 2369 | + if ( ! $ids) { |
|
| 2370 | 2370 | continue; |
| 2371 | 2371 | } |
| 2372 | 2372 | |
@@ -2664,7 +2664,7 @@ discard block |
||
| 2664 | 2664 | { |
| 2665 | 2665 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2666 | 2666 | |
| 2667 | - if (! $class->getProperty($propertyName)) { |
|
| 2667 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2668 | 2668 | return; // ignore non-persistent fields |
| 2669 | 2669 | } |
| 2670 | 2670 | |
@@ -2673,7 +2673,7 @@ discard block |
||
| 2673 | 2673 | // Update changeset and mark entity for synchronization |
| 2674 | 2674 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
| 2675 | 2675 | |
| 2676 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2676 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2677 | 2677 | $this->scheduleForSynchronization($entity); |
| 2678 | 2678 | } |
| 2679 | 2679 | } |
@@ -2755,7 +2755,7 @@ discard block |
||
| 2755 | 2755 | */ |
| 2756 | 2756 | private static function objToStr($obj) |
| 2757 | 2757 | { |
| 2758 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
| 2758 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
| 2759 | 2759 | } |
| 2760 | 2760 | |
| 2761 | 2761 | /** |
@@ -2770,7 +2770,7 @@ discard block |
||
| 2770 | 2770 | */ |
| 2771 | 2771 | public function markReadOnly($object) |
| 2772 | 2772 | { |
| 2773 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2773 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2774 | 2774 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
| 2775 | 2775 | } |
| 2776 | 2776 | |
@@ -2788,7 +2788,7 @@ discard block |
||
| 2788 | 2788 | */ |
| 2789 | 2789 | public function isReadOnly($object) |
| 2790 | 2790 | { |
| 2791 | - if (! is_object($object)) { |
|
| 2791 | + if ( ! is_object($object)) { |
|
| 2792 | 2792 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
| 2793 | 2793 | } |
| 2794 | 2794 | |
@@ -2800,7 +2800,7 @@ discard block |
||
| 2800 | 2800 | */ |
| 2801 | 2801 | private function afterTransactionComplete() |
| 2802 | 2802 | { |
| 2803 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2803 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2804 | 2804 | $persister->afterTransactionComplete(); |
| 2805 | 2805 | }); |
| 2806 | 2806 | } |
@@ -2810,7 +2810,7 @@ discard block |
||
| 2810 | 2810 | */ |
| 2811 | 2811 | private function afterTransactionRolledBack() |
| 2812 | 2812 | { |
| 2813 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2813 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2814 | 2814 | $persister->afterTransactionRolledBack(); |
| 2815 | 2815 | }); |
| 2816 | 2816 | } |
@@ -2820,7 +2820,7 @@ discard block |
||
| 2820 | 2820 | */ |
| 2821 | 2821 | private function performCallbackOnCachedPersister(callable $callback) |
| 2822 | 2822 | { |
| 2823 | - if (! $this->hasCache) { |
|
| 2823 | + if ( ! $this->hasCache) { |
|
| 2824 | 2824 | return; |
| 2825 | 2825 | } |
| 2826 | 2826 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Persisters; |
| 6 | 6 | |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | public static function fromClassAndAssociation(string $class, string $associationName) : self |
| 13 | 13 | { |
| 14 | 14 | return new self(sprintf( |
| 15 | - 'Cannot match on %s::%s with a non-object value. Matching objects by id is ' . |
|
| 15 | + 'Cannot match on %s::%s with a non-object value. Matching objects by id is '. |
|
| 16 | 16 | 'not compatible with matching on an in-memory collection, which compares objects by reference.', |
| 17 | 17 | $class, |
| 18 | 18 | $associationName |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Cache\Exception; |
| 6 | 6 | |
@@ -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\Cache\Exception; |
| 6 | 6 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | public static function fromDriver(Cache $cache) : self |
| 12 | 12 | { |
| 13 | 13 | return new self( |
| 14 | - 'Query Cache uses a non-persistent cache driver, ' . get_class($cache) . '.' |
|
| 14 | + 'Query Cache uses a non-persistent cache driver, '.get_class($cache).'.' |
|
| 15 | 15 | ); |
| 16 | 16 | } |
| 17 | 17 | } |
@@ -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\Cache\Exception; |
| 6 | 6 | |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | public static function fromDriver(Cache $cache) : self |
| 12 | 12 | { |
| 13 | 13 | return new self( |
| 14 | - 'Metadata Cache uses a non-persistent cache driver, ' . get_class($cache) . '.' |
|
| 14 | + 'Metadata Cache uses a non-persistent cache driver, '.get_class($cache).'.' |
|
| 15 | 15 | ); |
| 16 | 16 | } |
| 17 | 17 | } |