@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | public function testThrowsExceptionOnNonObjectValues($methodName) : void |
| 139 | 139 | { |
| 140 | 140 | $this->expectException(InvalidArgument::class); |
| 141 | - $this->expectExceptionMessage('EntityManager#' . $methodName . '() expects parameter 1 to be an entity object, NULL given.'); |
|
| 141 | + $this->expectExceptionMessage('EntityManager#'.$methodName.'() expects parameter 1 to be an entity object, NULL given.'); |
|
| 142 | 142 | |
| 143 | 143 | $this->em->{$methodName}(null); |
| 144 | 144 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | { |
| 183 | 183 | self::assertSame( |
| 184 | 184 | $value, |
| 185 | - $this->em->transactional(function ($em) use ($value) { |
|
| 185 | + $this->em->transactional(function($em) use ($value) { |
|
| 186 | 186 | return $value; |
| 187 | 187 | }) |
| 188 | 188 | ); |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | public function testTransactionalReThrowsThrowables() : void |
| 216 | 216 | { |
| 217 | 217 | try { |
| 218 | - $this->em->transactional(function () { |
|
| 219 | - (function (array $value) { |
|
| 218 | + $this->em->transactional(function() { |
|
| 219 | + (function(array $value) { |
|
| 220 | 220 | // this only serves as an IIFE that throws a `TypeError` |
| 221 | 221 | })(null); |
| 222 | 222 | }); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $article = new CmsArticle(); |
| 91 | 91 | |
| 92 | 92 | $this->expectException(\InvalidArgumentException::class); |
| 93 | - $this->expectExceptionMessage('Entity ' . CmsArticle::class); |
|
| 93 | + $this->expectExceptionMessage('Entity '.CmsArticle::class); |
|
| 94 | 94 | |
| 95 | 95 | $this->em->lock($article, LockMode::OPTIMISTIC, $article->version + 1); |
| 96 | 96 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | { |
| 140 | 140 | $writeLockSql = $this->em->getConnection()->getDatabasePlatform()->getWriteLockSQL(); |
| 141 | 141 | |
| 142 | - if (! $writeLockSql) { |
|
| 142 | + if ( ! $writeLockSql) { |
|
| 143 | 143 | $this->markTestSkipped('Database Driver has no Write Lock support.'); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | { |
| 175 | 175 | $readLockSql = $this->em->getConnection()->getDatabasePlatform()->getReadLockSQL(); |
| 176 | 176 | |
| 177 | - if (! $readLockSql) { |
|
| 177 | + if ( ! $readLockSql) { |
|
| 178 | 178 | $this->markTestSkipped('Database Driver has no Write Lock support.'); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | public function testLockOptimisticNonVersionedThrowsExceptionInDQL() : void |
| 209 | 209 | { |
| 210 | - $dql = 'SELECT u FROM ' . CmsUser::class . " u WHERE u.username = 'gblanco'"; |
|
| 210 | + $dql = 'SELECT u FROM '.CmsUser::class." u WHERE u.username = 'gblanco'"; |
|
| 211 | 211 | |
| 212 | 212 | $this->expectException(OptimisticLockFailed::class); |
| 213 | 213 | $this->expectExceptionMessage('The optimistic lock on an entity failed.'); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $test = new OptimisticStandard(); |
| 121 | 121 | |
| 122 | 122 | for ($i = 0; $i < 5; $i++) { |
| 123 | - $test->name = 'test' . $i; |
|
| 123 | + $test->name = 'test'.$i; |
|
| 124 | 124 | |
| 125 | 125 | $this->em->persist($test); |
| 126 | 126 | $this->em->flush(); |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | $caughtException = null; |
| 253 | 253 | |
| 254 | 254 | try { |
| 255 | - $expectedVersionExpired = DateTime::createFromFormat('U', (string) ($test->version->getTimestamp()-3600)); |
|
| 255 | + $expectedVersionExpired = DateTime::createFromFormat('U', (string) ($test->version->getTimestamp() - 3600)); |
|
| 256 | 256 | |
| 257 | 257 | $this->em->lock($test, LockMode::OPTIMISTIC, $expectedVersionExpired); |
| 258 | 258 | } catch (OptimisticLockFailed $e) { |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | public function testExceptionIsThrownWhenCallingFindByWithoutParameter() : void |
| 288 | 288 | { |
| 289 | 289 | $this->em->getRepository(CmsUser::class) |
| 290 | - ->findByStatus(); |
|
| 290 | + ->findByStatus(); |
|
| 291 | 291 | } |
| 292 | 292 | |
| 293 | 293 | /** |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | public function testExceptionIsThrownWhenUsingInvalidFieldName() : void |
| 297 | 297 | { |
| 298 | 298 | $this->em->getRepository(CmsUser::class) |
| 299 | - ->findByThisFieldDoesNotExist('testvalue'); |
|
| 299 | + ->findByThisFieldDoesNotExist('testvalue'); |
|
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | /** |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $this->expectException(TransactionRequired::class); |
| 309 | 309 | |
| 310 | 310 | $this->em->getRepository(CmsUser::class) |
| 311 | - ->find(1, LockMode::PESSIMISTIC_READ); |
|
| 311 | + ->find(1, LockMode::PESSIMISTIC_READ); |
|
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | /** |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | $this->expectException(TransactionRequired::class); |
| 321 | 321 | |
| 322 | 322 | $this->em->getRepository(CmsUser::class) |
| 323 | - ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
| 323 | + ->find(1, LockMode::PESSIMISTIC_WRITE); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | /** |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $this->expectException(OptimisticLockFailed::class); |
| 333 | 333 | |
| 334 | 334 | $this->em->getRepository(CmsUser::class) |
| 335 | - ->find(1, LockMode::OPTIMISTIC); |
|
| 335 | + ->find(1, LockMode::OPTIMISTIC); |
|
| 336 | 336 | } |
| 337 | 337 | |
| 338 | 338 | /** |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $user->username = 'gblanco'; |
| 186 | 186 | $user->status = 'developer'; |
| 187 | 187 | |
| 188 | - for ($i=0; $i<3; ++$i) { |
|
| 188 | + for ($i = 0; $i < 3; ++$i) { |
|
| 189 | 189 | $phone = new CmsPhonenumber(); |
| 190 | 190 | $phone->phonenumber = 100 + $i; |
| 191 | 191 | $user->addPhonenumber($phone); |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | $user->username = 'gblanco'; |
| 414 | 414 | $user->status = 'developer'; |
| 415 | 415 | |
| 416 | - for ($i=0; $i<3; ++$i) { |
|
| 416 | + for ($i = 0; $i < 3; ++$i) { |
|
| 417 | 417 | $phone = new CmsPhonenumber(); |
| 418 | 418 | $phone->phonenumber = 100 + $i; |
| 419 | 419 | $user->addPhonenumber($phone); |
@@ -453,7 +453,7 @@ discard block |
||
| 453 | 453 | $user->username = 'gblanco'; |
| 454 | 454 | $user->status = 'developer'; |
| 455 | 455 | |
| 456 | - for ($i=0; $i<3; ++$i) { |
|
| 456 | + for ($i = 0; $i < 3; ++$i) { |
|
| 457 | 457 | $phone = new CmsPhonenumber(); |
| 458 | 458 | $phone->phonenumber = 100 + $i; |
| 459 | 459 | $user->addPhonenumber($phone); |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | $user->username = 'gblanco'; |
| 495 | 495 | $user->status = 'developer'; |
| 496 | 496 | |
| 497 | - for ($i=0; $i<3; ++$i) { |
|
| 497 | + for ($i = 0; $i < 3; ++$i) { |
|
| 498 | 498 | $phone = new CmsPhonenumber(); |
| 499 | 499 | $phone->phonenumber = 100 + $i; |
| 500 | 500 | $user->addPhonenumber($phone); |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | |
| 642 | 642 | $user->setAddress($address); |
| 643 | 643 | |
| 644 | - $this->em->transactional(function ($em) use ($user) { |
|
| 644 | + $this->em->transactional(function($em) use ($user) { |
|
| 645 | 645 | $em->persist($user); |
| 646 | 646 | }); |
| 647 | 647 | $this->em->clear(); |
@@ -682,12 +682,12 @@ discard block |
||
| 682 | 682 | $this->em->persist($user); |
| 683 | 683 | $this->em->flush(); |
| 684 | 684 | |
| 685 | - self::assertEquals(1, $this->em->getConnection()->fetchColumn('select 1 from cms_addresses where user_id = ' . $user->id)); |
|
| 685 | + self::assertEquals(1, $this->em->getConnection()->fetchColumn('select 1 from cms_addresses where user_id = '.$user->id)); |
|
| 686 | 686 | |
| 687 | 687 | $address->user = null; |
| 688 | 688 | $this->em->flush(); |
| 689 | 689 | |
| 690 | - self::assertNotEquals(1, $this->em->getConnection()->fetchColumn('select 1 from cms_addresses where user_id = ' . $user->id)); |
|
| 690 | + self::assertNotEquals(1, $this->em->getConnection()->fetchColumn('select 1 from cms_addresses where user_id = '.$user->id)); |
|
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | /** |
@@ -881,7 +881,7 @@ discard block |
||
| 881 | 881 | |
| 882 | 882 | self::assertInstanceOf(GhostObjectInterface::class, $fetchedUser, 'It IS a proxy, ...'); |
| 883 | 883 | self::assertTrue($fetchedUser->isProxyInitialized(), '...but its initialized!'); |
| 884 | - self::assertEquals($qc+2, $this->getCurrentQueryCount()); |
|
| 884 | + self::assertEquals($qc + 2, $this->getCurrentQueryCount()); |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | /** |
@@ -942,7 +942,7 @@ discard block |
||
| 942 | 942 | |
| 943 | 943 | $this->expectException(InvalidArgument::class); |
| 944 | 944 | $this->expectExceptionMessage( |
| 945 | - 'Expected value of type "Doctrine\Tests\Models\CMS\CmsAddress" for association field ' . |
|
| 945 | + 'Expected value of type "Doctrine\Tests\Models\CMS\CmsAddress" for association field '. |
|
| 946 | 946 | '"Doctrine\Tests\Models\CMS\CmsUser#$address", got "Doctrine\Tests\Models\CMS\CmsUser" instead.' |
| 947 | 947 | ); |
| 948 | 948 | |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | $this->computeChangeSets(); |
| 342 | 342 | |
| 343 | - if (! ($this->entityInsertions || |
|
| 343 | + if ( ! ($this->entityInsertions || |
|
| 344 | 344 | $this->entityDeletions || |
| 345 | 345 | $this->entityUpdates || |
| 346 | 346 | $this->collectionUpdates || |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | // Entity deletions come last and need to be in reverse commit order |
| 400 | 400 | if ($this->entityDeletions) { |
| 401 | 401 | foreach (array_reverse($commitOrder) as $committedEntityName) { |
| 402 | - if (! $this->entityDeletions) { |
|
| 402 | + if ( ! $this->entityDeletions) { |
|
| 403 | 403 | break; // just a performance optimisation |
| 404 | 404 | } |
| 405 | 405 | |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | $oid = spl_object_id($entity); |
| 483 | 483 | $data = []; |
| 484 | 484 | |
| 485 | - if (! isset($this->entityChangeSets[$oid])) { |
|
| 485 | + if ( ! isset($this->entityChangeSets[$oid])) { |
|
| 486 | 486 | return $data; |
| 487 | 487 | } |
| 488 | 488 | |
@@ -563,12 +563,12 @@ discard block |
||
| 563 | 563 | || ! $class->getProperty($name) instanceof FieldMetadata |
| 564 | 564 | || ! $class->getProperty($name)->hasValueGenerator() |
| 565 | 565 | || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY |
| 566 | - ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 566 | + ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) { |
|
| 567 | 567 | $actualData[$name] = $value; |
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 571 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 572 | 572 | // Entity is either NEW or MANAGED but not yet fully persisted (only has an id). |
| 573 | 573 | // These result in an INSERT. |
| 574 | 574 | $this->originalEntityData[$oid] = $actualData; |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | |
| 596 | 596 | foreach ($actualData as $propName => $actualValue) { |
| 597 | 597 | // skip field, its a partially omitted one! |
| 598 | - if (! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 598 | + if ( ! (isset($originalData[$propName]) || array_key_exists($propName, $originalData))) { |
|
| 599 | 599 | continue; |
| 600 | 600 | } |
| 601 | 601 | |
@@ -617,7 +617,7 @@ discard block |
||
| 617 | 617 | if ($owner === null) { // cloned |
| 618 | 618 | $actualValue->setOwner($entity, $property); |
| 619 | 619 | } elseif ($owner !== $entity) { // no clone, we have to fix |
| 620 | - if (! $actualValue->isInitialized()) { |
|
| 620 | + if ( ! $actualValue->isInitialized()) { |
|
| 621 | 621 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
| 622 | 622 | } |
| 623 | 623 | |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | // Check if original value exists |
| 656 | 656 | if ($orgValue instanceof PersistentCollection) { |
| 657 | 657 | // A PersistentCollection was de-referenced, so delete it. |
| 658 | - if (! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 658 | + if ( ! $this->isCollectionScheduledForDeletion($orgValue)) { |
|
| 659 | 659 | $this->scheduleCollectionDeletion($orgValue); |
| 660 | 660 | |
| 661 | 661 | $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | |
| 679 | 679 | // Look for changes in associations of the entity |
| 680 | 680 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 681 | - if (! $property instanceof AssociationMetadata) { |
|
| 681 | + if ( ! $property instanceof AssociationMetadata) { |
|
| 682 | 682 | continue; |
| 683 | 683 | } |
| 684 | 684 | |
@@ -745,7 +745,7 @@ discard block |
||
| 745 | 745 | // Only MANAGED entities that are NOT SCHEDULED FOR INSERTION OR DELETION are processed here. |
| 746 | 746 | $oid = spl_object_id($entity); |
| 747 | 747 | |
| 748 | - if (! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 748 | + if ( ! isset($this->entityInsertions[$oid]) && ! isset($this->entityDeletions[$oid]) && isset($this->entityStates[$oid])) { |
|
| 749 | 749 | $this->computeChangeSet($class, $entity); |
| 750 | 750 | } |
| 751 | 751 | } |
@@ -782,13 +782,13 @@ discard block |
||
| 782 | 782 | $targetClass = $this->em->getClassMetadata($targetEntity); |
| 783 | 783 | |
| 784 | 784 | foreach ($unwrappedValue as $key => $entry) { |
| 785 | - if (! ($entry instanceof $targetEntity)) { |
|
| 785 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 786 | 786 | throw InvalidArgument::invalidAssociation($targetClass, $association, $entry); |
| 787 | 787 | } |
| 788 | 788 | |
| 789 | 789 | $state = $this->getEntityState($entry, self::STATE_NEW); |
| 790 | 790 | |
| 791 | - if (! ($entry instanceof $targetEntity)) { |
|
| 791 | + if ( ! ($entry instanceof $targetEntity)) { |
|
| 792 | 792 | throw UnexpectedAssociationValue::new( |
| 793 | 793 | $association->getSourceEntity(), |
| 794 | 794 | $association->getName(), |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | |
| 800 | 800 | switch ($state) { |
| 801 | 801 | case self::STATE_NEW: |
| 802 | - if (! in_array('persist', $association->getCascade(), true)) { |
|
| 802 | + if ( ! in_array('persist', $association->getCascade(), true)) { |
|
| 803 | 803 | $this->nonCascadedNewDetectedEntities[spl_object_id($entry)] = [$association, $entry]; |
| 804 | 804 | |
| 805 | 805 | break; |
@@ -848,7 +848,7 @@ discard block |
||
| 848 | 848 | $persister = $this->getEntityPersister($class->getClassName()); |
| 849 | 849 | $generationPlan->executeImmediate($this->em, $entity); |
| 850 | 850 | |
| 851 | - if (! $generationPlan->containsDeferred()) { |
|
| 851 | + if ( ! $generationPlan->containsDeferred()) { |
|
| 852 | 852 | $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity)); |
| 853 | 853 | $this->entityIdentifiers[$oid] = $id; |
| 854 | 854 | } |
@@ -875,7 +875,7 @@ discard block |
||
| 875 | 875 | { |
| 876 | 876 | $oid = spl_object_id($entity); |
| 877 | 877 | |
| 878 | - if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 878 | + if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) { |
|
| 879 | 879 | throw InvalidArgument::entityNotManaged($entity); |
| 880 | 880 | } |
| 881 | 881 | |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | break; |
| 898 | 898 | |
| 899 | 899 | case ($property instanceof FieldMetadata): |
| 900 | - if (! $property->isPrimaryKey() |
|
| 900 | + if ( ! $property->isPrimaryKey() |
|
| 901 | 901 | || ! $property->getValueGenerator() |
| 902 | 902 | || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) { |
| 903 | 903 | $actualData[$name] = $property->getValue($entity); |
@@ -911,7 +911,7 @@ discard block |
||
| 911 | 911 | } |
| 912 | 912 | } |
| 913 | 913 | |
| 914 | - if (! isset($this->originalEntityData[$oid])) { |
|
| 914 | + if ( ! isset($this->originalEntityData[$oid])) { |
|
| 915 | 915 | throw new \RuntimeException('Cannot call recomputeSingleEntityChangeSet before computeChangeSet on an entity.'); |
| 916 | 916 | } |
| 917 | 917 | |
@@ -929,7 +929,7 @@ discard block |
||
| 929 | 929 | if ($changeSet) { |
| 930 | 930 | if (isset($this->entityChangeSets[$oid])) { |
| 931 | 931 | $this->entityChangeSets[$oid] = array_merge($this->entityChangeSets[$oid], $changeSet); |
| 932 | - } elseif (! isset($this->entityInsertions[$oid])) { |
|
| 932 | + } elseif ( ! isset($this->entityInsertions[$oid])) { |
|
| 933 | 933 | $this->entityChangeSets[$oid] = $changeSet; |
| 934 | 934 | $this->entityUpdates[$oid] = $entity; |
| 935 | 935 | } |
@@ -999,7 +999,7 @@ discard block |
||
| 999 | 999 | $this->recomputeSingleEntityChangeSet($class, $entity); |
| 1000 | 1000 | } |
| 1001 | 1001 | |
| 1002 | - if (! empty($this->entityChangeSets[$oid])) { |
|
| 1002 | + if ( ! empty($this->entityChangeSets[$oid])) { |
|
| 1003 | 1003 | // echo 'Update: '; |
| 1004 | 1004 | // \Doctrine\Common\Util\Debug::dump($this->entityChangeSets[$oid], 3); |
| 1005 | 1005 | |
@@ -1042,7 +1042,7 @@ discard block |
||
| 1042 | 1042 | // Entity with this $oid after deletion treated as NEW, even if the $oid |
| 1043 | 1043 | // is obtained by a new entity because the old one went out of scope. |
| 1044 | 1044 | //$this->entityStates[$oid] = self::STATE_NEW; |
| 1045 | - if (! $class->isIdentifierComposite()) { |
|
| 1045 | + if ( ! $class->isIdentifierComposite()) { |
|
| 1046 | 1046 | $property = $class->getProperty($class->getSingleIdentifierFieldName()); |
| 1047 | 1047 | |
| 1048 | 1048 | if ($property instanceof FieldMetadata && $property->hasValueGenerator()) { |
@@ -1089,13 +1089,13 @@ discard block |
||
| 1089 | 1089 | // Calculate dependencies for new nodes |
| 1090 | 1090 | while ($class = array_pop($newNodes)) { |
| 1091 | 1091 | foreach ($class->getDeclaredPropertiesIterator() as $property) { |
| 1092 | - if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1092 | + if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) { |
|
| 1093 | 1093 | continue; |
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | 1096 | $targetClass = $this->em->getClassMetadata($property->getTargetEntity()); |
| 1097 | 1097 | |
| 1098 | - if (! $calc->hasNode($targetClass->getClassName())) { |
|
| 1098 | + if ( ! $calc->hasNode($targetClass->getClassName())) { |
|
| 1099 | 1099 | $calc->addNode($targetClass->getClassName(), $targetClass); |
| 1100 | 1100 | |
| 1101 | 1101 | $newNodes[] = $targetClass; |
@@ -1103,7 +1103,7 @@ discard block |
||
| 1103 | 1103 | |
| 1104 | 1104 | $weight = ! array_filter( |
| 1105 | 1105 | $property->getJoinColumns(), |
| 1106 | - function (JoinColumnMetadata $joinColumn) { |
|
| 1106 | + function(JoinColumnMetadata $joinColumn) { |
|
| 1107 | 1107 | return $joinColumn->isNullable(); |
| 1108 | 1108 | } |
| 1109 | 1109 | ); |
@@ -1111,14 +1111,14 @@ discard block |
||
| 1111 | 1111 | $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight); |
| 1112 | 1112 | |
| 1113 | 1113 | // If the target class has mapped subclasses, these share the same dependency. |
| 1114 | - if (! $targetClass->getSubClasses()) { |
|
| 1114 | + if ( ! $targetClass->getSubClasses()) { |
|
| 1115 | 1115 | continue; |
| 1116 | 1116 | } |
| 1117 | 1117 | |
| 1118 | 1118 | foreach ($targetClass->getSubClasses() as $subClassName) { |
| 1119 | 1119 | $targetSubClass = $this->em->getClassMetadata($subClassName); |
| 1120 | 1120 | |
| 1121 | - if (! $calc->hasNode($subClassName)) { |
|
| 1121 | + if ( ! $calc->hasNode($subClassName)) { |
|
| 1122 | 1122 | $calc->addNode($targetSubClass->getClassName(), $targetSubClass); |
| 1123 | 1123 | |
| 1124 | 1124 | $newNodes[] = $targetSubClass; |
@@ -1190,7 +1190,7 @@ discard block |
||
| 1190 | 1190 | { |
| 1191 | 1191 | $oid = spl_object_id($entity); |
| 1192 | 1192 | |
| 1193 | - if (! isset($this->entityIdentifiers[$oid])) { |
|
| 1193 | + if ( ! isset($this->entityIdentifiers[$oid])) { |
|
| 1194 | 1194 | throw InvalidArgument::entityHasNoIdentity($entity, 'scheduling for update'); |
| 1195 | 1195 | } |
| 1196 | 1196 | |
@@ -1198,7 +1198,7 @@ discard block |
||
| 1198 | 1198 | throw InvalidArgument::entityIsRemoved($entity, 'schedule for update'); |
| 1199 | 1199 | } |
| 1200 | 1200 | |
| 1201 | - if (! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1201 | + if ( ! isset($this->entityUpdates[$oid]) && ! isset($this->entityInsertions[$oid])) { |
|
| 1202 | 1202 | $this->entityUpdates[$oid] = $entity; |
| 1203 | 1203 | } |
| 1204 | 1204 | } |
@@ -1274,7 +1274,7 @@ discard block |
||
| 1274 | 1274 | return; // entity has not been persisted yet, so nothing more to do. |
| 1275 | 1275 | } |
| 1276 | 1276 | |
| 1277 | - if (! $this->isInIdentityMap($entity)) { |
|
| 1277 | + if ( ! $this->isInIdentityMap($entity)) { |
|
| 1278 | 1278 | return; |
| 1279 | 1279 | } |
| 1280 | 1280 | |
@@ -1282,7 +1282,7 @@ discard block |
||
| 1282 | 1282 | |
| 1283 | 1283 | unset($this->entityUpdates[$oid]); |
| 1284 | 1284 | |
| 1285 | - if (! isset($this->entityDeletions[$oid])) { |
|
| 1285 | + if ( ! isset($this->entityDeletions[$oid])) { |
|
| 1286 | 1286 | $this->entityDeletions[$oid] = $entity; |
| 1287 | 1287 | $this->entityStates[$oid] = self::STATE_REMOVED; |
| 1288 | 1288 | } |
@@ -1384,7 +1384,7 @@ discard block |
||
| 1384 | 1384 | $persister = $this->getEntityPersister($class->getClassName()); |
| 1385 | 1385 | $id = $persister->getIdentifier($entity); |
| 1386 | 1386 | |
| 1387 | - if (! $id) { |
|
| 1387 | + if ( ! $id) { |
|
| 1388 | 1388 | return self::STATE_NEW; |
| 1389 | 1389 | } |
| 1390 | 1390 | |
@@ -1736,7 +1736,7 @@ discard block |
||
| 1736 | 1736 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1737 | 1737 | |
| 1738 | 1738 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1739 | - if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1739 | + if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade(), true))) { |
|
| 1740 | 1740 | continue; |
| 1741 | 1741 | } |
| 1742 | 1742 | |
@@ -1783,7 +1783,7 @@ discard block |
||
| 1783 | 1783 | } |
| 1784 | 1784 | |
| 1785 | 1785 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1786 | - if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1786 | + if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade(), true))) { |
|
| 1787 | 1787 | continue; |
| 1788 | 1788 | } |
| 1789 | 1789 | |
@@ -1799,7 +1799,7 @@ discard block |
||
| 1799 | 1799 | |
| 1800 | 1800 | case ($relatedEntities instanceof Collection): |
| 1801 | 1801 | case (is_array($relatedEntities)): |
| 1802 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1802 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 1803 | 1803 | throw InvalidArgument::invalidAssociation( |
| 1804 | 1804 | $this->em->getClassMetadata($targetEntity), |
| 1805 | 1805 | $association, |
@@ -1814,7 +1814,7 @@ discard block |
||
| 1814 | 1814 | break; |
| 1815 | 1815 | |
| 1816 | 1816 | case ($relatedEntities !== null): |
| 1817 | - if (! $relatedEntities instanceof $targetEntity) { |
|
| 1817 | + if ( ! $relatedEntities instanceof $targetEntity) { |
|
| 1818 | 1818 | throw InvalidArgument::invalidAssociation( |
| 1819 | 1819 | $this->em->getClassMetadata($targetEntity), |
| 1820 | 1820 | $association, |
@@ -1843,7 +1843,7 @@ discard block |
||
| 1843 | 1843 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 1844 | 1844 | |
| 1845 | 1845 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 1846 | - if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1846 | + if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade(), true))) { |
|
| 1847 | 1847 | continue; |
| 1848 | 1848 | } |
| 1849 | 1849 | |
@@ -1900,7 +1900,7 @@ discard block |
||
| 1900 | 1900 | |
| 1901 | 1901 | switch (true) { |
| 1902 | 1902 | case $lockMode === LockMode::OPTIMISTIC: |
| 1903 | - if (! $class->isVersioned()) { |
|
| 1903 | + if ( ! $class->isVersioned()) { |
|
| 1904 | 1904 | throw OptimisticLockFailed::notVersioned($class->getClassName()); |
| 1905 | 1905 | } |
| 1906 | 1906 | |
@@ -1923,7 +1923,7 @@ discard block |
||
| 1923 | 1923 | case $lockMode === LockMode::NONE: |
| 1924 | 1924 | case $lockMode === LockMode::PESSIMISTIC_READ: |
| 1925 | 1925 | case $lockMode === LockMode::PESSIMISTIC_WRITE: |
| 1926 | - if (! $this->em->getConnection()->isTransactionActive()) { |
|
| 1926 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
| 1927 | 1927 | throw TransactionRequired::new(); |
| 1928 | 1928 | } |
| 1929 | 1929 | |
@@ -2082,7 +2082,7 @@ discard block |
||
| 2082 | 2082 | $entity->addPropertyChangedListener($this); |
| 2083 | 2083 | } |
| 2084 | 2084 | } else { |
| 2085 | - if (! isset($hints[Query::HINT_REFRESH]) |
|
| 2085 | + if ( ! isset($hints[Query::HINT_REFRESH]) |
|
| 2086 | 2086 | || (isset($hints[Query::HINT_REFRESH_ENTITY]) && $hints[Query::HINT_REFRESH_ENTITY] !== $entity)) { |
| 2087 | 2087 | return $entity; |
| 2088 | 2088 | } |
@@ -2130,7 +2130,7 @@ discard block |
||
| 2130 | 2130 | } |
| 2131 | 2131 | |
| 2132 | 2132 | foreach ($class->getDeclaredPropertiesIterator() as $field => $association) { |
| 2133 | - if (! ($association instanceof AssociationMetadata)) { |
|
| 2133 | + if ( ! ($association instanceof AssociationMetadata)) { |
|
| 2134 | 2134 | continue; |
| 2135 | 2135 | } |
| 2136 | 2136 | |
@@ -2179,7 +2179,7 @@ discard block |
||
| 2179 | 2179 | continue; |
| 2180 | 2180 | } |
| 2181 | 2181 | |
| 2182 | - if (! $association->isOwningSide()) { |
|
| 2182 | + if ( ! $association->isOwningSide()) { |
|
| 2183 | 2183 | // use the given entity association |
| 2184 | 2184 | if (isset($data[$field]) && is_object($data[$field]) && |
| 2185 | 2185 | isset($this->entityStates[spl_object_id($data[$field])])) { |
@@ -2229,7 +2229,7 @@ discard block |
||
| 2229 | 2229 | $associatedId[$targetField] = $joinColumnValue; |
| 2230 | 2230 | } |
| 2231 | 2231 | |
| 2232 | - if (! $associatedId) { |
|
| 2232 | + if ( ! $associatedId) { |
|
| 2233 | 2233 | // Foreign key is NULL |
| 2234 | 2234 | $association->setValue($entity, null); |
| 2235 | 2235 | $this->originalEntityData[$oid][$field] = null; |
@@ -2238,7 +2238,7 @@ discard block |
||
| 2238 | 2238 | } |
| 2239 | 2239 | |
| 2240 | 2240 | // @todo guilhermeblanco Can we remove the need of this somehow? |
| 2241 | - if (! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2241 | + if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) { |
|
| 2242 | 2242 | $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode(); |
| 2243 | 2243 | } |
| 2244 | 2244 | |
@@ -2255,7 +2255,7 @@ discard block |
||
| 2255 | 2255 | // If this is an uninitialized proxy, we are deferring eager loads, |
| 2256 | 2256 | // this association is marked as eager fetch, and its an uninitialized proxy (wtf!) |
| 2257 | 2257 | // then we can append this entity for eager loading! |
| 2258 | - if (! $targetClass->isIdentifierComposite() && |
|
| 2258 | + if ( ! $targetClass->isIdentifierComposite() && |
|
| 2259 | 2259 | $newValue instanceof GhostObjectInterface && |
| 2260 | 2260 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
| 2261 | 2261 | $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER && |
@@ -2338,7 +2338,7 @@ discard block |
||
| 2338 | 2338 | |
| 2339 | 2339 | public function triggerEagerLoads() |
| 2340 | 2340 | { |
| 2341 | - if (! $this->eagerLoadingEntities) { |
|
| 2341 | + if ( ! $this->eagerLoadingEntities) { |
|
| 2342 | 2342 | return; |
| 2343 | 2343 | } |
| 2344 | 2344 | |
@@ -2347,7 +2347,7 @@ discard block |
||
| 2347 | 2347 | $this->eagerLoadingEntities = []; |
| 2348 | 2348 | |
| 2349 | 2349 | foreach ($eagerLoadingEntities as $entityName => $ids) { |
| 2350 | - if (! $ids) { |
|
| 2350 | + if ( ! $ids) { |
|
| 2351 | 2351 | continue; |
| 2352 | 2352 | } |
| 2353 | 2353 | |
@@ -2645,7 +2645,7 @@ discard block |
||
| 2645 | 2645 | { |
| 2646 | 2646 | $class = $this->em->getClassMetadata(get_class($entity)); |
| 2647 | 2647 | |
| 2648 | - if (! $class->getProperty($propertyName)) { |
|
| 2648 | + if ( ! $class->getProperty($propertyName)) { |
|
| 2649 | 2649 | return; // ignore non-persistent fields |
| 2650 | 2650 | } |
| 2651 | 2651 | |
@@ -2654,7 +2654,7 @@ discard block |
||
| 2654 | 2654 | // Update changeset and mark entity for synchronization |
| 2655 | 2655 | $this->entityChangeSets[$oid][$propertyName] = [$oldValue, $newValue]; |
| 2656 | 2656 | |
| 2657 | - if (! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2657 | + if ( ! isset($this->scheduledForSynchronization[$class->getRootClassName()][$oid])) { |
|
| 2658 | 2658 | $this->scheduleForSynchronization($entity); |
| 2659 | 2659 | } |
| 2660 | 2660 | } |
@@ -2736,7 +2736,7 @@ discard block |
||
| 2736 | 2736 | */ |
| 2737 | 2737 | private static function objToStr($obj) |
| 2738 | 2738 | { |
| 2739 | - return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_id($obj); |
|
| 2739 | + return method_exists($obj, '__toString') ? (string) $obj : get_class($obj).'@'.spl_object_id($obj); |
|
| 2740 | 2740 | } |
| 2741 | 2741 | |
| 2742 | 2742 | /** |
@@ -2751,7 +2751,7 @@ discard block |
||
| 2751 | 2751 | */ |
| 2752 | 2752 | public function markReadOnly($object) |
| 2753 | 2753 | { |
| 2754 | - if (! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2754 | + if ( ! is_object($object) || ! $this->isInIdentityMap($object)) { |
|
| 2755 | 2755 | throw InvalidArgument::readOnlyRequiresManagedEntity($object); |
| 2756 | 2756 | } |
| 2757 | 2757 | |
@@ -2769,7 +2769,7 @@ discard block |
||
| 2769 | 2769 | */ |
| 2770 | 2770 | public function isReadOnly($object) |
| 2771 | 2771 | { |
| 2772 | - if (! is_object($object)) { |
|
| 2772 | + if ( ! is_object($object)) { |
|
| 2773 | 2773 | throw InvalidArgument::readOnlyRequiresManagedEntity($object); |
| 2774 | 2774 | } |
| 2775 | 2775 | |
@@ -2781,7 +2781,7 @@ discard block |
||
| 2781 | 2781 | */ |
| 2782 | 2782 | private function afterTransactionComplete() |
| 2783 | 2783 | { |
| 2784 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2784 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2785 | 2785 | $persister->afterTransactionComplete(); |
| 2786 | 2786 | }); |
| 2787 | 2787 | } |
@@ -2791,7 +2791,7 @@ discard block |
||
| 2791 | 2791 | */ |
| 2792 | 2792 | private function afterTransactionRolledBack() |
| 2793 | 2793 | { |
| 2794 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
| 2794 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
| 2795 | 2795 | $persister->afterTransactionRolledBack(); |
| 2796 | 2796 | }); |
| 2797 | 2797 | } |
@@ -2801,7 +2801,7 @@ discard block |
||
| 2801 | 2801 | */ |
| 2802 | 2802 | private function performCallbackOnCachedPersister(callable $callback) |
| 2803 | 2803 | { |
| 2804 | - if (! $this->hasCache) { |
|
| 2804 | + if ( ! $this->hasCache) { |
|
| 2805 | 2805 | return; |
| 2806 | 2806 | } |
| 2807 | 2807 | |
@@ -274,10 +274,10 @@ discard block |
||
| 274 | 274 | */ |
| 275 | 275 | public function getSQLTableAlias($tableName, $dqlAlias = '') |
| 276 | 276 | { |
| 277 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
| 277 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
| 278 | 278 | |
| 279 | - if (! isset($this->tableAliasMap[$tableName])) { |
|
| 280 | - $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++; |
|
| 279 | + if ( ! isset($this->tableAliasMap[$tableName])) { |
|
| 280 | + $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++; |
|
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | return $this->tableAliasMap[$tableName]; |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | */ |
| 296 | 296 | public function setSQLTableAlias($tableName, $alias, $dqlAlias = '') |
| 297 | 297 | { |
| 298 | - $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : ''; |
|
| 298 | + $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : ''; |
|
| 299 | 299 | |
| 300 | 300 | $this->tableAliasMap[$tableName] = $alias; |
| 301 | 301 | |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | public function getSQLColumnAlias() |
| 311 | 311 | { |
| 312 | - return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++); |
|
| 312 | + return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
@@ -336,14 +336,14 @@ discard block |
||
| 336 | 336 | |
| 337 | 337 | // If this is a joined association we must use left joins to preserve the correct result. |
| 338 | 338 | $sql .= isset($this->queryComponents[$dqlAlias]['relation']) ? ' LEFT ' : ' INNER '; |
| 339 | - $sql .= 'JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 339 | + $sql .= 'JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 340 | 340 | |
| 341 | 341 | $sqlParts = []; |
| 342 | 342 | |
| 343 | 343 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 344 | 344 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 345 | 345 | |
| 346 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 346 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | $filterSql = $this->generateFilterConditionSQL($parentClass, $tableAlias); |
@@ -367,14 +367,14 @@ discard block |
||
| 367 | 367 | $tableName = $subClass->table->getQuotedQualifiedName($this->platform); |
| 368 | 368 | $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias); |
| 369 | 369 | |
| 370 | - $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON '; |
|
| 370 | + $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON '; |
|
| 371 | 371 | |
| 372 | 372 | $sqlParts = []; |
| 373 | 373 | |
| 374 | 374 | foreach ($subClass->getIdentifierColumns($this->em) as $column) { |
| 375 | 375 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 376 | 376 | |
| 377 | - $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName; |
|
| 377 | + $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName; |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | $sql .= implode(' AND ', $sqlParts); |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | $qComp = $this->queryComponents[$dqlAlias]; |
| 396 | 396 | $association = $qComp['relation']; |
| 397 | 397 | |
| 398 | - if (! ($association instanceof ToManyAssociationMetadata)) { |
|
| 398 | + if ( ! ($association instanceof ToManyAssociationMetadata)) { |
|
| 399 | 399 | continue; |
| 400 | 400 | } |
| 401 | 401 | |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | $property = $qComp['metadata']->getProperty($fieldName); |
| 404 | 404 | $tableName = $property->getTableName(); |
| 405 | 405 | $columnName = $this->platform->quoteIdentifier($property->getColumnName()); |
| 406 | - $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName; |
|
| 406 | + $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName; |
|
| 407 | 407 | |
| 408 | 408 | // OrderByClause should replace an ordered relation. see - DDC-2475 |
| 409 | 409 | if (isset($this->orderedColumnsMap[$orderedColumn])) { |
@@ -411,7 +411,7 @@ discard block |
||
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | $this->orderedColumnsMap[$orderedColumn] = $orientation; |
| 414 | - $orderedColumns[] = $orderedColumn . ' ' . $orientation; |
|
| 414 | + $orderedColumns[] = $orderedColumn.' '.$orientation; |
|
| 415 | 415 | } |
| 416 | 416 | } |
| 417 | 417 | |
@@ -451,19 +451,19 @@ discard block |
||
| 451 | 451 | $discrColumnType = $discrColumn->getType(); |
| 452 | 452 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 453 | 453 | $sqlTableAlias = ($this->useSqlTableAliases) |
| 454 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 454 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 455 | 455 | : ''; |
| 456 | 456 | |
| 457 | 457 | $sqlParts[] = sprintf( |
| 458 | 458 | '%s IN (%s)', |
| 459 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 459 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 460 | 460 | implode(', ', $values) |
| 461 | 461 | ); |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | $sql = implode(' AND ', $sqlParts); |
| 465 | 465 | |
| 466 | - return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql; |
|
| 466 | + return isset($sqlParts[1]) ? '('.$sql.')' : $sql; |
|
| 467 | 467 | } |
| 468 | 468 | |
| 469 | 469 | /** |
@@ -476,7 +476,7 @@ discard block |
||
| 476 | 476 | */ |
| 477 | 477 | private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias) |
| 478 | 478 | { |
| 479 | - if (! $this->em->hasFilters()) { |
|
| 479 | + if ( ! $this->em->hasFilters()) { |
|
| 480 | 480 | return ''; |
| 481 | 481 | } |
| 482 | 482 | |
@@ -509,7 +509,7 @@ discard block |
||
| 509 | 509 | $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias); |
| 510 | 510 | |
| 511 | 511 | if ($filterExpr !== '') { |
| 512 | - $filterClauses[] = '(' . $filterExpr . ')'; |
|
| 512 | + $filterClauses[] = '('.$filterExpr.')'; |
|
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
@@ -540,11 +540,11 @@ discard block |
||
| 540 | 540 | $sql .= $this->walkOrderByClause($AST->orderByClause); |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | - if (! $AST->orderByClause) { |
|
| 543 | + if ( ! $AST->orderByClause) { |
|
| 544 | 544 | $orderBySql = $this->generateOrderedCollectionOrderByItems(); |
| 545 | 545 | |
| 546 | 546 | if ($orderBySql) { |
| 547 | - $sql .= ' ORDER BY ' . $orderBySql; |
|
| 547 | + $sql .= ' ORDER BY '.$orderBySql; |
|
| 548 | 548 | } |
| 549 | 549 | } |
| 550 | 550 | |
@@ -557,11 +557,11 @@ discard block |
||
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | if ($lockMode === LockMode::PESSIMISTIC_READ) { |
| 560 | - return $sql . ' ' . $this->platform->getReadLockSQL(); |
|
| 560 | + return $sql.' '.$this->platform->getReadLockSQL(); |
|
| 561 | 561 | } |
| 562 | 562 | |
| 563 | 563 | if ($lockMode === LockMode::PESSIMISTIC_WRITE) { |
| 564 | - return $sql . ' ' . $this->platform->getWriteLockSQL(); |
|
| 564 | + return $sql.' '.$this->platform->getWriteLockSQL(); |
|
| 565 | 565 | } |
| 566 | 566 | |
| 567 | 567 | if ($lockMode !== LockMode::OPTIMISTIC) { |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | foreach ($this->selectedClasses as $selectedClass) { |
| 572 | - if (! $selectedClass['class']->isVersioned()) { |
|
| 572 | + if ( ! $selectedClass['class']->isVersioned()) { |
|
| 573 | 573 | throw OptimisticLockFailed::lockFailed($selectedClass['class']->getClassName()); |
| 574 | 574 | } |
| 575 | 575 | } |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | foreach ($class->getIdentifierColumns($this->em) as $column) { |
| 619 | 619 | $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName()); |
| 620 | 620 | |
| 621 | - $sqlParts[] = $tableAlias . '.' . $quotedColumnName; |
|
| 621 | + $sqlParts[] = $tableAlias.'.'.$quotedColumnName; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | return implode(', ', $sqlParts); |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | { |
| 637 | 637 | $class = $this->queryComponents[$identificationVariable]['metadata']; |
| 638 | 638 | |
| 639 | - if (! $fieldName) { |
|
| 639 | + if ( ! $fieldName) { |
|
| 640 | 640 | return $this->getSQLTableAlias($class->getTableName(), $identificationVariable); |
| 641 | 641 | } |
| 642 | 642 | |
@@ -665,7 +665,7 @@ discard block |
||
| 665 | 665 | $property = $class->getProperty($fieldName); |
| 666 | 666 | |
| 667 | 667 | if ($this->useSqlTableAliases) { |
| 668 | - $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.'; |
|
| 668 | + $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.'; |
|
| 669 | 669 | } |
| 670 | 670 | |
| 671 | 671 | $sql .= $this->platform->quoteIdentifier($property->getColumnName()); |
@@ -679,7 +679,7 @@ discard block |
||
| 679 | 679 | $class = $this->queryComponents[$dqlAlias]['metadata']; |
| 680 | 680 | $association = $class->getProperty($fieldName); |
| 681 | 681 | |
| 682 | - if (! $association->isOwningSide()) { |
|
| 682 | + if ( ! $association->isOwningSide()) { |
|
| 683 | 683 | throw QueryException::associationPathInverseSideNotSupported($pathExpr); |
| 684 | 684 | } |
| 685 | 685 | |
@@ -693,7 +693,7 @@ discard block |
||
| 693 | 693 | $joinColumn = reset($joinColumns); |
| 694 | 694 | |
| 695 | 695 | if ($this->useSqlTableAliases) { |
| 696 | - $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.'; |
|
| 696 | + $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.'; |
|
| 697 | 697 | } |
| 698 | 698 | |
| 699 | 699 | $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName()); |
@@ -711,7 +711,7 @@ discard block |
||
| 711 | 711 | */ |
| 712 | 712 | public function walkSelectClause($selectClause) |
| 713 | 713 | { |
| 714 | - $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 714 | + $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : ''); |
|
| 715 | 715 | $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions)); |
| 716 | 716 | |
| 717 | 717 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && $selectClause->isDistinct) { |
@@ -754,7 +754,7 @@ discard block |
||
| 754 | 754 | |
| 755 | 755 | $sqlSelectExpressions[] = sprintf( |
| 756 | 756 | '%s AS %s', |
| 757 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform), |
|
| 757 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform), |
|
| 758 | 758 | $sqlColumnAlias |
| 759 | 759 | ); |
| 760 | 760 | |
@@ -764,7 +764,7 @@ discard block |
||
| 764 | 764 | |
| 765 | 765 | // Add foreign key columns of class and also parent classes |
| 766 | 766 | foreach ($class->getDeclaredPropertiesIterator() as $association) { |
| 767 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
| 767 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide()) |
|
| 768 | 768 | || ( ! $addMetaColumns && ! $association->isPrimaryKey())) { |
| 769 | 769 | continue; |
| 770 | 770 | } |
@@ -779,7 +779,7 @@ discard block |
||
| 779 | 779 | $columnAlias = $this->getSQLColumnAlias(); |
| 780 | 780 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
| 781 | 781 | |
| 782 | - if (! $joinColumn->getType()) { |
|
| 782 | + if ( ! $joinColumn->getType()) { |
|
| 783 | 783 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 784 | 784 | } |
| 785 | 785 | |
@@ -795,7 +795,7 @@ discard block |
||
| 795 | 795 | } |
| 796 | 796 | |
| 797 | 797 | // Add foreign key columns to SQL, if necessary |
| 798 | - if (! $addMetaColumns) { |
|
| 798 | + if ( ! $addMetaColumns) { |
|
| 799 | 799 | continue; |
| 800 | 800 | } |
| 801 | 801 | |
@@ -809,7 +809,7 @@ discard block |
||
| 809 | 809 | continue; |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | - if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 812 | + if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) { |
|
| 813 | 813 | continue; |
| 814 | 814 | } |
| 815 | 815 | |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | $columnAlias = $this->getSQLColumnAlias(); |
| 824 | 824 | $sqlTableAlias = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias); |
| 825 | 825 | |
| 826 | - if (! $joinColumn->getType()) { |
|
| 826 | + if ( ! $joinColumn->getType()) { |
|
| 827 | 827 | $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em)); |
| 828 | 828 | } |
| 829 | 829 | |
@@ -857,7 +857,7 @@ discard block |
||
| 857 | 857 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl); |
| 858 | 858 | } |
| 859 | 859 | |
| 860 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 860 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | /** |
@@ -932,7 +932,7 @@ discard block |
||
| 932 | 932 | $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 933 | 933 | |
| 934 | 934 | $sql = $this->platform->appendLockHint( |
| 935 | - $tableName . ' ' . $tableAlias, |
|
| 935 | + $tableName.' '.$tableAlias, |
|
| 936 | 936 | $this->query->getHint(Query::HINT_LOCK_MODE) |
| 937 | 937 | ); |
| 938 | 938 | |
@@ -942,11 +942,11 @@ discard block |
||
| 942 | 942 | |
| 943 | 943 | $classTableInheritanceJoins = $this->generateClassTableInheritanceJoins($class, $dqlAlias); |
| 944 | 944 | |
| 945 | - if (! $buildNestedJoins) { |
|
| 946 | - return $sql . $classTableInheritanceJoins; |
|
| 945 | + if ( ! $buildNestedJoins) { |
|
| 946 | + return $sql.$classTableInheritanceJoins; |
|
| 947 | 947 | } |
| 948 | 948 | |
| 949 | - return $classTableInheritanceJoins === '' ? $sql : '(' . $sql . $classTableInheritanceJoins . ')'; |
|
| 949 | + return $classTableInheritanceJoins === '' ? $sql : '('.$sql.$classTableInheritanceJoins.')'; |
|
| 950 | 950 | } |
| 951 | 951 | |
| 952 | 952 | /** |
@@ -983,7 +983,7 @@ discard block |
||
| 983 | 983 | ; |
| 984 | 984 | |
| 985 | 985 | if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) === true && |
| 986 | - (! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 986 | + ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) { |
|
| 987 | 987 | if ($association instanceof ToManyAssociationMetadata) { |
| 988 | 988 | throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation); |
| 989 | 989 | } |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | $targetTableJoin = [ |
| 1040 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1040 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1041 | 1041 | 'condition' => implode(' AND ', $conditions), |
| 1042 | 1042 | ]; |
| 1043 | 1043 | } elseif ($owningAssociation instanceof ManyToManyAssociationMetadata) { |
@@ -1065,7 +1065,7 @@ discard block |
||
| 1065 | 1065 | ); |
| 1066 | 1066 | } |
| 1067 | 1067 | |
| 1068 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions); |
|
| 1068 | + $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions); |
|
| 1069 | 1069 | |
| 1070 | 1070 | // Join target table |
| 1071 | 1071 | $sql .= ($joinType === AST\Join::JOIN_TYPE_LEFT || $joinType === AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN '; |
@@ -1104,7 +1104,7 @@ discard block |
||
| 1104 | 1104 | } |
| 1105 | 1105 | |
| 1106 | 1106 | $targetTableJoin = [ |
| 1107 | - 'table' => $targetTableName . ' ' . $targetTableAlias, |
|
| 1107 | + 'table' => $targetTableName.' '.$targetTableAlias, |
|
| 1108 | 1108 | 'condition' => implode(' AND ', $conditions), |
| 1109 | 1109 | ]; |
| 1110 | 1110 | } else { |
@@ -1112,23 +1112,23 @@ discard block |
||
| 1112 | 1112 | } |
| 1113 | 1113 | |
| 1114 | 1114 | // Handle WITH clause |
| 1115 | - $withCondition = ($condExpr === null) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')'); |
|
| 1115 | + $withCondition = ($condExpr === null) ? '' : ('('.$this->walkConditionalExpression($condExpr).')'); |
|
| 1116 | 1116 | |
| 1117 | 1117 | if ($targetClass->inheritanceType === InheritanceType::JOINED) { |
| 1118 | 1118 | $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias); |
| 1119 | 1119 | |
| 1120 | 1120 | // If we have WITH condition, we need to build nested joins for target class table and cti joins |
| 1121 | 1121 | if ($withCondition) { |
| 1122 | - $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition']; |
|
| 1122 | + $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition']; |
|
| 1123 | 1123 | } else { |
| 1124 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins; |
|
| 1124 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins; |
|
| 1125 | 1125 | } |
| 1126 | 1126 | } else { |
| 1127 | - $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition']; |
|
| 1127 | + $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition']; |
|
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | if ($withCondition) { |
| 1131 | - $sql .= ' AND ' . $withCondition; |
|
| 1131 | + $sql .= ' AND '.$withCondition; |
|
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | // Apply the indexes |
@@ -1162,7 +1162,7 @@ discard block |
||
| 1162 | 1162 | $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems); |
| 1163 | 1163 | } |
| 1164 | 1164 | |
| 1165 | - return ' ORDER BY ' . implode(', ', $orderByItems); |
|
| 1165 | + return ' ORDER BY '.implode(', ', $orderByItems); |
|
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | /** |
@@ -1179,10 +1179,10 @@ discard block |
||
| 1179 | 1179 | $this->orderedColumnsMap[$sql] = $type; |
| 1180 | 1180 | |
| 1181 | 1181 | if ($expr instanceof AST\Subselect) { |
| 1182 | - return '(' . $sql . ') ' . $type; |
|
| 1182 | + return '('.$sql.') '.$type; |
|
| 1183 | 1183 | } |
| 1184 | 1184 | |
| 1185 | - return $sql . ' ' . $type; |
|
| 1185 | + return $sql.' '.$type; |
|
| 1186 | 1186 | } |
| 1187 | 1187 | |
| 1188 | 1188 | /** |
@@ -1190,7 +1190,7 @@ discard block |
||
| 1190 | 1190 | */ |
| 1191 | 1191 | public function walkHavingClause($havingClause) |
| 1192 | 1192 | { |
| 1193 | - return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1193 | + return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression); |
|
| 1194 | 1194 | } |
| 1195 | 1195 | |
| 1196 | 1196 | /** |
@@ -1213,7 +1213,7 @@ discard block |
||
| 1213 | 1213 | $conditions = []; |
| 1214 | 1214 | |
| 1215 | 1215 | if ($join->conditionalExpression) { |
| 1216 | - $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')'; |
|
| 1216 | + $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')'; |
|
| 1217 | 1217 | } |
| 1218 | 1218 | |
| 1219 | 1219 | $isUnconditionalJoin = empty($conditions); |
@@ -1238,7 +1238,7 @@ discard block |
||
| 1238 | 1238 | } |
| 1239 | 1239 | |
| 1240 | 1240 | if ($conditions) { |
| 1241 | - $sql .= $condExprConjunction . implode(' AND ', $conditions); |
|
| 1241 | + $sql .= $condExprConjunction.implode(' AND ', $conditions); |
|
| 1242 | 1242 | } |
| 1243 | 1243 | |
| 1244 | 1244 | break; |
@@ -1268,7 +1268,7 @@ discard block |
||
| 1268 | 1268 | $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression); |
| 1269 | 1269 | } |
| 1270 | 1270 | |
| 1271 | - $sql .= implode(', ', $scalarExpressions) . ')'; |
|
| 1271 | + $sql .= implode(', ', $scalarExpressions).')'; |
|
| 1272 | 1272 | |
| 1273 | 1273 | return $sql; |
| 1274 | 1274 | } |
@@ -1290,7 +1290,7 @@ discard block |
||
| 1290 | 1290 | ? $this->conn->quote($nullIfExpression->secondExpression) |
| 1291 | 1291 | : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression); |
| 1292 | 1292 | |
| 1293 | - return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')'; |
|
| 1293 | + return 'NULLIF('.$firstExpression.', '.$secondExpression.')'; |
|
| 1294 | 1294 | } |
| 1295 | 1295 | |
| 1296 | 1296 | /** |
@@ -1303,11 +1303,11 @@ discard block |
||
| 1303 | 1303 | $sql = 'CASE'; |
| 1304 | 1304 | |
| 1305 | 1305 | foreach ($generalCaseExpression->whenClauses as $whenClause) { |
| 1306 | - $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1307 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1306 | + $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression); |
|
| 1307 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression); |
|
| 1308 | 1308 | } |
| 1309 | 1309 | |
| 1310 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END'; |
|
| 1310 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END'; |
|
| 1311 | 1311 | |
| 1312 | 1312 | return $sql; |
| 1313 | 1313 | } |
@@ -1321,14 +1321,14 @@ discard block |
||
| 1321 | 1321 | */ |
| 1322 | 1322 | public function walkSimpleCaseExpression($simpleCaseExpression) |
| 1323 | 1323 | { |
| 1324 | - $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1324 | + $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand); |
|
| 1325 | 1325 | |
| 1326 | 1326 | foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) { |
| 1327 | - $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1328 | - $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1327 | + $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression); |
|
| 1328 | + $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression); |
|
| 1329 | 1329 | } |
| 1330 | 1330 | |
| 1331 | - $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END'; |
|
| 1331 | + $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END'; |
|
| 1332 | 1332 | |
| 1333 | 1333 | return $sql; |
| 1334 | 1334 | } |
@@ -1369,7 +1369,7 @@ discard block |
||
| 1369 | 1369 | |
| 1370 | 1370 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1371 | 1371 | |
| 1372 | - if (! $hidden) { |
|
| 1372 | + if ( ! $hidden) { |
|
| 1373 | 1373 | $this->rsm->addScalarResult($columnAlias, $resultAlias, $property->getType()); |
| 1374 | 1374 | $this->scalarFields[$dqlAlias][$fieldName] = $columnAlias; |
| 1375 | 1375 | } |
@@ -1390,11 +1390,11 @@ discard block |
||
| 1390 | 1390 | $columnAlias = $this->getSQLColumnAlias(); |
| 1391 | 1391 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1392 | 1392 | |
| 1393 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1393 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1394 | 1394 | |
| 1395 | 1395 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1396 | 1396 | |
| 1397 | - if (! $hidden) { |
|
| 1397 | + if ( ! $hidden) { |
|
| 1398 | 1398 | // Conceptually we could resolve field type here by traverse through AST to retrieve field type, |
| 1399 | 1399 | // but this is not a feasible solution; assume 'string'. |
| 1400 | 1400 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
@@ -1405,11 +1405,11 @@ discard block |
||
| 1405 | 1405 | $columnAlias = $this->getSQLColumnAlias(); |
| 1406 | 1406 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1407 | 1407 | |
| 1408 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1408 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1409 | 1409 | |
| 1410 | 1410 | $this->scalarResultAliasMap[$resultAlias] = $columnAlias; |
| 1411 | 1411 | |
| 1412 | - if (! $hidden) { |
|
| 1412 | + if ( ! $hidden) { |
|
| 1413 | 1413 | // We cannot resolve field type here; assume 'string'. |
| 1414 | 1414 | $this->rsm->addScalarResult($columnAlias, $resultAlias, Type::getType('string')); |
| 1415 | 1415 | } |
@@ -1433,7 +1433,7 @@ discard block |
||
| 1433 | 1433 | $class = $queryComp['metadata']; |
| 1434 | 1434 | $resultAlias = $selectExpression->fieldIdentificationVariable ?: null; |
| 1435 | 1435 | |
| 1436 | - if (! isset($this->selectedClasses[$dqlAlias])) { |
|
| 1436 | + if ( ! isset($this->selectedClasses[$dqlAlias])) { |
|
| 1437 | 1437 | $this->selectedClasses[$dqlAlias] = [ |
| 1438 | 1438 | 'class' => $class, |
| 1439 | 1439 | 'dqlAlias' => $dqlAlias, |
@@ -1445,7 +1445,7 @@ discard block |
||
| 1445 | 1445 | |
| 1446 | 1446 | // Select all fields from the queried class |
| 1447 | 1447 | foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1448 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1448 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1449 | 1449 | continue; |
| 1450 | 1450 | } |
| 1451 | 1451 | |
@@ -1480,7 +1480,7 @@ discard block |
||
| 1480 | 1480 | $subClass = $this->em->getClassMetadata($subClassName); |
| 1481 | 1481 | |
| 1482 | 1482 | foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) { |
| 1483 | - if (! ($property instanceof FieldMetadata)) { |
|
| 1483 | + if ( ! ($property instanceof FieldMetadata)) { |
|
| 1484 | 1484 | continue; |
| 1485 | 1485 | } |
| 1486 | 1486 | |
@@ -1519,7 +1519,7 @@ discard block |
||
| 1519 | 1519 | */ |
| 1520 | 1520 | public function walkQuantifiedExpression($qExpr) |
| 1521 | 1521 | { |
| 1522 | - return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')'; |
|
| 1522 | + return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')'; |
|
| 1523 | 1523 | } |
| 1524 | 1524 | |
| 1525 | 1525 | /** |
@@ -1559,7 +1559,7 @@ discard block |
||
| 1559 | 1559 | $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl); |
| 1560 | 1560 | } |
| 1561 | 1561 | |
| 1562 | - return ' FROM ' . implode(', ', $sqlParts); |
|
| 1562 | + return ' FROM '.implode(', ', $sqlParts); |
|
| 1563 | 1563 | } |
| 1564 | 1564 | |
| 1565 | 1565 | /** |
@@ -1567,7 +1567,7 @@ discard block |
||
| 1567 | 1567 | */ |
| 1568 | 1568 | public function walkSimpleSelectClause($simpleSelectClause) |
| 1569 | 1569 | { |
| 1570 | - return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1570 | + return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '') |
|
| 1571 | 1571 | . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression); |
| 1572 | 1572 | } |
| 1573 | 1573 | |
@@ -1600,7 +1600,7 @@ discard block |
||
| 1600 | 1600 | break; |
| 1601 | 1601 | |
| 1602 | 1602 | case ($e instanceof AST\Subselect): |
| 1603 | - $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias; |
|
| 1603 | + $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias; |
|
| 1604 | 1604 | break; |
| 1605 | 1605 | |
| 1606 | 1606 | case ($e instanceof AST\PathExpression): |
@@ -1609,7 +1609,7 @@ discard block |
||
| 1609 | 1609 | $class = $qComp['metadata']; |
| 1610 | 1610 | $fieldType = $class->getProperty($e->field)->getType(); |
| 1611 | 1611 | |
| 1612 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1612 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1613 | 1613 | break; |
| 1614 | 1614 | |
| 1615 | 1615 | case ($e instanceof AST\Literal): |
@@ -1623,11 +1623,11 @@ discard block |
||
| 1623 | 1623 | break; |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1626 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1627 | 1627 | break; |
| 1628 | 1628 | |
| 1629 | 1629 | default: |
| 1630 | - $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias; |
|
| 1630 | + $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias; |
|
| 1631 | 1631 | break; |
| 1632 | 1632 | } |
| 1633 | 1633 | |
@@ -1660,10 +1660,10 @@ discard block |
||
| 1660 | 1660 | case ($expr instanceof AST\Subselect): |
| 1661 | 1661 | $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++; |
| 1662 | 1662 | |
| 1663 | - $columnAlias = 'sclr' . $this->aliasCounter++; |
|
| 1663 | + $columnAlias = 'sclr'.$this->aliasCounter++; |
|
| 1664 | 1664 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1665 | 1665 | |
| 1666 | - $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias; |
|
| 1666 | + $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias; |
|
| 1667 | 1667 | break; |
| 1668 | 1668 | |
| 1669 | 1669 | case ($expr instanceof AST\Functions\FunctionNode): |
@@ -1680,7 +1680,7 @@ discard block |
||
| 1680 | 1680 | $columnAlias = $this->getSQLColumnAlias(); |
| 1681 | 1681 | $this->scalarResultAliasMap[$alias] = $columnAlias; |
| 1682 | 1682 | |
| 1683 | - $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias; |
|
| 1683 | + $sql .= $expr->dispatch($this).' AS '.$columnAlias; |
|
| 1684 | 1684 | break; |
| 1685 | 1685 | |
| 1686 | 1686 | case ($expr instanceof AST\ParenthesisExpression): |
@@ -1700,8 +1700,8 @@ discard block |
||
| 1700 | 1700 | */ |
| 1701 | 1701 | public function walkAggregateExpression($aggExpression) |
| 1702 | 1702 | { |
| 1703 | - return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1704 | - . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')'; |
|
| 1703 | + return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '') |
|
| 1704 | + . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')'; |
|
| 1705 | 1705 | } |
| 1706 | 1706 | |
| 1707 | 1707 | /** |
@@ -1715,7 +1715,7 @@ discard block |
||
| 1715 | 1715 | $sqlParts[] = $this->walkGroupByItem($groupByItem); |
| 1716 | 1716 | } |
| 1717 | 1717 | |
| 1718 | - return ' GROUP BY ' . implode(', ', $sqlParts); |
|
| 1718 | + return ' GROUP BY '.implode(', ', $sqlParts); |
|
| 1719 | 1719 | } |
| 1720 | 1720 | |
| 1721 | 1721 | /** |
@@ -1724,7 +1724,7 @@ discard block |
||
| 1724 | 1724 | public function walkGroupByItem($groupByItem) |
| 1725 | 1725 | { |
| 1726 | 1726 | // StateFieldPathExpression |
| 1727 | - if (! is_string($groupByItem)) { |
|
| 1727 | + if ( ! is_string($groupByItem)) { |
|
| 1728 | 1728 | return $this->walkPathExpression($groupByItem); |
| 1729 | 1729 | } |
| 1730 | 1730 | |
@@ -1778,7 +1778,7 @@ discard block |
||
| 1778 | 1778 | { |
| 1779 | 1779 | $class = $this->em->getClassMetadata($deleteClause->abstractSchemaName); |
| 1780 | 1780 | $tableName = $class->getTableName(); |
| 1781 | - $sql = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1781 | + $sql = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1782 | 1782 | |
| 1783 | 1783 | $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable); |
| 1784 | 1784 | |
@@ -1794,12 +1794,12 @@ discard block |
||
| 1794 | 1794 | { |
| 1795 | 1795 | $class = $this->em->getClassMetadata($updateClause->abstractSchemaName); |
| 1796 | 1796 | $tableName = $class->getTableName(); |
| 1797 | - $sql = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform); |
|
| 1797 | + $sql = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform); |
|
| 1798 | 1798 | |
| 1799 | 1799 | $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable); |
| 1800 | 1800 | $this->rootAliases[] = $updateClause->aliasIdentificationVariable; |
| 1801 | 1801 | |
| 1802 | - $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1802 | + $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems)); |
|
| 1803 | 1803 | |
| 1804 | 1804 | return $sql; |
| 1805 | 1805 | } |
@@ -1812,7 +1812,7 @@ discard block |
||
| 1812 | 1812 | $useTableAliasesBefore = $this->useSqlTableAliases; |
| 1813 | 1813 | $this->useSqlTableAliases = false; |
| 1814 | 1814 | |
| 1815 | - $sql = $this->walkPathExpression($updateItem->pathExpression) . ' = '; |
|
| 1815 | + $sql = $this->walkPathExpression($updateItem->pathExpression).' = '; |
|
| 1816 | 1816 | $newValue = $updateItem->newValue; |
| 1817 | 1817 | |
| 1818 | 1818 | switch (true) { |
@@ -1856,7 +1856,7 @@ discard block |
||
| 1856 | 1856 | |
| 1857 | 1857 | if ($filterClauses) { |
| 1858 | 1858 | if ($condSql) { |
| 1859 | - $condSql = '(' . $condSql . ') AND '; |
|
| 1859 | + $condSql = '('.$condSql.') AND '; |
|
| 1860 | 1860 | } |
| 1861 | 1861 | |
| 1862 | 1862 | $condSql .= implode(' AND ', $filterClauses); |
@@ -1864,11 +1864,11 @@ discard block |
||
| 1864 | 1864 | } |
| 1865 | 1865 | |
| 1866 | 1866 | if ($condSql) { |
| 1867 | - return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql); |
|
| 1867 | + return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql); |
|
| 1868 | 1868 | } |
| 1869 | 1869 | |
| 1870 | 1870 | if ($discrSql) { |
| 1871 | - return ' WHERE ' . $discrSql; |
|
| 1871 | + return ' WHERE '.$discrSql; |
|
| 1872 | 1872 | } |
| 1873 | 1873 | |
| 1874 | 1874 | return ''; |
@@ -1881,7 +1881,7 @@ discard block |
||
| 1881 | 1881 | { |
| 1882 | 1882 | // Phase 2 AST optimization: Skip processing of ConditionalExpression |
| 1883 | 1883 | // if only one ConditionalTerm is defined |
| 1884 | - if (! ($condExpr instanceof AST\ConditionalExpression)) { |
|
| 1884 | + if ( ! ($condExpr instanceof AST\ConditionalExpression)) { |
|
| 1885 | 1885 | return $this->walkConditionalTerm($condExpr); |
| 1886 | 1886 | } |
| 1887 | 1887 | |
@@ -1895,7 +1895,7 @@ discard block |
||
| 1895 | 1895 | { |
| 1896 | 1896 | // Phase 2 AST optimization: Skip processing of ConditionalTerm |
| 1897 | 1897 | // if only one ConditionalFactor is defined |
| 1898 | - if (! ($condTerm instanceof AST\ConditionalTerm)) { |
|
| 1898 | + if ( ! ($condTerm instanceof AST\ConditionalTerm)) { |
|
| 1899 | 1899 | return $this->walkConditionalFactor($condTerm); |
| 1900 | 1900 | } |
| 1901 | 1901 | |
@@ -1911,7 +1911,7 @@ discard block |
||
| 1911 | 1911 | // if only one ConditionalPrimary is defined |
| 1912 | 1912 | return ( ! ($factor instanceof AST\ConditionalFactor)) |
| 1913 | 1913 | ? $this->walkConditionalPrimary($factor) |
| 1914 | - : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1914 | + : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary); |
|
| 1915 | 1915 | } |
| 1916 | 1916 | |
| 1917 | 1917 | /** |
@@ -1926,7 +1926,7 @@ discard block |
||
| 1926 | 1926 | if ($primary->isConditionalExpression()) { |
| 1927 | 1927 | $condExpr = $primary->conditionalExpression; |
| 1928 | 1928 | |
| 1929 | - return '(' . $this->walkConditionalExpression($condExpr) . ')'; |
|
| 1929 | + return '('.$this->walkConditionalExpression($condExpr).')'; |
|
| 1930 | 1930 | } |
| 1931 | 1931 | } |
| 1932 | 1932 | |
@@ -1937,7 +1937,7 @@ discard block |
||
| 1937 | 1937 | { |
| 1938 | 1938 | $sql = ($existsExpr->not) ? 'NOT ' : ''; |
| 1939 | 1939 | |
| 1940 | - $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')'; |
|
| 1940 | + $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')'; |
|
| 1941 | 1941 | |
| 1942 | 1942 | return $sql; |
| 1943 | 1943 | } |
@@ -1986,7 +1986,7 @@ discard block |
||
| 1986 | 1986 | $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName()); |
| 1987 | 1987 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 1988 | 1988 | |
| 1989 | - $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE '; |
|
| 1989 | + $sql .= $targetTableName.' '.$targetTableAlias.' WHERE '; |
|
| 1990 | 1990 | |
| 1991 | 1991 | $sqlParts = []; |
| 1992 | 1992 | |
@@ -2007,7 +2007,7 @@ discard block |
||
| 2007 | 2007 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 2008 | 2008 | } |
| 2009 | 2009 | |
| 2010 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 2010 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2011 | 2011 | } |
| 2012 | 2012 | |
| 2013 | 2013 | $sql .= implode(' AND ', $sqlParts); |
@@ -2021,7 +2021,7 @@ discard block |
||
| 2021 | 2021 | $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
| 2022 | 2022 | |
| 2023 | 2023 | // join to target table |
| 2024 | - $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON '; |
|
| 2024 | + $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON '; |
|
| 2025 | 2025 | |
| 2026 | 2026 | // join conditions |
| 2027 | 2027 | $joinSqlParts = []; |
@@ -2072,13 +2072,13 @@ discard block |
||
| 2072 | 2072 | $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++); |
| 2073 | 2073 | } |
| 2074 | 2074 | |
| 2075 | - $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql; |
|
| 2075 | + $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql; |
|
| 2076 | 2076 | } |
| 2077 | 2077 | |
| 2078 | 2078 | $sql .= implode(' AND ', $sqlParts); |
| 2079 | 2079 | } |
| 2080 | 2080 | |
| 2081 | - return $sql . ')'; |
|
| 2081 | + return $sql.')'; |
|
| 2082 | 2082 | } |
| 2083 | 2083 | |
| 2084 | 2084 | /** |
@@ -2089,7 +2089,7 @@ discard block |
||
| 2089 | 2089 | $sizeFunc = new AST\Functions\SizeFunction('size'); |
| 2090 | 2090 | $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression; |
| 2091 | 2091 | |
| 2092 | - return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2092 | + return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0'); |
|
| 2093 | 2093 | } |
| 2094 | 2094 | |
| 2095 | 2095 | /** |
@@ -2098,19 +2098,19 @@ discard block |
||
| 2098 | 2098 | public function walkNullComparisonExpression($nullCompExpr) |
| 2099 | 2099 | { |
| 2100 | 2100 | $expression = $nullCompExpr->expression; |
| 2101 | - $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL'; |
|
| 2101 | + $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL'; |
|
| 2102 | 2102 | |
| 2103 | 2103 | // Handle ResultVariable |
| 2104 | 2104 | if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) { |
| 2105 | - return $this->walkResultVariable($expression) . $comparison; |
|
| 2105 | + return $this->walkResultVariable($expression).$comparison; |
|
| 2106 | 2106 | } |
| 2107 | 2107 | |
| 2108 | 2108 | // Handle InputParameter mapping inclusion to ParserResult |
| 2109 | 2109 | if ($expression instanceof AST\InputParameter) { |
| 2110 | - return $this->walkInputParameter($expression) . $comparison; |
|
| 2110 | + return $this->walkInputParameter($expression).$comparison; |
|
| 2111 | 2111 | } |
| 2112 | 2112 | |
| 2113 | - return $expression->dispatch($this) . $comparison; |
|
| 2113 | + return $expression->dispatch($this).$comparison; |
|
| 2114 | 2114 | } |
| 2115 | 2115 | |
| 2116 | 2116 | /** |
@@ -2118,7 +2118,7 @@ discard block |
||
| 2118 | 2118 | */ |
| 2119 | 2119 | public function walkInExpression($inExpr) |
| 2120 | 2120 | { |
| 2121 | - $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN ('; |
|
| 2121 | + $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN ('; |
|
| 2122 | 2122 | |
| 2123 | 2123 | $sql .= ($inExpr->subselect) |
| 2124 | 2124 | ? $this->walkSubselect($inExpr->subselect) |
@@ -2142,12 +2142,12 @@ discard block |
||
| 2142 | 2142 | $discrColumnType = $discrColumn->getType(); |
| 2143 | 2143 | $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName()); |
| 2144 | 2144 | $sqlTableAlias = $this->useSqlTableAliases |
| 2145 | - ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.' |
|
| 2145 | + ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.' |
|
| 2146 | 2146 | : ''; |
| 2147 | 2147 | |
| 2148 | 2148 | return sprintf( |
| 2149 | 2149 | '%s %sIN %s', |
| 2150 | - $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform), |
|
| 2150 | + $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform), |
|
| 2151 | 2151 | ($instanceOfExpr->not ? 'NOT ' : ''), |
| 2152 | 2152 | $this->getChildDiscriminatorsFromClassMetadata($discrClass, $instanceOfExpr) |
| 2153 | 2153 | ); |
@@ -2194,8 +2194,8 @@ discard block |
||
| 2194 | 2194 | $sql .= ' NOT'; |
| 2195 | 2195 | } |
| 2196 | 2196 | |
| 2197 | - $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2198 | - . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2197 | + $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression) |
|
| 2198 | + . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression); |
|
| 2199 | 2199 | |
| 2200 | 2200 | return $sql; |
| 2201 | 2201 | } |
@@ -2210,7 +2210,7 @@ discard block |
||
| 2210 | 2210 | ? $this->walkResultVariable($stringExpr) |
| 2211 | 2211 | : $stringExpr->dispatch($this); |
| 2212 | 2212 | |
| 2213 | - $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE '; |
|
| 2213 | + $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE '; |
|
| 2214 | 2214 | |
| 2215 | 2215 | if ($likeExpr->stringPattern instanceof AST\InputParameter) { |
| 2216 | 2216 | $sql .= $this->walkInputParameter($likeExpr->stringPattern); |
@@ -2223,7 +2223,7 @@ discard block |
||
| 2223 | 2223 | } |
| 2224 | 2224 | |
| 2225 | 2225 | if ($likeExpr->escapeChar) { |
| 2226 | - $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar); |
|
| 2226 | + $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar); |
|
| 2227 | 2227 | } |
| 2228 | 2228 | |
| 2229 | 2229 | return $sql; |
@@ -2250,7 +2250,7 @@ discard block |
||
| 2250 | 2250 | ? $leftExpr->dispatch($this) |
| 2251 | 2251 | : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr)); |
| 2252 | 2252 | |
| 2253 | - $sql .= ' ' . $compExpr->operator . ' '; |
|
| 2253 | + $sql .= ' '.$compExpr->operator.' '; |
|
| 2254 | 2254 | |
| 2255 | 2255 | $sql .= ($rightExpr instanceof AST\Node) |
| 2256 | 2256 | ? $rightExpr->dispatch($this) |
@@ -2286,7 +2286,7 @@ discard block |
||
| 2286 | 2286 | { |
| 2287 | 2287 | return ($arithmeticExpr->isSimpleArithmeticExpression()) |
| 2288 | 2288 | ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression) |
| 2289 | - : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')'; |
|
| 2289 | + : '('.$this->walkSubselect($arithmeticExpr->subselect).')'; |
|
| 2290 | 2290 | } |
| 2291 | 2291 | |
| 2292 | 2292 | /** |
@@ -2294,7 +2294,7 @@ discard block |
||
| 2294 | 2294 | */ |
| 2295 | 2295 | public function walkSimpleArithmeticExpression($simpleArithmeticExpr) |
| 2296 | 2296 | { |
| 2297 | - if (! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
| 2297 | + if ( ! ($simpleArithmeticExpr instanceof AST\SimpleArithmeticExpression)) { |
|
| 2298 | 2298 | return $this->walkArithmeticTerm($simpleArithmeticExpr); |
| 2299 | 2299 | } |
| 2300 | 2300 | |
@@ -2314,7 +2314,7 @@ discard block |
||
| 2314 | 2314 | |
| 2315 | 2315 | // Phase 2 AST optimization: Skip processing of ArithmeticTerm |
| 2316 | 2316 | // if only one ArithmeticFactor is defined |
| 2317 | - if (! ($term instanceof AST\ArithmeticTerm)) { |
|
| 2317 | + if ( ! ($term instanceof AST\ArithmeticTerm)) { |
|
| 2318 | 2318 | return $this->walkArithmeticFactor($term); |
| 2319 | 2319 | } |
| 2320 | 2320 | |
@@ -2334,13 +2334,13 @@ discard block |
||
| 2334 | 2334 | |
| 2335 | 2335 | // Phase 2 AST optimization: Skip processing of ArithmeticFactor |
| 2336 | 2336 | // if only one ArithmeticPrimary is defined |
| 2337 | - if (! ($factor instanceof AST\ArithmeticFactor)) { |
|
| 2337 | + if ( ! ($factor instanceof AST\ArithmeticFactor)) { |
|
| 2338 | 2338 | return $this->walkArithmeticPrimary($factor); |
| 2339 | 2339 | } |
| 2340 | 2340 | |
| 2341 | 2341 | $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : ''); |
| 2342 | 2342 | |
| 2343 | - return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2343 | + return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary); |
|
| 2344 | 2344 | } |
| 2345 | 2345 | |
| 2346 | 2346 | /** |
@@ -2353,7 +2353,7 @@ discard block |
||
| 2353 | 2353 | public function walkArithmeticPrimary($primary) |
| 2354 | 2354 | { |
| 2355 | 2355 | if ($primary instanceof AST\SimpleArithmeticExpression) { |
| 2356 | - return '(' . $this->walkSimpleArithmeticExpression($primary) . ')'; |
|
| 2356 | + return '('.$this->walkSimpleArithmeticExpression($primary).')'; |
|
| 2357 | 2357 | } |
| 2358 | 2358 | |
| 2359 | 2359 | if ($primary instanceof AST\Node) { |
@@ -2411,7 +2411,7 @@ discard block |
||
| 2411 | 2411 | $entityClassName = $entityClass->getClassName(); |
| 2412 | 2412 | |
| 2413 | 2413 | if ($entityClassName !== $rootClass->getClassName()) { |
| 2414 | - if (! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
| 2414 | + if ( ! $entityClass->getReflectionClass()->isSubclassOf($rootClass->getClassName())) { |
|
| 2415 | 2415 | throw QueryException::instanceOfUnrelatedClass($entityClassName, $rootClass->getClassName()); |
| 2416 | 2416 | } |
| 2417 | 2417 | } |
@@ -2423,6 +2423,6 @@ discard block |
||
| 2423 | 2423 | $sqlParameterList[] = $this->conn->quote($discriminator); |
| 2424 | 2424 | } |
| 2425 | 2425 | |
| 2426 | - return '(' . implode(', ', $sqlParameterList) . ')'; |
|
| 2426 | + return '('.implode(', ', $sqlParameterList).')'; |
|
| 2427 | 2427 | } |
| 2428 | 2428 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | public static function new() : self |
| 10 | 10 | { |
| 11 | 11 | return new self( |
| 12 | - "It's a requirement to specify a Metadata Driver and pass it " . |
|
| 12 | + "It's a requirement to specify a Metadata Driver and pass it ". |
|
| 13 | 13 | 'to Doctrine\\ORM\\Configuration::setMetadataDriverImpl().' |
| 14 | 14 | ); |
| 15 | 15 | } |
@@ -10,6 +10,6 @@ |
||
| 10 | 10 | { |
| 11 | 11 | public static function new(string $generatorType) : self |
| 12 | 12 | { |
| 13 | - return new self('Unknown generator type: ' . $generatorType); |
|
| 13 | + return new self('Unknown generator type: '.$generatorType); |
|
| 14 | 14 | } |
| 15 | 15 | } |