@@ -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\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | $driver = new DatabaseDriver($sm); |
| 57 | 57 | |
| 58 | 58 | foreach ($driver->getAllClassNames() as $className) { |
| 59 | - if (!in_array(strtolower($className), $classNames, true)) { |
|
| 59 | + if ( ! in_array(strtolower($className), $classNames, true)) { |
|
| 60 | 60 | continue; |
| 61 | 61 | } |
| 62 | 62 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | if (count($metadatas) != count($classNames)) { |
| 71 | - $this->fail("Have not found all classes matching the names '" . implode(", ", $classNames) . "' only tables " . implode(", ", array_keys($metadatas))); |
|
| 71 | + $this->fail("Have not found all classes matching the names '".implode(", ", $classNames)."' only tables ".implode(", ", array_keys($metadatas))); |
|
| 72 | 72 | } |
| 73 | 73 | return $metadatas; |
| 74 | 74 | } |
@@ -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\Tests\ORM\Functional; |
| 6 | 6 | |
@@ -1115,11 +1115,11 @@ discard block |
||
| 1115 | 1115 | { |
| 1116 | 1116 | public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) |
| 1117 | 1117 | { |
| 1118 | - if (!in_array("LocaleAware", $targetEntity->getReflectionClass()->getInterfaceNames(), true)) { |
|
| 1118 | + if ( ! in_array("LocaleAware", $targetEntity->getReflectionClass()->getInterfaceNames(), true)) { |
|
| 1119 | 1119 | return ""; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | - return $targetTableAlias.'.locale = ' . $this->getParameter('locale'); // getParam uses connection to quote the value. |
|
| 1122 | + return $targetTableAlias.'.locale = '.$this->getParameter('locale'); // getParam uses connection to quote the value. |
|
| 1123 | 1123 | } |
| 1124 | 1124 | } |
| 1125 | 1125 | |
@@ -1131,7 +1131,7 @@ discard block |
||
| 1131 | 1131 | return ""; |
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | - return $targetTableAlias.'.country = ' . $this->getParameter('country'); // getParam uses connection to quote the value. |
|
| 1134 | + return $targetTableAlias.'.country = '.$this->getParameter('country'); // getParam uses connection to quote the value. |
|
| 1135 | 1135 | } |
| 1136 | 1136 | } |
| 1137 | 1137 | |
@@ -1143,7 +1143,7 @@ discard block |
||
| 1143 | 1143 | return ""; |
| 1144 | 1144 | } |
| 1145 | 1145 | |
| 1146 | - return $targetTableAlias.'.name LIKE ' . $this->getParameter('prefix'); // getParam uses connection to quote the value. |
|
| 1146 | + return $targetTableAlias.'.name LIKE '.$this->getParameter('prefix'); // getParam uses connection to quote the value. |
|
| 1147 | 1147 | } |
| 1148 | 1148 | } |
| 1149 | 1149 | |
@@ -1155,7 +1155,7 @@ discard block |
||
| 1155 | 1155 | return ""; |
| 1156 | 1156 | } |
| 1157 | 1157 | |
| 1158 | - return $targetTableAlias.'.topic = ' . $this->getParameter('topic'); // getParam uses connection to quote the value. |
|
| 1158 | + return $targetTableAlias.'.topic = '.$this->getParameter('topic'); // getParam uses connection to quote the value. |
|
| 1159 | 1159 | } |
| 1160 | 1160 | } |
| 1161 | 1161 | |
@@ -1167,7 +1167,7 @@ discard block |
||
| 1167 | 1167 | return ""; |
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | - return $targetTableAlias.'.name LIKE ' . $this->getParameter('name'); |
|
| 1170 | + return $targetTableAlias.'.name LIKE '.$this->getParameter('name'); |
|
| 1171 | 1171 | } |
| 1172 | 1172 | } |
| 1173 | 1173 | |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | return ""; |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | - return $targetTableAlias.'."completed" = ' . $this->getParameter('completed'); |
|
| 1182 | + return $targetTableAlias.'."completed" = '.$this->getParameter('completed'); |
|
| 1183 | 1183 | } |
| 1184 | 1184 | } |
| 1185 | 1185 | |
@@ -1191,6 +1191,6 @@ discard block |
||
| 1191 | 1191 | return ""; |
| 1192 | 1192 | } |
| 1193 | 1193 | |
| 1194 | - return $targetTableAlias.'.id = ' . $this->getParameter('id'); |
|
| 1194 | + return $targetTableAlias.'.id = '.$this->getParameter('id'); |
|
| 1195 | 1195 | } |
| 1196 | 1196 | } |
@@ -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\Tests\ORM\Functional\Ticket; |
| 6 | 6 | |
@@ -153,10 +153,10 @@ discard block |
||
| 153 | 153 | foreach ($content as $selection) { |
| 154 | 154 | $field = $result[$selection->field]; |
| 155 | 155 | $choiceList = $selection->choiceList; |
| 156 | - $fieldSelection = new DDC2602FieldSelection(); |
|
| 156 | + $fieldSelection = new DDC2602FieldSelection(); |
|
| 157 | 157 | |
| 158 | 158 | $fieldSelection->field = $field; |
| 159 | - $fieldSelection->choiceList = $field->choiceList->filter(function ($choice) use ($choiceList) { |
|
| 159 | + $fieldSelection->choiceList = $field->choiceList->filter(function($choice) use ($choiceList) { |
|
| 160 | 160 | return in_array($choice->id, $choiceList, true); |
| 161 | 161 | }); |
| 162 | 162 | |
@@ -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\Tests; |
| 6 | 6 | |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | if (isset($this->usedModelSets['directorytree'])) { |
| 414 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("file")); |
|
| 414 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("file")); |
|
| 415 | 415 | // MySQL doesn't know deferred deletions therefore only executing the second query gives errors. |
| 416 | 416 | $conn->executeUpdate('DELETE FROM Directory WHERE parentDirectory_id IS NOT NULL'); |
| 417 | 417 | $conn->executeUpdate('DELETE FROM Directory'); |
@@ -504,12 +504,12 @@ discard block |
||
| 504 | 504 | ) |
| 505 | 505 | ); |
| 506 | 506 | |
| 507 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-users-groups')); |
|
| 508 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-group")); |
|
| 509 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-phone")); |
|
| 510 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-user")); |
|
| 511 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier("quote-address")); |
|
| 512 | - $conn->executeUpdate('DELETE FROM ' . $platform->quoteIdentifier('quote-city')); |
|
| 507 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-users-groups')); |
|
| 508 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-group")); |
|
| 509 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-phone")); |
|
| 510 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-user")); |
|
| 511 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier("quote-address")); |
|
| 512 | + $conn->executeUpdate('DELETE FROM '.$platform->quoteIdentifier('quote-city')); |
|
| 513 | 513 | } |
| 514 | 514 | |
| 515 | 515 | if (isset($this->usedModelSets['vct_onetoone'])) { |
@@ -644,15 +644,15 @@ discard block |
||
| 644 | 644 | { |
| 645 | 645 | $this->setUpDBALTypes(); |
| 646 | 646 | |
| 647 | - if (! isset(static::$sharedConn)) { |
|
| 647 | + if ( ! isset(static::$sharedConn)) { |
|
| 648 | 648 | static::$sharedConn = TestUtil::getConnection(); |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | if (isset($GLOBALS['DOCTRINE_MARK_SQL_LOGS'])) { |
| 652 | 652 | if (in_array(static::$sharedConn->getDatabasePlatform()->getName(), ["mysql", "postgresql"], true)) { |
| 653 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/'); |
|
| 653 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/'); |
|
| 654 | 654 | } elseif (static::$sharedConn->getDatabasePlatform()->getName() === "oracle") { |
| 655 | - static::$sharedConn->executeQuery('SELECT 1 /*' . get_class($this) . '*/ FROM dual'); |
|
| 655 | + static::$sharedConn->executeQuery('SELECT 1 /*'.get_class($this).'*/ FROM dual'); |
|
| 656 | 656 | } |
| 657 | 657 | } |
| 658 | 658 | |
@@ -662,7 +662,7 @@ discard block |
||
| 662 | 662 | } |
| 663 | 663 | |
| 664 | 664 | foreach ($this->usedModelSets as $setName => $bool) { |
| 665 | - if (! isset(static::$tablesCreated[$setName])) { |
|
| 665 | + if ( ! isset(static::$tablesCreated[$setName])) { |
|
| 666 | 666 | $this->setUpEntitySchema(static::$modelSets[$setName]); |
| 667 | 667 | |
| 668 | 668 | static::$tablesCreated[$setName] = true; |
@@ -737,8 +737,8 @@ discard block |
||
| 737 | 737 | |
| 738 | 738 | $config->setMetadataDriverImpl( |
| 739 | 739 | $mappingDriver ?? $config->newDefaultAnnotationDriver([ |
| 740 | - realpath(__DIR__ . '/Models/Cache'), |
|
| 741 | - realpath(__DIR__ . '/Models/GeoNames') |
|
| 740 | + realpath(__DIR__.'/Models/Cache'), |
|
| 741 | + realpath(__DIR__.'/Models/GeoNames') |
|
| 742 | 742 | ]) |
| 743 | 743 | ); |
| 744 | 744 | |
@@ -815,7 +815,7 @@ discard block |
||
| 815 | 815 | |
| 816 | 816 | $message = "[".get_class($e)."] ".$e->getMessage().PHP_EOL.PHP_EOL."With queries:".PHP_EOL.$queries.PHP_EOL."Trace:".PHP_EOL.$traceMsg; |
| 817 | 817 | |
| 818 | - throw new \Exception($message, (int)$e->getCode(), $e); |
|
| 818 | + throw new \Exception($message, (int) $e->getCode(), $e); |
|
| 819 | 819 | } |
| 820 | 820 | |
| 821 | 821 | throw $e; |
@@ -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 | |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | |
| 322 | 322 | $this->computeChangeSets(); |
| 323 | 323 | |
| 324 | - if (! ($this->entityInsertions || |
|
| 324 | + if ( ! ($this->entityInsertions || |
|
| 325 | 325 | $this->entityDeletions || |
| 326 | 326 | $this->entityUpdates || |
| 327 | 327 | $this->collectionUpdates || |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | // Entity deletions come last and need to be in reverse commit order |
| 381 | 381 | if ($this->entityDeletions) { |
| 382 | 382 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 383 | - if (! $this->entityDeletions) { |
|
| 383 | + if ( ! $this->entityDeletions) { |
|
| 384 | 384 | break; // just a performance optimisation |
| 385 | 385 | } |
| 386 | 386 | |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | $oid = spl_object_id($entity); |
| 464 | 464 | $data = []; |
| 465 | 465 | |
| 466 | - if (! isset($this->entityChangeSets[$oid])) { |
|
| 466 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 467 | 467 | return $data; |
| 468 | 468 | } |
| 469 | 469 | |
@@ -544,12 +544,12 @@ discard block |
||
| 544 | 544 | || ! $class->getProperty($name) instanceof FieldMetadata |
| 545 | 545 | || ! $class->getProperty($name)->hasValueGenerator() |
| 546 | 546 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
| 547 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 547 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 548 | 548 | $actualData[$name] = $value; |
| 549 | 549 | } |
| 550 | 550 | } |
| 551 | 551 | |
| 552 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 552 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 553 | 553 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
| 554 | 554 | // These result in an INSERT. |
| 555 | 555 | $this->originalEntityData[$oid] = $actualData; |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | |
| 577 | 577 | foreach ($actualData as $propName => $actualValue) { |
| 578 | 578 | // skip field, its a partially omitted one! |
| 579 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 579 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 580 | 580 | continue; |
| 581 | 581 | } |
| 582 | 582 | |
@@ -598,7 +598,7 @@ discard block |
||
| 598 | 598 | if ($owner === null) { // cloned |
| 599 | 599 | $actualValue->setOwner($entity, $property); |
| 600 | 600 | } elseif ($owner !== $entity) { // no clone, we have to fix |
| 601 | - if (! $actualValue->isInitialized()) { |
|
| 601 | + if ( ! $actualValue->isInitialized()) { |
|
| 602 | 602 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 603 | 603 | } |
| 604 | 604 | |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | // Check if original value exists |
| 637 | 637 | if ($orgValue instanceof PersistentCollection) { |
| 638 | 638 | // A PersistentCollection was de-referenced, so delete it. |
| 639 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 639 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 640 | 640 | $this->scheduleCollectionDeletion($orgValue); |
| 641 | 641 | |
| 642 | 642 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | |
| 660 | 660 | // Look for changes in associations of the entity |
| 661 | 661 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 662 | - if (! $property instanceof AssociationMetadata) { |
|
| 662 | + if ( ! $property instanceof AssociationMetadata) { |
|
| 663 | 663 | continue; |
| 664 | 664 | } |
| 665 | 665 | |
@@ -726,7 +726,7 @@ discard block |
||
| 726 | 726 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
| 727 | 727 | $oid = spl_object_id($entity); |
| 728 | 728 | |
| 729 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 729 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 730 | 730 | $this->computeChangeSet($class, $entity); |
| 731 | 731 | } |
| 732 | 732 | } |
@@ -763,13 +763,13 @@ discard block |
||
| 763 | 763 | $targetClass = $this->em->getClassMetadata($targetEntity); |
| 764 | 764 | |
| 765 | 765 | foreach ($unwrappedValue as $key => $entry) { |
| 766 | - if (! ($entry instanceof $targetEntity)) { |
|
| 766 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 767 | 767 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry); |
| 768 | 768 | } |
| 769 | 769 | |
| 770 | 770 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 771 | 771 | |
| 772 | - if (! ($entry instanceof $targetEntity)) { |
|
| 772 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 773 | 773 | throw ORMException::unexpectedAssociationValue( |
| 774 | 774 | $association->getSourceEntity(), |
| 775 | 775 | $association->getName(), |
@@ -780,7 +780,7 @@ discard block |
||
| 780 | 780 | |
| 781 | 781 | switch ($state) { |
| 782 | 782 | case self::STATE_NEW: |
| 783 | - if (! in_array('persist', $association->getCascade(), true)) { |
|
| 783 | + if ( ! in_array('persist', $association->getCascade(), true)) { |
|
| 784 | 784 | $this->nonCascadedNewDetectedEntities[\spl_object_id($entry)] = [$association, $entry]; |
| 785 | 785 | |
| 786 | 786 | break; |
@@ -829,7 +829,7 @@ discard block |
||
| 829 | 829 | $persister = $this->getEntityPersister($class->getClassName()); |
| 830 | 830 | $generationPlan->executeImmediate($this->em, $entity); |
| 831 | 831 | |
| 832 | - if (! $generationPlan->containsDeferred()) { |
|
| 832 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 833 | 833 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 834 | 834 | $this->entityIdentifiers[$oid] = $id; |
| 835 | 835 | } |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | { |
| 861 | 861 | $oid = spl_object_id($entity); |
| 862 | 862 | |
| 863 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 863 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 864 | 864 | throw ORMInvalidArgumentException::entityNotManaged($entity); |
| 865 | 865 | } |
| 866 | 866 | |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | break; |
| 883 | 883 | |
| 884 | 884 | case ($property instanceof FieldMetadata): |
| 885 | - if (! $property->isPrimaryKey() |
|
| 885 | + if ( ! $property->isPrimaryKey() |
|
| 886 | 886 | || ! $property->getValueGenerator() |
| 887 | 887 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 888 | 888 | $actualData[$name] = $property->getValue($entity); |
@@ -896,7 +896,7 @@ discard block |
||
| 896 | 896 | } |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 899 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 900 | 900 | throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
| 901 | 901 | } |
| 902 | 902 | |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | if ($changeSet) { |
| 915 | 915 | if (isset($this->entityChangeSets[$oid])) { |
| 916 | 916 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
| 917 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
| 917 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
| 918 | 918 | $this->entityChangeSets[$oid] = $changeSet; |
| 919 | 919 | $this->entityUpdates[$oid] = $entity; |
| 920 | 920 | } |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | $this->recomputeSingleEntityChangeSet($class, $entity); |
| 985 | 985 | } |
| 986 | 986 | |
| 987 | - if (! empty($this->entityChangeSets[$oid])) { |
|
| 987 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
| 988 | 988 | // echo 'Update: '; |
| 989 | 989 | // \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3); |
| 990 | 990 | |
@@ -1027,7 +1027,7 @@ discard block |
||
| 1027 | 1027 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1028 | 1028 | // is obtained by a new entity because the old one went out of scope. |
| 1029 | 1029 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1030 | - if (! $class->isIdentifierComposite()) { |
|
| 1030 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1031 | 1031 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1032 | 1032 | |
| 1033 | 1033 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1074,13 +1074,13 @@ discard block |
||
| 1074 | 1074 | // Calculate dependencies for new nodes |
| 1075 | 1075 | while ($class = array_pop($newNodes)) { |
| 1076 | 1076 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1077 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1077 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1078 | 1078 | continue; |
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | 1081 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 1082 | 1082 | |
| 1083 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
| 1083 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
| 1084 | 1084 | $calc->addNode($targetClass->getClassName(), $targetClass); |
| 1085 | 1085 | |
| 1086 | 1086 | $newNodes[] = $targetClass; |
@@ -1088,7 +1088,7 @@ discard block |
||
| 1088 | 1088 | |
| 1089 | 1089 | $weight = ! array_filter( |
| 1090 | 1090 | $property->getJoinColumns(), |
| 1091 | - function (JoinColumnMetadata $joinColumn) { |
|
| 1091 | + function(JoinColumnMetadata $joinColumn) { |
|
| 1092 | 1092 | return $joinColumn->isNullable(); |
| 1093 | 1093 | } |
| 1094 | 1094 | ); |
@@ -1096,14 +1096,14 @@ discard block |
||
| 1096 | 1096 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
| 1097 | 1097 | |
| 1098 | 1098 | // If the target class has mapped subclasses, these share the same dependency. |
| 1099 | - if (! $targetClass->getSubClasses()) { |
|
| 1099 | + if ( ! $targetClass->getSubClasses()) { |
|
| 1100 | 1100 | continue; |
| 1101 | 1101 | } |
| 1102 | 1102 | |
| 1103 | 1103 | foreach ($targetClass->getSubClasses() as $subClassName) { |
| 1104 | 1104 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
| 1105 | 1105 | |
| 1106 | - if (! $calc->hasNode($subClassName)) { |
|
| 1106 | + if ( ! $calc->hasNode($subClassName)) { |
|
| 1107 | 1107 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
| 1108 | 1108 | |
| 1109 | 1109 | $newNodes[] = $targetSubClass; |
@@ -1179,7 +1179,7 @@ discard block |
||
| 1179 | 1179 | { |
| 1180 | 1180 | $oid = spl_object_id($entity); |
| 1181 | 1181 | |
| 1182 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
| 1182 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
| 1183 | 1183 | throw ORMInvalidArgumentException::entityHasNoIdentity($entity, 'scheduling for update'); |
| 1184 | 1184 | } |
| 1185 | 1185 | |
@@ -1187,7 +1187,7 @@ discard block |
||
| 1187 | 1187 | throw ORMInvalidArgumentException::entityIsRemoved($entity, 'schedule for update'); |
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1190 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1191 | 1191 | $this->entityUpdates[$oid] = $entity; |
| 1192 | 1192 | } |
| 1193 | 1193 | } |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | return; // entity has not been persisted yet, so nothing more to do. |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | - if (! $this->isInIdentityMap($entity)) { |
|
| 1266 | + if ( ! $this->isInIdentityMap($entity)) { |
|
| 1267 | 1267 | return; |
| 1268 | 1268 | } |
| 1269 | 1269 | |
@@ -1271,7 +1271,7 @@ discard block |
||
| 1271 | 1271 | |
| 1272 | 1272 | unset($this->entityUpdates[$oid]); |
| 1273 | 1273 | |
| 1274 | - if (! isset($this->entityDeletions[$oid])) { |
|
| 1274 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
| 1275 | 1275 | $this->entityDeletions[$oid] = $entity; |
| 1276 | 1276 | $this->entityStates[$oid] = self::STATE_REMOVED; |
| 1277 | 1277 | } |
@@ -1373,7 +1373,7 @@ discard block |
||
| 1373 | 1373 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1374 | 1374 | $id = $persister->getIdentifier($entity); |
| 1375 | 1375 | |
| 1376 | - if (! $id) { |
|
| 1376 | + if ( ! $id) { |
|
| 1377 | 1377 | return self::STATE_NEW; |
| 1378 | 1378 | } |
| 1379 | 1379 | |
@@ -1733,7 +1733,7 @@ discard block |
||
| 1733 | 1733 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1734 | 1734 | |
| 1735 | 1735 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1736 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1736 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1737 | 1737 | continue; |
| 1738 | 1738 | } |
| 1739 | 1739 | |
@@ -1780,7 +1780,7 @@ discard block |
||
| 1780 | 1780 | } |
| 1781 | 1781 | |
| 1782 | 1782 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1783 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1783 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1784 | 1784 | continue; |
| 1785 | 1785 | } |
| 1786 | 1786 | |
@@ -1796,7 +1796,7 @@ discard block |
||
| 1796 | 1796 | |
| 1797 | 1797 | case ($relatedEntities instanceof Collection): |
| 1798 | 1798 | case (is_array($relatedEntities)): |
| 1799 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1799 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1800 | 1800 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1801 | 1801 | $this->em->getClassMetadata($targetEntity), |
| 1802 | 1802 | $association, |
@@ -1811,7 +1811,7 @@ discard block |
||
| 1811 | 1811 | break; |
| 1812 | 1812 | |
| 1813 | 1813 | case ($relatedEntities !== null): |
| 1814 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1814 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1815 | 1815 | throw ORMInvalidArgumentException::invalidAssociation( |
| 1816 | 1816 | $this->em->getClassMetadata($targetEntity), |
| 1817 | 1817 | $association, |
@@ -1840,7 +1840,7 @@ discard block |
||
| 1840 | 1840 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1841 | 1841 | |
| 1842 | 1842 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1843 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1843 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1844 | 1844 | continue; |
| 1845 | 1845 | } |
| 1846 | 1846 | |
@@ -1899,7 +1899,7 @@ discard block |
||
| 1899 | 1899 | |
| 1900 | 1900 | switch (true) { |
| 1901 | 1901 | case $lockMode === LockMode::OPTIMISTIC: |
| 1902 | - if (! $class->isVersioned()) { |
|
| 1902 | + if ( ! $class->isVersioned()) { |
|
| 1903 | 1903 | throw OptimisticLockException::notVersioned($class->getClassName()); |
| 1904 | 1904 | } |
| 1905 | 1905 | |
@@ -1922,7 +1922,7 @@ discard block |
||
| 1922 | 1922 | case $lockMode === LockMode::NONE: |
| 1923 | 1923 | case $lockMode === LockMode::PESSIMISTIC_READ: |
| 1924 | 1924 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
| 1925 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
| 1925 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 1926 | 1926 | throw TransactionRequiredException::transactionRequired(); |
| 1927 | 1927 | } |
| 1928 | 1928 | |
@@ -2081,7 +2081,7 @@ discard block |
||
| 2081 | 2081 | $entity->addPropertyChangedListener($this); |
| 2082 | 2082 | } |
| 2083 | 2083 | } else { |
| 2084 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
| 2084 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
| 2085 | 2085 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
| 2086 | 2086 | return $entity; |
| 2087 | 2087 | } |
@@ -2129,7 +2129,7 @@ discard block |
||
| 2129 | 2129 | } |
| 2130 | 2130 | |
| 2131 | 2131 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2132 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2132 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2133 | 2133 | continue; |
| 2134 | 2134 | } |
| 2135 | 2135 | |
@@ -2178,7 +2178,7 @@ discard block |
||
| 2178 | 2178 | continue; |
| 2179 | 2179 | } |
| 2180 | 2180 | |
| 2181 | - if (! $association->isOwningSide()) { |
|
| 2181 | + if ( ! $association->isOwningSide()) { |
|
| 2182 | 2182 | // use the given entity association |
| 2183 | 2183 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2184 | 2184 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2228,7 +2228,7 @@ discard block |
||
| 2228 | 2228 | $associatedId[$targetField] = $joinColumnValue; |
| 2229 | 2229 | } |
| 2230 | 2230 | |
| 2231 | - if (! $associatedId) { |
|
| 2231 | + if ( ! $associatedId) { |
|
| 2232 | 2232 | // Foreign key is NULL |
| 2233 | 2233 | $association->setValue($entity, null); |
| 2234 | 2234 | $this->originalEntityData[$oid][$field] = null; |
@@ -2237,7 +2237,7 @@ discard block |
||
| 2237 | 2237 | } |
| 2238 | 2238 | |
| 2239 | 2239 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2240 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2240 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2241 | 2241 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2242 | 2242 | } |
| 2243 | 2243 | |
@@ -2254,7 +2254,7 @@ discard block |
||
| 2254 | 2254 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2255 | 2255 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2256 | 2256 | // then we can append this entity for eager loading! |
| 2257 | - if (! $targetClass->isIdentifierComposite() && |
|
| 2257 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2258 | 2258 | $newValue instanceof GhostObjectInterface && |
| 2259 | 2259 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2260 | 2260 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2337,7 +2337,7 @@ discard block |
||
| 2337 | 2337 | |
| 2338 | 2338 | public function triggerEagerLoads() |
| 2339 | 2339 | { |
| 2340 | - if (! $this->eagerLoadingEntities) { |
|
| 2340 | + if ( ! $this->eagerLoadingEntities) { |
|
| 2341 | 2341 | return; |
| 2342 | 2342 | } |
| 2343 | 2343 | |
@@ -2346,7 +2346,7 @@ discard block |
||
| 2346 | 2346 | $this->eagerLoadingEntities = []; |
| 2347 | 2347 | |
| 2348 | 2348 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
| 2349 | - if (! $ids) { |
|
| 2349 | + if ( ! $ids) { |
|
| 2350 | 2350 | continue; |
| 2351 | 2351 | } |
| 2352 | 2352 | |
@@ -2644,7 +2644,7 @@ discard block |
||
| 2644 | 2644 | { |
| 2645 | 2645 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2646 | 2646 | |
| 2647 | - if (! $class->getProperty($propertyName)) { |
|
| 2647 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2648 | 2648 | return; // ignore non-persistent fields |
| 2649 | 2649 | } |
| 2650 | 2650 | |
@@ -2653,7 +2653,7 @@ discard block |
||
| 2653 | 2653 | // Update changeset and mark entity for synchronization |
| 2654 | 2654 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
| 2655 | 2655 | |
| 2656 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2656 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2657 | 2657 | $this->scheduleForSynchronization($entity); |
| 2658 | 2658 | } |
| 2659 | 2659 | } |
@@ -2735,7 +2735,7 @@ discard block |
||
| 2735 | 2735 | */ |
| 2736 | 2736 | private static function objToStr($obj) |
| 2737 | 2737 | { |
| 2738 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
| 2738 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
| 2739 | 2739 | } |
| 2740 | 2740 | |
| 2741 | 2741 | /** |
@@ -2750,7 +2750,7 @@ discard block |
||
| 2750 | 2750 | */ |
| 2751 | 2751 | public function markReadOnly($object) |
| 2752 | 2752 | { |
| 2753 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2753 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2754 | 2754 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
| 2755 | 2755 | } |
| 2756 | 2756 | |
@@ -2768,7 +2768,7 @@ discard block |
||
| 2768 | 2768 | */ |
| 2769 | 2769 | public function isReadOnly($object) |
| 2770 | 2770 | { |
| 2771 | - if (! is_object($object)) { |
|
| 2771 | + if ( ! is_object($object)) { |
|
| 2772 | 2772 | throw ORMInvalidArgumentException::readOnlyRequiresManagedEntity($object); |
| 2773 | 2773 | } |
| 2774 | 2774 | |
@@ -2780,7 +2780,7 @@ discard block |
||
| 2780 | 2780 | */ |
| 2781 | 2781 | private function afterTransactionComplete() |
| 2782 | 2782 | { |
| 2783 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2783 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2784 | 2784 | $persister->afterTransactionComplete(); |
| 2785 | 2785 | }); |
| 2786 | 2786 | } |
@@ -2790,7 +2790,7 @@ discard block |
||
| 2790 | 2790 | */ |
| 2791 | 2791 | private function afterTransactionRolledBack() |
| 2792 | 2792 | { |
| 2793 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2793 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2794 | 2794 | $persister->afterTransactionRolledBack(); |
| 2795 | 2795 | }); |
| 2796 | 2796 | } |
@@ -2800,7 +2800,7 @@ discard block |
||
| 2800 | 2800 | */ |
| 2801 | 2801 | private function performCallbackOnCachedPersister(callable $callback) |
| 2802 | 2802 | { |
| 2803 | - if (! $this->hasCache) { |
|
| 2803 | + if ( ! $this->hasCache) { |
|
| 2804 | 2804 | return; |
| 2805 | 2805 | } |
| 2806 | 2806 | |
@@ -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 | |
@@ -283,16 +283,16 @@ discard block |
||
| 283 | 283 | $tableName = $versionedClass->table->getQuotedQualifiedName($this->platform); |
| 284 | 284 | $columnName = $this->platform->quoteIdentifier($versionProperty->getColumnName()); |
| 285 | 285 | $identifier = array_map( |
| 286 | - function ($columnName) { |
|
| 286 | + function($columnName) { |
|
| 287 | 287 | return $this->platform->quoteIdentifier($columnName); |
| 288 | 288 | }, |
| 289 | 289 | array_keys($versionedClass->getIdentifierColumns($this->em)) |
| 290 | 290 | ); |
| 291 | 291 | |
| 292 | 292 | // FIXME: Order with composite keys might not be correct |
| 293 | - $sql = 'SELECT ' . $columnName |
|
| 294 | - . ' FROM ' . $tableName |
|
| 295 | - . ' WHERE ' . implode(' = ? AND ', $identifier) . ' = ?'; |
|
| 293 | + $sql = 'SELECT '.$columnName |
|
| 294 | + . ' FROM '.$tableName |
|
| 295 | + . ' WHERE '.implode(' = ? AND ', $identifier).' = ?'; |
|
| 296 | 296 | |
| 297 | 297 | $flattenedId = $this->em->getIdentifierFlattener()->flattenIdentifier($versionedClass, $id); |
| 298 | 298 | $versionType = $versionProperty->getType(); |
@@ -331,13 +331,13 @@ discard block |
||
| 331 | 331 | $tableName = $this->class->getTableName(); |
| 332 | 332 | $updateData = $this->prepareUpdateData($entity); |
| 333 | 333 | |
| 334 | - if (! isset($updateData[$tableName])) { |
|
| 334 | + if ( ! isset($updateData[$tableName])) { |
|
| 335 | 335 | return; |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | $data = $updateData[$tableName]; |
| 339 | 339 | |
| 340 | - if (! $data) { |
|
| 340 | + if ( ! $data) { |
|
| 341 | 341 | return; |
| 342 | 342 | } |
| 343 | 343 | |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | |
| 391 | 391 | if ($value !== null) { |
| 392 | 392 | // @todo guilhermeblanco Make sure we do not have flat association values. |
| 393 | - if (! is_array($value)) { |
|
| 393 | + if ( ! is_array($value)) { |
|
| 394 | 394 | $value = [$targetClass->identifier[0] => $value]; |
| 395 | 395 | } |
| 396 | 396 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 404 | 404 | $targetField = $targetClass->fieldNames[$referencedColumnName]; |
| 405 | 405 | |
| 406 | - if (! $joinColumn->getType()) { |
|
| 406 | + if ( ! $joinColumn->getType()) { |
|
| 407 | 407 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 408 | 408 | } |
| 409 | 409 | |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 470 | 470 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 471 | 471 | |
| 472 | - if (! $joinColumn->getType()) { |
|
| 472 | + if ( ! $joinColumn->getType()) { |
|
| 473 | 473 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 474 | 474 | } |
| 475 | 475 | |
@@ -496,18 +496,18 @@ discard block |
||
| 496 | 496 | case Type::SMALLINT: |
| 497 | 497 | case Type::INTEGER: |
| 498 | 498 | case Type::BIGINT: |
| 499 | - $set[] = $versionColumnName . ' = ' . $versionColumnName . ' + 1'; |
|
| 499 | + $set[] = $versionColumnName.' = '.$versionColumnName.' + 1'; |
|
| 500 | 500 | break; |
| 501 | 501 | |
| 502 | 502 | case Type::DATETIME: |
| 503 | - $set[] = $versionColumnName . ' = CURRENT_TIMESTAMP'; |
|
| 503 | + $set[] = $versionColumnName.' = CURRENT_TIMESTAMP'; |
|
| 504 | 504 | break; |
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | - $sql = 'UPDATE ' . $quotedTableName |
|
| 509 | - . ' SET ' . implode(', ', $set) |
|
| 510 | - . ' WHERE ' . implode(' = ? AND ', $where) . ' = ?'; |
|
| 508 | + $sql = 'UPDATE '.$quotedTableName |
|
| 509 | + . ' SET '.implode(', ', $set) |
|
| 510 | + . ' WHERE '.implode(' = ? AND ', $where).' = ?'; |
|
| 511 | 511 | |
| 512 | 512 | $result = $this->conn->executeUpdate($sql, $params, $types); |
| 513 | 513 | |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | protected function deleteJoinTableRecords($identifier) |
| 525 | 525 | { |
| 526 | 526 | foreach ($this->class->getDeclaredPropertiesIterator() as $association) { |
| 527 | - if (! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 527 | + if ( ! ($association instanceof ManyToManyAssociationMetadata)) { |
|
| 528 | 528 | continue; |
| 529 | 529 | } |
| 530 | 530 | |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | $otherKeys = []; |
| 537 | 537 | $keys = []; |
| 538 | 538 | |
| 539 | - if (! $owningAssociation->isOwningSide()) { |
|
| 539 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 540 | 540 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 541 | 541 | $owningAssociation = $class->getProperty($association->getMappedBy()); |
| 542 | 542 | } |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | } |
| 650 | 650 | |
| 651 | 651 | // Only owning side of x-1 associations can have a FK column. |
| 652 | - if (! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 652 | + if ( ! $property instanceof ToOneAssociationMetadata || ! $property->isOwningSide()) { |
|
| 653 | 653 | continue; |
| 654 | 654 | } |
| 655 | 655 | |
@@ -669,7 +669,7 @@ discard block |
||
| 669 | 669 | /** @var JoinColumnMetadata $joinColumn */ |
| 670 | 670 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 671 | 671 | |
| 672 | - if (! $joinColumn->getType()) { |
|
| 672 | + if ( ! $joinColumn->getType()) { |
|
| 673 | 673 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 674 | 674 | } |
| 675 | 675 | |
@@ -697,7 +697,7 @@ discard block |
||
| 697 | 697 | $propertyName = $this->class->fieldNames[$columnName]; |
| 698 | 698 | $property = $this->class->getProperty($propertyName); |
| 699 | 699 | |
| 700 | - if (! $property) { |
|
| 700 | + if ( ! $property) { |
|
| 701 | 701 | return null; |
| 702 | 702 | } |
| 703 | 703 | |
@@ -716,7 +716,7 @@ discard block |
||
| 716 | 716 | /** @var JoinColumnMetadata $joinColumn */ |
| 717 | 717 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 718 | 718 | |
| 719 | - if (! $joinColumn->getType()) { |
|
| 719 | + if ( ! $joinColumn->getType()) { |
|
| 720 | 720 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 721 | 721 | } |
| 722 | 722 | |
@@ -821,7 +821,7 @@ discard block |
||
| 821 | 821 | $sourceKeyColumn = $joinColumn->getReferencedColumnName(); |
| 822 | 822 | $targetKeyColumn = $joinColumn->getColumnName(); |
| 823 | 823 | |
| 824 | - if (! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 824 | + if ( ! isset($sourceClass->fieldNames[$sourceKeyColumn])) { |
|
| 825 | 825 | throw MappingException::joinColumnMustPointToMappedField( |
| 826 | 826 | $sourceClass->getClassName(), |
| 827 | 827 | $sourceKeyColumn |
@@ -1048,7 +1048,7 @@ discard block |
||
| 1048 | 1048 | $criteria = []; |
| 1049 | 1049 | $parameters = []; |
| 1050 | 1050 | |
| 1051 | - if (! $association->isOwningSide()) { |
|
| 1051 | + if ( ! $association->isOwningSide()) { |
|
| 1052 | 1052 | $class = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1053 | 1053 | $owningAssoc = $class->getProperty($association->getMappedBy()); |
| 1054 | 1054 | } |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | $value = $value[$targetClass->identifier[0]]; |
| 1077 | 1077 | } |
| 1078 | 1078 | |
| 1079 | - $criteria[$joinTableName . '.' . $quotedColumnName] = $value; |
|
| 1079 | + $criteria[$joinTableName.'.'.$quotedColumnName] = $value; |
|
| 1080 | 1080 | $parameters[] = [ |
| 1081 | 1081 | 'value' => $value, |
| 1082 | 1082 | 'field' => $fieldName, |
@@ -1126,11 +1126,11 @@ discard block |
||
| 1126 | 1126 | |
| 1127 | 1127 | switch ($lockMode) { |
| 1128 | 1128 | case LockMode::PESSIMISTIC_READ: |
| 1129 | - $lockSql = ' ' . $this->platform->getReadLockSQL(); |
|
| 1129 | + $lockSql = ' '.$this->platform->getReadLockSQL(); |
|
| 1130 | 1130 | break; |
| 1131 | 1131 | |
| 1132 | 1132 | case LockMode::PESSIMISTIC_WRITE: |
| 1133 | - $lockSql = ' ' . $this->platform->getWriteLockSQL(); |
|
| 1133 | + $lockSql = ' '.$this->platform->getWriteLockSQL(); |
|
| 1134 | 1134 | break; |
| 1135 | 1135 | } |
| 1136 | 1136 | |
@@ -1141,14 +1141,14 @@ discard block |
||
| 1141 | 1141 | |
| 1142 | 1142 | if ($filterSql !== '') { |
| 1143 | 1143 | $conditionSql = $conditionSql |
| 1144 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1144 | + ? $conditionSql.' AND '.$filterSql |
|
| 1145 | 1145 | : $filterSql; |
| 1146 | 1146 | } |
| 1147 | 1147 | |
| 1148 | - $select = 'SELECT ' . $columnList; |
|
| 1149 | - $from = ' FROM ' . $tableName . ' ' . $tableAlias; |
|
| 1150 | - $join = $this->currentPersisterContext->selectJoinSql . $joinSql; |
|
| 1151 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : ''); |
|
| 1148 | + $select = 'SELECT '.$columnList; |
|
| 1149 | + $from = ' FROM '.$tableName.' '.$tableAlias; |
|
| 1150 | + $join = $this->currentPersisterContext->selectJoinSql.$joinSql; |
|
| 1151 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : ''); |
|
| 1152 | 1152 | $lock = $this->platform->appendLockHint($from, $lockMode); |
| 1153 | 1153 | $query = $select |
| 1154 | 1154 | . $lock |
@@ -1156,7 +1156,7 @@ discard block |
||
| 1156 | 1156 | . $where |
| 1157 | 1157 | . $orderBySql; |
| 1158 | 1158 | |
| 1159 | - return $this->platform->modifyLimitQuery($query, $limit, $offset) . $lockSql; |
|
| 1159 | + return $this->platform->modifyLimitQuery($query, $limit, $offset).$lockSql; |
|
| 1160 | 1160 | } |
| 1161 | 1161 | |
| 1162 | 1162 | /** |
@@ -1175,13 +1175,13 @@ discard block |
||
| 1175 | 1175 | |
| 1176 | 1176 | if ($filterSql !== '') { |
| 1177 | 1177 | $conditionSql = $conditionSql |
| 1178 | - ? $conditionSql . ' AND ' . $filterSql |
|
| 1178 | + ? $conditionSql.' AND '.$filterSql |
|
| 1179 | 1179 | : $filterSql; |
| 1180 | 1180 | } |
| 1181 | 1181 | |
| 1182 | 1182 | $sql = 'SELECT COUNT(*) ' |
| 1183 | - . 'FROM ' . $tableName . ' ' . $tableAlias |
|
| 1184 | - . (empty($conditionSql) ? '' : ' WHERE ' . $conditionSql); |
|
| 1183 | + . 'FROM '.$tableName.' '.$tableAlias |
|
| 1184 | + . (empty($conditionSql) ? '' : ' WHERE '.$conditionSql); |
|
| 1185 | 1185 | |
| 1186 | 1186 | return $sql; |
| 1187 | 1187 | } |
@@ -1198,7 +1198,7 @@ discard block |
||
| 1198 | 1198 | */ |
| 1199 | 1199 | final protected function getOrderBySQL(array $orderBy, $baseTableAlias) |
| 1200 | 1200 | { |
| 1201 | - if (! $orderBy) { |
|
| 1201 | + if ( ! $orderBy) { |
|
| 1202 | 1202 | return ''; |
| 1203 | 1203 | } |
| 1204 | 1204 | |
@@ -1207,7 +1207,7 @@ discard block |
||
| 1207 | 1207 | foreach ($orderBy as $fieldName => $orientation) { |
| 1208 | 1208 | $orientation = strtoupper(trim($orientation)); |
| 1209 | 1209 | |
| 1210 | - if (! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1210 | + if ( ! in_array($orientation, ['ASC', 'DESC'], true)) { |
|
| 1211 | 1211 | throw ORMException::invalidOrientation($this->class->getClassName(), $fieldName); |
| 1212 | 1212 | } |
| 1213 | 1213 | |
@@ -1217,11 +1217,11 @@ discard block |
||
| 1217 | 1217 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1218 | 1218 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1219 | 1219 | |
| 1220 | - $orderByList[] = $tableAlias . '.' . $columnName . ' ' . $orientation; |
|
| 1220 | + $orderByList[] = $tableAlias.'.'.$columnName.' '.$orientation; |
|
| 1221 | 1221 | |
| 1222 | 1222 | continue; |
| 1223 | 1223 | } elseif ($property instanceof AssociationMetadata) { |
| 1224 | - if (! $property->isOwningSide()) { |
|
| 1224 | + if ( ! $property->isOwningSide()) { |
|
| 1225 | 1225 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $fieldName); |
| 1226 | 1226 | } |
| 1227 | 1227 | |
@@ -1234,7 +1234,7 @@ discard block |
||
| 1234 | 1234 | /* @var JoinColumnMetadata $joinColumn */ |
| 1235 | 1235 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1236 | 1236 | |
| 1237 | - $orderByList[] = $tableAlias . '.' . $quotedColumnName . ' ' . $orientation; |
|
| 1237 | + $orderByList[] = $tableAlias.'.'.$quotedColumnName.' '.$orientation; |
|
| 1238 | 1238 | } |
| 1239 | 1239 | |
| 1240 | 1240 | continue; |
@@ -1243,7 +1243,7 @@ discard block |
||
| 1243 | 1243 | throw ORMException::unrecognizedField($fieldName); |
| 1244 | 1244 | } |
| 1245 | 1245 | |
| 1246 | - return ' ORDER BY ' . implode(', ', $orderByList); |
|
| 1246 | + return ' ORDER BY '.implode(', ', $orderByList); |
|
| 1247 | 1247 | } |
| 1248 | 1248 | |
| 1249 | 1249 | /** |
@@ -1285,7 +1285,7 @@ discard block |
||
| 1285 | 1285 | $isAssocToOneInverseSide = $property instanceof ToOneAssociationMetadata && ! $property->isOwningSide(); |
| 1286 | 1286 | $isAssocFromOneEager = ! $property instanceof ManyToManyAssociationMetadata && $property->getFetchMode() === FetchMode::EAGER; |
| 1287 | 1287 | |
| 1288 | - if (! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1288 | + if ( ! ($isAssocFromOneEager || $isAssocToOneInverseSide)) { |
|
| 1289 | 1289 | break; |
| 1290 | 1290 | } |
| 1291 | 1291 | |
@@ -1300,7 +1300,7 @@ discard block |
||
| 1300 | 1300 | break; // now this is why you shouldn't use inheritance |
| 1301 | 1301 | } |
| 1302 | 1302 | |
| 1303 | - $assocAlias = 'e' . ($eagerAliasCounter++); |
|
| 1303 | + $assocAlias = 'e'.($eagerAliasCounter++); |
|
| 1304 | 1304 | |
| 1305 | 1305 | $this->currentPersisterContext->rsm->addJoinedEntityResult($targetEntity, $assocAlias, 'r', $fieldName); |
| 1306 | 1306 | |
@@ -1328,14 +1328,14 @@ discard block |
||
| 1328 | 1328 | $this->currentPersisterContext->rsm->addIndexBy($assocAlias, $property->getIndexedBy()); |
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | - if (! $property->isOwningSide()) { |
|
| 1331 | + if ( ! $property->isOwningSide()) { |
|
| 1332 | 1332 | $owningAssociation = $eagerEntity->getProperty($property->getMappedBy()); |
| 1333 | 1333 | } |
| 1334 | 1334 | |
| 1335 | 1335 | $joinTableAlias = $this->getSQLTableAlias($eagerEntity->getTableName(), $assocAlias); |
| 1336 | 1336 | $joinTableName = $eagerEntity->table->getQuotedQualifiedName($this->platform); |
| 1337 | 1337 | |
| 1338 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $this->getJoinSQLForAssociation($property); |
|
| 1338 | + $this->currentPersisterContext->selectJoinSql .= ' '.$this->getJoinSQLForAssociation($property); |
|
| 1339 | 1339 | |
| 1340 | 1340 | $sourceClass = $this->em->getClassMetadata($owningAssociation->getSourceEntity()); |
| 1341 | 1341 | $targetClass = $this->em->getClassMetadata($owningAssociation->getTargetEntity()); |
@@ -1359,7 +1359,7 @@ discard block |
||
| 1359 | 1359 | $joinCondition[] = $filterSql; |
| 1360 | 1360 | } |
| 1361 | 1361 | |
| 1362 | - $this->currentPersisterContext->selectJoinSql .= ' ' . $joinTableName . ' ' . $joinTableAlias . ' ON '; |
|
| 1362 | + $this->currentPersisterContext->selectJoinSql .= ' '.$joinTableName.' '.$joinTableAlias.' ON '; |
|
| 1363 | 1363 | $this->currentPersisterContext->selectJoinSql .= implode(' AND ', $joinCondition); |
| 1364 | 1364 | |
| 1365 | 1365 | break; |
@@ -1381,7 +1381,7 @@ discard block |
||
| 1381 | 1381 | */ |
| 1382 | 1382 | protected function getSelectColumnAssociationSQL($field, AssociationMetadata $association, ClassMetadata $class, $alias = 'r') |
| 1383 | 1383 | { |
| 1384 | - if (! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1384 | + if ( ! ($association->isOwningSide() && $association instanceof ToOneAssociationMetadata)) { |
|
| 1385 | 1385 | return ''; |
| 1386 | 1386 | } |
| 1387 | 1387 | |
@@ -1396,7 +1396,7 @@ discard block |
||
| 1396 | 1396 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1397 | 1397 | $resultColumnName = $this->getSQLColumnAlias(); |
| 1398 | 1398 | |
| 1399 | - if (! $joinColumn->getType()) { |
|
| 1399 | + if ( ! $joinColumn->getType()) { |
|
| 1400 | 1400 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1401 | 1401 | } |
| 1402 | 1402 | |
@@ -1428,7 +1428,7 @@ discard block |
||
| 1428 | 1428 | $owningAssociation = $association; |
| 1429 | 1429 | $sourceTableAlias = $this->getSQLTableAlias($this->class->getTableName()); |
| 1430 | 1430 | |
| 1431 | - if (! $association->isOwningSide()) { |
|
| 1431 | + if ( ! $association->isOwningSide()) { |
|
| 1432 | 1432 | $targetEntity = $this->em->getClassMetadata($association->getTargetEntity()); |
| 1433 | 1433 | $owningAssociation = $targetEntity->getProperty($association->getMappedBy()); |
| 1434 | 1434 | } |
@@ -1450,7 +1450,7 @@ discard block |
||
| 1450 | 1450 | ); |
| 1451 | 1451 | } |
| 1452 | 1452 | |
| 1453 | - return ' INNER JOIN ' . $joinTableName . ' ON ' . implode(' AND ', $conditions); |
|
| 1453 | + return ' INNER JOIN '.$joinTableName.' ON '.implode(' AND ', $conditions); |
|
| 1454 | 1454 | } |
| 1455 | 1455 | |
| 1456 | 1456 | /** |
@@ -1545,7 +1545,7 @@ discard block |
||
| 1545 | 1545 | $columnName = $joinColumn->getColumnName(); |
| 1546 | 1546 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1547 | 1547 | |
| 1548 | - if (! $joinColumn->getType()) { |
|
| 1548 | + if ( ! $joinColumn->getType()) { |
|
| 1549 | 1549 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 1550 | 1550 | } |
| 1551 | 1551 | |
@@ -1584,7 +1584,7 @@ discard block |
||
| 1584 | 1584 | |
| 1585 | 1585 | $this->currentPersisterContext->rsm->addFieldResult($alias, $columnAlias, $field, $class->getClassName()); |
| 1586 | 1586 | |
| 1587 | - return $property->getType()->convertToPHPValueSQL($sql, $this->platform) . ' AS ' . $columnAlias; |
|
| 1587 | + return $property->getType()->convertToPHPValueSQL($sql, $this->platform).' AS '.$columnAlias; |
|
| 1588 | 1588 | } |
| 1589 | 1589 | |
| 1590 | 1590 | /** |
@@ -1598,14 +1598,14 @@ discard block |
||
| 1598 | 1598 | protected function getSQLTableAlias($tableName, $assocName = '') |
| 1599 | 1599 | { |
| 1600 | 1600 | if ($tableName) { |
| 1601 | - $tableName .= '#' . $assocName; |
|
| 1601 | + $tableName .= '#'.$assocName; |
|
| 1602 | 1602 | } |
| 1603 | 1603 | |
| 1604 | 1604 | if (isset($this->currentPersisterContext->sqlTableAliases[$tableName])) { |
| 1605 | 1605 | return $this->currentPersisterContext->sqlTableAliases[$tableName]; |
| 1606 | 1606 | } |
| 1607 | 1607 | |
| 1608 | - $tableAlias = 't' . $this->currentPersisterContext->sqlAliasCounter++; |
|
| 1608 | + $tableAlias = 't'.$this->currentPersisterContext->sqlAliasCounter++; |
|
| 1609 | 1609 | |
| 1610 | 1610 | $this->currentPersisterContext->sqlTableAliases[$tableName] = $tableAlias; |
| 1611 | 1611 | |
@@ -1631,7 +1631,7 @@ discard block |
||
| 1631 | 1631 | } |
| 1632 | 1632 | |
| 1633 | 1633 | $lock = $this->getLockTablesSql($lockMode); |
| 1634 | - $where = ($conditionSql ? ' WHERE ' . $conditionSql : '') . ' '; |
|
| 1634 | + $where = ($conditionSql ? ' WHERE '.$conditionSql : '').' '; |
|
| 1635 | 1635 | $sql = 'SELECT 1 ' |
| 1636 | 1636 | . $lock |
| 1637 | 1637 | . $where |
@@ -1654,7 +1654,7 @@ discard block |
||
| 1654 | 1654 | $tableName = $this->class->table->getQuotedQualifiedName($this->platform); |
| 1655 | 1655 | |
| 1656 | 1656 | return $this->platform->appendLockHint( |
| 1657 | - 'FROM ' . $tableName . ' ' . $this->getSQLTableAlias($this->class->getTableName()), |
|
| 1657 | + 'FROM '.$tableName.' '.$this->getSQLTableAlias($this->class->getTableName()), |
|
| 1658 | 1658 | $lockMode |
| 1659 | 1659 | ); |
| 1660 | 1660 | } |
@@ -1704,19 +1704,19 @@ discard block |
||
| 1704 | 1704 | |
| 1705 | 1705 | if ($comparison !== null) { |
| 1706 | 1706 | // special case null value handling |
| 1707 | - if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value ===null) { |
|
| 1708 | - $selectedColumns[] = $column . ' IS NULL'; |
|
| 1707 | + if (($comparison === Comparison::EQ || $comparison === Comparison::IS) && $value === null) { |
|
| 1708 | + $selectedColumns[] = $column.' IS NULL'; |
|
| 1709 | 1709 | |
| 1710 | 1710 | continue; |
| 1711 | 1711 | } |
| 1712 | 1712 | |
| 1713 | 1713 | if ($comparison === Comparison::NEQ && $value === null) { |
| 1714 | - $selectedColumns[] = $column . ' IS NOT NULL'; |
|
| 1714 | + $selectedColumns[] = $column.' IS NOT NULL'; |
|
| 1715 | 1715 | |
| 1716 | 1716 | continue; |
| 1717 | 1717 | } |
| 1718 | 1718 | |
| 1719 | - $selectedColumns[] = $column . ' ' . sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1719 | + $selectedColumns[] = $column.' '.sprintf(self::$comparisonMap[$comparison], $placeholder); |
|
| 1720 | 1720 | |
| 1721 | 1721 | continue; |
| 1722 | 1722 | } |
@@ -1764,7 +1764,7 @@ discard block |
||
| 1764 | 1764 | $tableAlias = $this->getSQLTableAlias($property->getTableName()); |
| 1765 | 1765 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 1766 | 1766 | |
| 1767 | - return [$tableAlias . '.' . $columnName]; |
|
| 1767 | + return [$tableAlias.'.'.$columnName]; |
|
| 1768 | 1768 | } |
| 1769 | 1769 | |
| 1770 | 1770 | if ($property instanceof AssociationMetadata) { |
@@ -1773,7 +1773,7 @@ discard block |
||
| 1773 | 1773 | |
| 1774 | 1774 | // Many-To-Many requires join table check for joinColumn |
| 1775 | 1775 | if ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
| 1776 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1776 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1777 | 1777 | $owningAssociation = $association; |
| 1778 | 1778 | } |
| 1779 | 1779 | |
@@ -1787,14 +1787,14 @@ discard block |
||
| 1787 | 1787 | foreach ($joinColumns as $joinColumn) { |
| 1788 | 1788 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1789 | 1789 | |
| 1790 | - $columns[] = $joinTableName . '.' . $quotedColumnName; |
|
| 1790 | + $columns[] = $joinTableName.'.'.$quotedColumnName; |
|
| 1791 | 1791 | } |
| 1792 | 1792 | } else { |
| 1793 | - if (! $owningAssociation->isOwningSide()) { |
|
| 1793 | + if ( ! $owningAssociation->isOwningSide()) { |
|
| 1794 | 1794 | throw ORMException::invalidFindByInverseAssociation($this->class->getClassName(), $field); |
| 1795 | 1795 | } |
| 1796 | 1796 | |
| 1797 | - $class = $this->class->isInheritedProperty($field) |
|
| 1797 | + $class = $this->class->isInheritedProperty($field) |
|
| 1798 | 1798 | ? $owningAssociation->getDeclaringClass() |
| 1799 | 1799 | : $this->class |
| 1800 | 1800 | ; |
@@ -1803,7 +1803,7 @@ discard block |
||
| 1803 | 1803 | foreach ($owningAssociation->getJoinColumns() as $joinColumn) { |
| 1804 | 1804 | $quotedColumnName = $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
| 1805 | 1805 | |
| 1806 | - $columns[] = $tableAlias . '.' . $quotedColumnName; |
|
| 1806 | + $columns[] = $tableAlias.'.'.$quotedColumnName; |
|
| 1807 | 1807 | } |
| 1808 | 1808 | } |
| 1809 | 1809 | |
@@ -1911,7 +1911,7 @@ discard block |
||
| 1911 | 1911 | $value = $value[$targetClass->identifier[0]]; |
| 1912 | 1912 | } |
| 1913 | 1913 | |
| 1914 | - $criteria[$tableAlias . '.' . $quotedColumnName] = $value; |
|
| 1914 | + $criteria[$tableAlias.'.'.$quotedColumnName] = $value; |
|
| 1915 | 1915 | $parameters[] = [ |
| 1916 | 1916 | 'value' => $value, |
| 1917 | 1917 | 'field' => $fieldName, |
@@ -1997,7 +1997,7 @@ discard block |
||
| 1997 | 1997 | case ($property instanceof AssociationMetadata): |
| 1998 | 1998 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 1999 | 1999 | |
| 2000 | - if (! $property->isOwningSide()) { |
|
| 2000 | + if ( ! $property->isOwningSide()) { |
|
| 2001 | 2001 | $property = $class->getProperty($property->getMappedBy()); |
| 2002 | 2002 | $class = $this->em->getClassMetadata($property->getTargetEntity()); |
| 2003 | 2003 | } |
@@ -2011,7 +2011,7 @@ discard block |
||
| 2011 | 2011 | /** @var JoinColumnMetadata $joinColumn */ |
| 2012 | 2012 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 2013 | 2013 | |
| 2014 | - if (! $joinColumn->getType()) { |
|
| 2014 | + if ( ! $joinColumn->getType()) { |
|
| 2015 | 2015 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em)); |
| 2016 | 2016 | } |
| 2017 | 2017 | |
@@ -2026,7 +2026,7 @@ discard block |
||
| 2026 | 2026 | } |
| 2027 | 2027 | |
| 2028 | 2028 | if (is_array($value)) { |
| 2029 | - return array_map(function ($type) { |
|
| 2029 | + return array_map(function($type) { |
|
| 2030 | 2030 | return $type->getBindingType() + Connection::ARRAY_PARAM_OFFSET; |
| 2031 | 2031 | }, $types); |
| 2032 | 2032 | } |
@@ -2083,7 +2083,7 @@ discard block |
||
| 2083 | 2083 | */ |
| 2084 | 2084 | private function getIndividualValue($value) |
| 2085 | 2085 | { |
| 2086 | - if (! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2086 | + if ( ! is_object($value) || ! $this->em->getMetadataFactory()->hasMetadataFor(StaticClassNameConverter::getClass($value))) { |
|
| 2087 | 2087 | return $value; |
| 2088 | 2088 | } |
| 2089 | 2089 | |
@@ -2097,7 +2097,7 @@ discard block |
||
| 2097 | 2097 | { |
| 2098 | 2098 | $criteria = $this->getIdentifier($entity); |
| 2099 | 2099 | |
| 2100 | - if (! $criteria) { |
|
| 2100 | + if ( ! $criteria) { |
|
| 2101 | 2101 | return false; |
| 2102 | 2102 | } |
| 2103 | 2103 | |
@@ -2105,12 +2105,12 @@ discard block |
||
| 2105 | 2105 | |
| 2106 | 2106 | $sql = 'SELECT 1 ' |
| 2107 | 2107 | . $this->getLockTablesSql(null) |
| 2108 | - . ' WHERE ' . $this->getSelectConditionSQL($criteria); |
|
| 2108 | + . ' WHERE '.$this->getSelectConditionSQL($criteria); |
|
| 2109 | 2109 | |
| 2110 | 2110 | list($params, $types) = $this->expandParameters($criteria); |
| 2111 | 2111 | |
| 2112 | 2112 | if ($extraConditions !== null) { |
| 2113 | - $sql .= ' AND ' . $this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2113 | + $sql .= ' AND '.$this->getSelectConditionCriteriaSQL($extraConditions); |
|
| 2114 | 2114 | list($criteriaParams, $criteriaTypes) = $this->expandCriteriaParameters($extraConditions); |
| 2115 | 2115 | |
| 2116 | 2116 | $params = array_merge($params, $criteriaParams); |
@@ -2120,7 +2120,7 @@ discard block |
||
| 2120 | 2120 | $filterSql = $this->generateFilterConditionSQL($this->class, $alias); |
| 2121 | 2121 | |
| 2122 | 2122 | if ($filterSql) { |
| 2123 | - $sql .= ' AND ' . $filterSql; |
|
| 2123 | + $sql .= ' AND '.$filterSql; |
|
| 2124 | 2124 | } |
| 2125 | 2125 | |
| 2126 | 2126 | return (bool) $this->conn->fetchColumn($sql, $params, 0, $types); |
@@ -2133,13 +2133,13 @@ discard block |
||
| 2133 | 2133 | */ |
| 2134 | 2134 | protected function getJoinSQLForAssociation(AssociationMetadata $association) |
| 2135 | 2135 | { |
| 2136 | - if (! $association->isOwningSide()) { |
|
| 2136 | + if ( ! $association->isOwningSide()) { |
|
| 2137 | 2137 | return 'LEFT JOIN'; |
| 2138 | 2138 | } |
| 2139 | 2139 | |
| 2140 | 2140 | // if one of the join columns is nullable, return left join |
| 2141 | 2141 | foreach ($association->getJoinColumns() as $joinColumn) { |
| 2142 | - if (! $joinColumn->isNullable()) { |
|
| 2142 | + if ( ! $joinColumn->isNullable()) { |
|
| 2143 | 2143 | continue; |
| 2144 | 2144 | } |
| 2145 | 2145 | |
@@ -2156,7 +2156,7 @@ discard block |
||
| 2156 | 2156 | */ |
| 2157 | 2157 | public function getSQLColumnAlias() |
| 2158 | 2158 | { |
| 2159 | - return $this->platform->getSQLResultCasing('c' . $this->currentPersisterContext->sqlAliasCounter++); |
|
| 2159 | + return $this->platform->getSQLResultCasing('c'.$this->currentPersisterContext->sqlAliasCounter++); |
|
| 2160 | 2160 | } |
| 2161 | 2161 | |
| 2162 | 2162 | /** |
@@ -2175,13 +2175,13 @@ discard block |
||
| 2175 | 2175 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 2176 | 2176 | |
| 2177 | 2177 | if ($filterExpr !== '') { |
| 2178 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 2178 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 2179 | 2179 | } |
| 2180 | 2180 | } |
| 2181 | 2181 | |
| 2182 | 2182 | $sql = implode(' AND ', $filterClauses); |
| 2183 | 2183 | |
| 2184 | - return $sql ? '(' . $sql . ')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2184 | + return $sql ? '('.$sql.')' : ''; // Wrap again to avoid "X or Y and FilterConditionSQL" |
|
| 2185 | 2185 | } |
| 2186 | 2186 | |
| 2187 | 2187 | /** |
@@ -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\Mapping; |
| 6 | 6 | |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | */ |
| 288 | 288 | public function __toString() |
| 289 | 289 | { |
| 290 | - return __CLASS__ . '@' . spl_object_id($this); |
|
| 290 | + return __CLASS__.'@'.spl_object_id($this); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | // Restore ReflectionClass and properties |
| 387 | 387 | $this->reflectionClass = $reflectionService->getClass($this->className); |
| 388 | 388 | |
| 389 | - if (! $this->reflectionClass) { |
|
| 389 | + if ( ! $this->reflectionClass) { |
|
| 390 | 390 | return; |
| 391 | 391 | } |
| 392 | 392 | |
@@ -410,11 +410,11 @@ discard block |
||
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | // Verify & complete identifier mapping |
| 413 | - if (! $this->identifier) { |
|
| 413 | + if ( ! $this->identifier) { |
|
| 414 | 414 | throw MappingException::identifierRequired($this->className); |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | - $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function (Property $property) : bool { |
|
| 417 | + $explicitlyGeneratedProperties = array_filter($this->declaredProperties, function(Property $property) : bool { |
|
| 418 | 418 | return $property instanceof FieldMetadata |
| 419 | 419 | && $property->isPrimaryKey() |
| 420 | 420 | && $property->hasValueGenerator(); |
@@ -433,14 +433,14 @@ discard block |
||
| 433 | 433 | public function validateAssociations() : void |
| 434 | 434 | { |
| 435 | 435 | array_map( |
| 436 | - function (Property $property) { |
|
| 437 | - if (! ($property instanceof AssociationMetadata)) { |
|
| 436 | + function(Property $property) { |
|
| 437 | + if ( ! ($property instanceof AssociationMetadata)) { |
|
| 438 | 438 | return; |
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | $targetEntity = $property->getTargetEntity(); |
| 442 | 442 | |
| 443 | - if (! class_exists($targetEntity)) { |
|
| 443 | + if ( ! class_exists($targetEntity)) { |
|
| 444 | 444 | throw MappingException::invalidTargetEntityClass($targetEntity, $this->className, $property->getName()); |
| 445 | 445 | } |
| 446 | 446 | }, |
@@ -458,7 +458,7 @@ discard block |
||
| 458 | 458 | foreach ($this->lifecycleCallbacks as $callbacks) { |
| 459 | 459 | /** @var array $callbacks */ |
| 460 | 460 | foreach ($callbacks as $callbackFuncName) { |
| 461 | - if (! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 461 | + if ( ! $reflectionService->hasPublicMethod($this->className, $callbackFuncName)) { |
|
| 462 | 462 | throw MappingException::lifecycleCallbackMethodNotFound($this->className, $callbackFuncName); |
| 463 | 463 | } |
| 464 | 464 | } |
@@ -482,11 +482,11 @@ discard block |
||
| 482 | 482 | */ |
| 483 | 483 | public function isIdentifier(string $fieldName) : bool |
| 484 | 484 | { |
| 485 | - if (! $this->identifier) { |
|
| 485 | + if ( ! $this->identifier) { |
|
| 486 | 486 | return false; |
| 487 | 487 | } |
| 488 | 488 | |
| 489 | - if (! $this->isIdentifierComposite()) { |
|
| 489 | + if ( ! $this->isIdentifierComposite()) { |
|
| 490 | 490 | return $fieldName === $this->identifier[0]; |
| 491 | 491 | } |
| 492 | 492 | |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | */ |
| 510 | 510 | public function getNamedQuery($queryName) : string |
| 511 | 511 | { |
| 512 | - if (! isset($this->namedQueries[$queryName])) { |
|
| 512 | + if ( ! isset($this->namedQueries[$queryName])) { |
|
| 513 | 513 | throw MappingException::queryNotFound($this->className, $queryName); |
| 514 | 514 | } |
| 515 | 515 | |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | */ |
| 540 | 540 | public function getNamedNativeQuery($queryName) : array |
| 541 | 541 | { |
| 542 | - if (! isset($this->namedNativeQueries[$queryName])) { |
|
| 542 | + if ( ! isset($this->namedNativeQueries[$queryName])) { |
|
| 543 | 543 | throw MappingException::queryNotFound($this->className, $queryName); |
| 544 | 544 | } |
| 545 | 545 | |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | */ |
| 570 | 570 | public function getSqlResultSetMapping($name) |
| 571 | 571 | { |
| 572 | - if (! isset($this->sqlResultSetMappings[$name])) { |
|
| 572 | + if ( ! isset($this->sqlResultSetMappings[$name])) { |
|
| 573 | 573 | throw MappingException::resultMappingNotFound($this->className, $name); |
| 574 | 574 | } |
| 575 | 575 | |
@@ -602,7 +602,7 @@ discard block |
||
| 602 | 602 | $property->setColumnName($columnName); |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | - if (! $this->isMappedSuperclass) { |
|
| 605 | + if ( ! $this->isMappedSuperclass) { |
|
| 606 | 606 | $property->setTableName($this->getTableName()); |
| 607 | 607 | } |
| 608 | 608 | |
@@ -622,7 +622,7 @@ discard block |
||
| 622 | 622 | throw MappingException::sqlConversionNotAllowedForPrimaryKeyProperties($property); |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | - if (! in_array($fieldName, $this->identifier, true)) { |
|
| 625 | + if ( ! in_array($fieldName, $this->identifier, true)) { |
|
| 626 | 626 | $this->identifier[] = $fieldName; |
| 627 | 627 | } |
| 628 | 628 | } |
@@ -672,7 +672,7 @@ discard block |
||
| 672 | 672 | $fieldName = $property->getName(); |
| 673 | 673 | $targetEntity = $property->getTargetEntity(); |
| 674 | 674 | |
| 675 | - if (! $targetEntity) { |
|
| 675 | + if ( ! $targetEntity) { |
|
| 676 | 676 | throw MappingException::missingTargetEntity($fieldName); |
| 677 | 677 | } |
| 678 | 678 | |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | throw MappingException::illegalOrphanRemovalOnIdentifierAssociation($this->className, $fieldName); |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | - if (! in_array($property->getName(), $this->identifier, true)) { |
|
| 689 | + if ( ! in_array($property->getName(), $this->identifier, true)) { |
|
| 690 | 690 | if ($property instanceof ToOneAssociationMetadata && count($property->getJoinColumns()) >= 2) { |
| 691 | 691 | throw MappingException::cannotMapCompositePrimaryKeyEntitiesAsForeignId( |
| 692 | 692 | $property->getTargetEntity(), |
@@ -752,7 +752,7 @@ discard block |
||
| 752 | 752 | /** @var JoinColumnMetadata $joinColumn */ |
| 753 | 753 | if ($property instanceof OneToOneAssociationMetadata && $this->inheritanceType !== InheritanceType::SINGLE_TABLE) { |
| 754 | 754 | if (count($property->getJoinColumns()) === 1) { |
| 755 | - if (! $property->isPrimaryKey()) { |
|
| 755 | + if ( ! $property->isPrimaryKey()) { |
|
| 756 | 756 | $joinColumn->setUnique(true); |
| 757 | 757 | } |
| 758 | 758 | } else { |
@@ -760,13 +760,13 @@ discard block |
||
| 760 | 760 | } |
| 761 | 761 | } |
| 762 | 762 | |
| 763 | - $joinColumn->setTableName(! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 763 | + $joinColumn->setTableName( ! $this->isMappedSuperclass ? $this->getTableName() : null); |
|
| 764 | 764 | |
| 765 | - if (! $joinColumn->getColumnName()) { |
|
| 765 | + if ( ! $joinColumn->getColumnName()) { |
|
| 766 | 766 | $joinColumn->setColumnName($this->namingStrategy->joinColumnName($fieldName, $this->className)); |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 769 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 770 | 770 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 771 | 771 | } |
| 772 | 772 | |
@@ -774,7 +774,7 @@ discard block |
||
| 774 | 774 | } |
| 775 | 775 | |
| 776 | 776 | if ($uniqueConstraintColumns) { |
| 777 | - if (! $this->table) { |
|
| 777 | + if ( ! $this->table) { |
|
| 778 | 778 | throw new \RuntimeException( |
| 779 | 779 | 'ClassMetadata::setTable() has to be called before defining a one to one relationship.' |
| 780 | 780 | ); |
@@ -794,7 +794,7 @@ discard block |
||
| 794 | 794 | if ($property->isOrphanRemoval()) { |
| 795 | 795 | $cascades = $property->getCascade(); |
| 796 | 796 | |
| 797 | - if (! in_array('remove', $cascades, true)) { |
|
| 797 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 798 | 798 | $cascades[] = 'remove'; |
| 799 | 799 | |
| 800 | 800 | $property->setCascade($cascades); |
@@ -860,14 +860,14 @@ discard block |
||
| 860 | 860 | $property->setOwningSide(false); |
| 861 | 861 | |
| 862 | 862 | // OneToMany MUST have mappedBy |
| 863 | - if (! $property->getMappedBy()) { |
|
| 863 | + if ( ! $property->getMappedBy()) { |
|
| 864 | 864 | throw MappingException::oneToManyRequiresMappedBy($property->getName()); |
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | if ($property->isOrphanRemoval()) { |
| 868 | 868 | $cascades = $property->getCascade(); |
| 869 | 869 | |
| 870 | - if (! in_array('remove', $cascades, true)) { |
|
| 870 | + if ( ! in_array('remove', $cascades, true)) { |
|
| 871 | 871 | $cascades[] = 'remove'; |
| 872 | 872 | |
| 873 | 873 | $property->setCascade($cascades); |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | |
| 891 | 891 | $property->setJoinTable($joinTable); |
| 892 | 892 | |
| 893 | - if (! $joinTable->getName()) { |
|
| 893 | + if ( ! $joinTable->getName()) { |
|
| 894 | 894 | $joinTableName = $this->namingStrategy->joinTableName( |
| 895 | 895 | $property->getSourceEntity(), |
| 896 | 896 | $property->getTargetEntity(), |
@@ -902,7 +902,7 @@ discard block |
||
| 902 | 902 | |
| 903 | 903 | $selfReferencingEntityWithoutJoinColumns = $property->getSourceEntity() === $property->getTargetEntity() && ! $joinTable->hasColumns(); |
| 904 | 904 | |
| 905 | - if (! $joinTable->getJoinColumns()) { |
|
| 905 | + if ( ! $joinTable->getJoinColumns()) { |
|
| 906 | 906 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 907 | 907 | $sourceReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'source' : $referencedColumnName; |
| 908 | 908 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getSourceEntity(), $sourceReferenceName); |
@@ -915,7 +915,7 @@ discard block |
||
| 915 | 915 | $joinTable->addJoinColumn($joinColumn); |
| 916 | 916 | } |
| 917 | 917 | |
| 918 | - if (! $joinTable->getInverseJoinColumns()) { |
|
| 918 | + if ( ! $joinTable->getInverseJoinColumns()) { |
|
| 919 | 919 | $referencedColumnName = $this->namingStrategy->referenceColumnName(); |
| 920 | 920 | $targetReferenceName = $selfReferencingEntityWithoutJoinColumns ? 'target' : $referencedColumnName; |
| 921 | 921 | $columnName = $this->namingStrategy->joinKeyColumnName($property->getTargetEntity(), $targetReferenceName); |
@@ -930,13 +930,13 @@ discard block |
||
| 930 | 930 | |
| 931 | 931 | foreach ($joinTable->getJoinColumns() as $joinColumn) { |
| 932 | 932 | /** @var JoinColumnMetadata $joinColumn */ |
| 933 | - if (! $joinColumn->getReferencedColumnName()) { |
|
| 933 | + if ( ! $joinColumn->getReferencedColumnName()) { |
|
| 934 | 934 | $joinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 935 | 935 | } |
| 936 | 936 | |
| 937 | 937 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 938 | 938 | |
| 939 | - if (! $joinColumn->getColumnName()) { |
|
| 939 | + if ( ! $joinColumn->getColumnName()) { |
|
| 940 | 940 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 941 | 941 | $property->getSourceEntity(), |
| 942 | 942 | $referencedColumnName |
@@ -948,13 +948,13 @@ discard block |
||
| 948 | 948 | |
| 949 | 949 | foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) { |
| 950 | 950 | /** @var JoinColumnMetadata $inverseJoinColumn */ |
| 951 | - if (! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 951 | + if ( ! $inverseJoinColumn->getReferencedColumnName()) { |
|
| 952 | 952 | $inverseJoinColumn->setReferencedColumnName($this->namingStrategy->referenceColumnName()); |
| 953 | 953 | } |
| 954 | 954 | |
| 955 | 955 | $referencedColumnName = $inverseJoinColumn->getReferencedColumnName(); |
| 956 | 956 | |
| 957 | - if (! $inverseJoinColumn->getColumnName()) { |
|
| 957 | + if ( ! $inverseJoinColumn->getColumnName()) { |
|
| 958 | 958 | $columnName = $this->namingStrategy->joinKeyColumnName( |
| 959 | 959 | $property->getTargetEntity(), |
| 960 | 960 | $referencedColumnName |
@@ -988,7 +988,7 @@ discard block |
||
| 988 | 988 | throw MappingException::singleIdNotAllowedOnCompositePrimaryKey($this->className); |
| 989 | 989 | } |
| 990 | 990 | |
| 991 | - if (! isset($this->identifier[0])) { |
|
| 991 | + if ( ! isset($this->identifier[0])) { |
|
| 992 | 992 | throw MappingException::noIdDefined($this->className); |
| 993 | 993 | } |
| 994 | 994 | |
@@ -1047,7 +1047,7 @@ discard block |
||
| 1047 | 1047 | // Association defined as Id field |
| 1048 | 1048 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1049 | 1049 | |
| 1050 | - if (! $property->isOwningSide()) { |
|
| 1050 | + if ( ! $property->isOwningSide()) { |
|
| 1051 | 1051 | $property = $targetClass->getProperty($property->getMappedBy()); |
| 1052 | 1052 | $targetClass = $em->getClassMetadata($property->getTargetEntity()); |
| 1053 | 1053 | } |
@@ -1062,7 +1062,7 @@ discard block |
||
| 1062 | 1062 | $columnName = $joinColumn->getColumnName(); |
| 1063 | 1063 | $referencedColumnName = $joinColumn->getReferencedColumnName(); |
| 1064 | 1064 | |
| 1065 | - if (! $joinColumn->getType()) { |
|
| 1065 | + if ( ! $joinColumn->getType()) { |
|
| 1066 | 1066 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $em)); |
| 1067 | 1067 | } |
| 1068 | 1068 | |
@@ -1096,11 +1096,11 @@ discard block |
||
| 1096 | 1096 | { |
| 1097 | 1097 | $schema = $this->getSchemaName() === null |
| 1098 | 1098 | ? '' |
| 1099 | - : $this->getSchemaName() . '_' |
|
| 1099 | + : $this->getSchemaName().'_' |
|
| 1100 | 1100 | ; |
| 1101 | 1101 | |
| 1102 | 1102 | // replace dots with underscores because PostgreSQL creates temporary tables in a special schema |
| 1103 | - return $schema . $this->getTableName() . '_id_tmp'; |
|
| 1103 | + return $schema.$this->getTableName().'_id_tmp'; |
|
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | /** |
@@ -1134,7 +1134,7 @@ discard block |
||
| 1134 | 1134 | */ |
| 1135 | 1135 | public function setInheritanceType($type) : void |
| 1136 | 1136 | { |
| 1137 | - if (! $this->isInheritanceType($type)) { |
|
| 1137 | + if ( ! $this->isInheritanceType($type)) { |
|
| 1138 | 1138 | throw MappingException::invalidInheritanceType($this->className, $type); |
| 1139 | 1139 | } |
| 1140 | 1140 | |
@@ -1152,7 +1152,7 @@ discard block |
||
| 1152 | 1152 | { |
| 1153 | 1153 | $fieldName = $property->getName(); |
| 1154 | 1154 | |
| 1155 | - if (! isset($this->declaredProperties[$fieldName])) { |
|
| 1155 | + if ( ! isset($this->declaredProperties[$fieldName])) { |
|
| 1156 | 1156 | throw MappingException::invalidOverrideFieldName($this->className, $fieldName); |
| 1157 | 1157 | } |
| 1158 | 1158 | |
@@ -1349,7 +1349,7 @@ discard block |
||
| 1349 | 1349 | $declaringClass = $property->getDeclaringClass(); |
| 1350 | 1350 | |
| 1351 | 1351 | if ($inheritedProperty instanceof FieldMetadata) { |
| 1352 | - if (! $declaringClass->isMappedSuperclass) { |
|
| 1352 | + if ( ! $declaringClass->isMappedSuperclass) { |
|
| 1353 | 1353 | $inheritedProperty->setTableName($property->getTableName()); |
| 1354 | 1354 | } |
| 1355 | 1355 | |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | throw MappingException::duplicateQueryMapping($this->className, $name); |
| 1409 | 1409 | } |
| 1410 | 1410 | |
| 1411 | - if (! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1411 | + if ( ! isset($queryMapping['resultClass']) && ! isset($queryMapping['resultSetMapping'])) { |
|
| 1412 | 1412 | throw MappingException::missingQueryMapping($this->className, $name); |
| 1413 | 1413 | } |
| 1414 | 1414 | |
@@ -1425,7 +1425,7 @@ discard block |
||
| 1425 | 1425 | */ |
| 1426 | 1426 | public function addSqlResultSetMapping(array $resultMapping) |
| 1427 | 1427 | { |
| 1428 | - if (! isset($resultMapping['name'])) { |
|
| 1428 | + if ( ! isset($resultMapping['name'])) { |
|
| 1429 | 1429 | throw MappingException::nameIsMandatoryForSqlResultSetMapping($this->className); |
| 1430 | 1430 | } |
| 1431 | 1431 | |
@@ -1435,7 +1435,7 @@ discard block |
||
| 1435 | 1435 | |
| 1436 | 1436 | if (isset($resultMapping['entities'])) { |
| 1437 | 1437 | foreach ($resultMapping['entities'] as $key => $entityResult) { |
| 1438 | - if (! isset($entityResult['entityClass'])) { |
|
| 1438 | + if ( ! isset($entityResult['entityClass'])) { |
|
| 1439 | 1439 | throw MappingException::missingResultSetMappingEntity($this->className, $resultMapping['name']); |
| 1440 | 1440 | } |
| 1441 | 1441 | |
@@ -1444,11 +1444,11 @@ discard block |
||
| 1444 | 1444 | |
| 1445 | 1445 | if (isset($entityResult['fields'])) { |
| 1446 | 1446 | foreach ($entityResult['fields'] as $k => $field) { |
| 1447 | - if (! isset($field['name'])) { |
|
| 1447 | + if ( ! isset($field['name'])) { |
|
| 1448 | 1448 | throw MappingException::missingResultSetMappingFieldName($this->className, $resultMapping['name']); |
| 1449 | 1449 | } |
| 1450 | 1450 | |
| 1451 | - if (! isset($field['column'])) { |
|
| 1451 | + if ( ! isset($field['column'])) { |
|
| 1452 | 1452 | $fieldName = $field['name']; |
| 1453 | 1453 | |
| 1454 | 1454 | if (strpos($fieldName, '.')) { |
@@ -1546,11 +1546,11 @@ discard block |
||
| 1546 | 1546 | 'method' => $method, |
| 1547 | 1547 | ]; |
| 1548 | 1548 | |
| 1549 | - if (! class_exists($class)) { |
|
| 1549 | + if ( ! class_exists($class)) { |
|
| 1550 | 1550 | throw MappingException::entityListenerClassNotFound($class, $this->className); |
| 1551 | 1551 | } |
| 1552 | 1552 | |
| 1553 | - if (! method_exists($class, $method)) { |
|
| 1553 | + if ( ! method_exists($class, $method)) { |
|
| 1554 | 1554 | throw MappingException::entityListenerMethodNotFound($class, $method, $this->className); |
| 1555 | 1555 | } |
| 1556 | 1556 | |
@@ -1617,7 +1617,7 @@ discard block |
||
| 1617 | 1617 | return; |
| 1618 | 1618 | } |
| 1619 | 1619 | |
| 1620 | - if (! (class_exists($className) || interface_exists($className))) { |
|
| 1620 | + if ( ! (class_exists($className) || interface_exists($className))) { |
|
| 1621 | 1621 | throw MappingException::invalidClassInDiscriminatorMap($className, $this->className); |
| 1622 | 1622 | } |
| 1623 | 1623 | |
@@ -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 | |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | { |
| 401 | 401 | $aliases = $this->getRootAliases(); |
| 402 | 402 | |
| 403 | - if (! isset($aliases[0])) { |
|
| 403 | + if ( ! isset($aliases[0])) { |
|
| 404 | 404 | throw new \RuntimeException('No alias was set before invoking getRootAlias().'); |
| 405 | 405 | } |
| 406 | 406 | |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | public function getParameter($key) |
| 584 | 584 | { |
| 585 | 585 | $filteredParameters = $this->parameters->filter( |
| 586 | - function (Query\Parameter $parameter) use ($key) : bool { |
|
| 586 | + function(Query\Parameter $parameter) use ($key) : bool { |
|
| 587 | 587 | $parameterName = $parameter->getName(); |
| 588 | 588 | |
| 589 | 589 | return $key === $parameterName || (string) $key === (string) $parameterName; |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | { |
| 660 | 660 | if ($append && ($dqlPartName === 'where' || $dqlPartName === 'having')) { |
| 661 | 661 | throw new \InvalidArgumentException( |
| 662 | - "Using \$append = true does not have an effect with 'where' or 'having' " . |
|
| 662 | + "Using \$append = true does not have an effect with 'where' or 'having' ". |
|
| 663 | 663 | 'parts. See QueryBuilder#andWhere() for an example for correct usage.' |
| 664 | 664 | ); |
| 665 | 665 | } |
@@ -800,7 +800,7 @@ discard block |
||
| 800 | 800 | { |
| 801 | 801 | $this->type = self::DELETE; |
| 802 | 802 | |
| 803 | - if (! $delete) { |
|
| 803 | + if ( ! $delete) { |
|
| 804 | 804 | return $this; |
| 805 | 805 | } |
| 806 | 806 | |
@@ -827,7 +827,7 @@ discard block |
||
| 827 | 827 | { |
| 828 | 828 | $this->type = self::UPDATE; |
| 829 | 829 | |
| 830 | - if (! $update) { |
|
| 830 | + if ( ! $update) { |
|
| 831 | 831 | return $this; |
| 832 | 832 | } |
| 833 | 833 | |
@@ -882,7 +882,7 @@ discard block |
||
| 882 | 882 | { |
| 883 | 883 | $rootAliases = $this->getRootAliases(); |
| 884 | 884 | |
| 885 | - if (! in_array($alias, $rootAliases, true)) { |
|
| 885 | + if ( ! in_array($alias, $rootAliases, true)) { |
|
| 886 | 886 | throw new Query\QueryException( |
| 887 | 887 | sprintf('Specified root alias %s must be set before invoking indexBy().', $alias) |
| 888 | 888 | ); |
@@ -1043,7 +1043,7 @@ discard block |
||
| 1043 | 1043 | */ |
| 1044 | 1044 | public function where($predicates) |
| 1045 | 1045 | { |
| 1046 | - if (! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
| 1046 | + if ( ! (func_num_args() === 1 && $predicates instanceof Expr\Composite)) { |
|
| 1047 | 1047 | $predicates = new Expr\Andx(func_get_args()); |
| 1048 | 1048 | } |
| 1049 | 1049 | |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | */ |
| 1163 | 1163 | public function having($having) |
| 1164 | 1164 | { |
| 1165 | - if (! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
| 1165 | + if ( ! (func_num_args() === 1 && ($having instanceof Expr\Andx || $having instanceof Expr\Orx))) { |
|
| 1166 | 1166 | $having = new Expr\Andx(func_get_args()); |
| 1167 | 1167 | } |
| 1168 | 1168 | |
@@ -1261,7 +1261,7 @@ discard block |
||
| 1261 | 1261 | public function addCriteria(Criteria $criteria) |
| 1262 | 1262 | { |
| 1263 | 1263 | $allAliases = $this->getAllAliases(); |
| 1264 | - if (! isset($allAliases[0])) { |
|
| 1264 | + if ( ! isset($allAliases[0])) { |
|
| 1265 | 1265 | throw new Query\QueryException('No aliases are set before invoking addCriteria().'); |
| 1266 | 1266 | } |
| 1267 | 1267 | |
@@ -1279,14 +1279,14 @@ discard block |
||
| 1279 | 1279 | foreach ($criteria->getOrderings() as $sort => $order) { |
| 1280 | 1280 | $hasValidAlias = false; |
| 1281 | 1281 | foreach ($allAliases as $alias) { |
| 1282 | - if (strpos($sort . '.', $alias . '.') === 0) { |
|
| 1282 | + if (strpos($sort.'.', $alias.'.') === 0) { |
|
| 1283 | 1283 | $hasValidAlias = true; |
| 1284 | 1284 | break; |
| 1285 | 1285 | } |
| 1286 | 1286 | } |
| 1287 | 1287 | |
| 1288 | - if (! $hasValidAlias) { |
|
| 1289 | - $sort = $allAliases[0] . '.' . $sort; |
|
| 1288 | + if ( ! $hasValidAlias) { |
|
| 1289 | + $sort = $allAliases[0].'.'.$sort; |
|
| 1290 | 1290 | } |
| 1291 | 1291 | |
| 1292 | 1292 | $this->addOrderBy($sort, $order); |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | private function getDQLForSelect() |
| 1361 | 1361 | { |
| 1362 | 1362 | $dql = 'SELECT' |
| 1363 | - . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '') |
|
| 1363 | + . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '') |
|
| 1364 | 1364 | . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']); |
| 1365 | 1365 | |
| 1366 | 1366 | $fromParts = $this->getDQLPart('from'); |
@@ -1368,7 +1368,7 @@ discard block |
||
| 1368 | 1368 | $fromClauses = []; |
| 1369 | 1369 | |
| 1370 | 1370 | // Loop through all FROM clauses |
| 1371 | - if (! empty($fromParts)) { |
|
| 1371 | + if ( ! empty($fromParts)) { |
|
| 1372 | 1372 | $dql .= ' FROM '; |
| 1373 | 1373 | |
| 1374 | 1374 | foreach ($fromParts as $from) { |
@@ -1376,7 +1376,7 @@ discard block |
||
| 1376 | 1376 | |
| 1377 | 1377 | if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) { |
| 1378 | 1378 | foreach ($joinParts[$from->getAlias()] as $join) { |
| 1379 | - $fromClause .= ' ' . ((string) $join); |
|
| 1379 | + $fromClause .= ' '.((string) $join); |
|
| 1380 | 1380 | } |
| 1381 | 1381 | } |
| 1382 | 1382 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Doctrine\ORM\Query\Expr; |
| 6 | 6 | |
@@ -65,12 +65,12 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function add($arg) |
| 67 | 67 | { |
| 68 | - if ($arg !== null && (! $arg instanceof self || $arg->count() > 0)) { |
|
| 68 | + if ($arg !== null && ( ! $arg instanceof self || $arg->count() > 0)) { |
|
| 69 | 69 | // If we decide to keep Expr\Base instances, we can use this check |
| 70 | - if (! is_string($arg)) { |
|
| 70 | + if ( ! is_string($arg)) { |
|
| 71 | 71 | $class = get_class($arg); |
| 72 | 72 | |
| 73 | - if (! in_array($class, $this->allowedClasses, true)) { |
|
| 73 | + if ( ! in_array($class, $this->allowedClasses, true)) { |
|
| 74 | 74 | throw new \InvalidArgumentException( |
| 75 | 75 | sprintf("Expression of type '%s' not allowed in this context.", $class) |
| 76 | 76 | ); |
@@ -100,6 +100,6 @@ discard block |
||
| 100 | 100 | return (string) $this->parts[0]; |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | - return $this->preSeparator . implode($this->separator, $this->parts) . $this->postSeparator; |
|
| 103 | + return $this->preSeparator.implode($this->separator, $this->parts).$this->postSeparator; |
|
| 104 | 104 | } |
| 105 | 105 | } |