Failed Conditions
Pull Request — develop (#6618)
by Marco
124:30 queued 59:20
created
lib/Doctrine/ORM/Mapping/ClassMetadata.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
      * Sets the mapped identifier/primary key fields of this class.
1058 1058
      * Mainly used by the ClassMetadataFactory to assign inherited identifiers.
1059 1059
      *
1060
-     * @param array $identifier
1060
+     * @param string[] $identifier
1061 1061
      *
1062 1062
      * @return void
1063 1063
      */
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
      *
1176 1176
      * @todo guilhermeblanco Only used for ClassMetadataTest. Remove if possible!
1177 1177
      *
1178
-     * @param array $subclasses The names of all mapped subclasses.
1178
+     * @param string[] $subclasses The names of all mapped subclasses.
1179 1179
      *
1180 1180
      * @return void
1181 1181
      */
Please login to merge, or discard this patch.
lib/Doctrine/ORM/UnitOfWork.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
             // Entity deletions come last and need to be in reverse commit order
370 370
             if ($this->entityDeletions) {
371 371
                 foreach (array_reverse($commitOrder) as $committedEntityName) {
372
-                    if (! $this->entityDeletions) {
372
+                    if ( ! $this->entityDeletions) {
373 373
                         break; // just a performance optimisation
374 374
                     }
375 375
 
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
         $oid  = spl_object_hash($entity);
455 455
         $data = [];
456 456
 
457
-        if (!isset($this->entityChangeSets[$oid])) {
457
+        if ( ! isset($this->entityChangeSets[$oid])) {
458 458
             return $data;
459 459
         }
460 460
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
                     || ! $class->getProperty($name) instanceof FieldMetadata
538 538
                     || ! $class->getProperty($name)->hasValueGenerator()
539 539
                     || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY
540
-                ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
540
+                ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
541 541
                 $actualData[$name] = $value;
542 542
             }
543 543
         }
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
                     if ($owner === null) { // cloned
592 592
                         $actualValue->setOwner($entity, $property);
593 593
                     } else if ($owner !== $entity) { // no clone, we have to fix
594
-                        if (! $actualValue->isInitialized()) {
594
+                        if ( ! $actualValue->isInitialized()) {
595 595
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
596 596
                         }
597 597
 
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
                             // A PersistentCollection was de-referenced, so delete it.
632 632
                             $coid = spl_object_hash($orgValue);
633 633
 
634
-                            if (!isset($this->collectionDeletions[$coid])) {
634
+                            if ( ! isset($this->collectionDeletions[$coid])) {
635 635
                                 $this->collectionDeletions[$coid] = $orgValue;
636 636
                                 $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored
637 637
                             }
@@ -653,7 +653,7 @@  discard block
 block discarded – undo
653 653
 
654 654
         // Look for changes in associations of the entity
655 655
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
656
-            if (! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) {
656
+            if ( ! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) {
657 657
                 continue;
658 658
             }
659 659
 
@@ -757,13 +757,13 @@  discard block
 block discarded – undo
757 757
         $targetClass    = $this->em->getClassMetadata($targetEntity);
758 758
 
759 759
         foreach ($unwrappedValue as $key => $entry) {
760
-            if (! ($entry instanceof $targetEntity)) {
760
+            if ( ! ($entry instanceof $targetEntity)) {
761 761
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry);
762 762
             }
763 763
 
764 764
             $state = $this->getEntityState($entry, self::STATE_NEW);
765 765
 
766
-            if (! ($entry instanceof $targetEntity)) {
766
+            if ( ! ($entry instanceof $targetEntity)) {
767 767
                 throw ORMException::unexpectedAssociationValue(
768 768
                     $association->getSourceEntity(),
769 769
                     $association->getName(),
@@ -822,7 +822,7 @@  discard block
 block discarded – undo
822 822
         $persister = $this->getEntityPersister($class->getClassName());
823 823
         $generationPlan->executeImmediate($this->em, $entity);
824 824
 
825
-        if (! $generationPlan->containsDeferred()) {
825
+        if ( ! $generationPlan->containsDeferred()) {
826 826
             $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity));
827 827
             $this->entityIdentifiers[$oid] = $id;
828 828
         }
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
     {
856 856
         $oid = spl_object_hash($entity);
857 857
 
858
-        if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
858
+        if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
859 859
             throw ORMInvalidArgumentException::entityNotManaged($entity);
860 860
         }
861 861
 
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
                     break;
878 878
 
879 879
                 case ($property instanceof FieldMetadata):
880
-                    if (! $property->isPrimaryKey()
880
+                    if ( ! $property->isPrimaryKey()
881 881
                         || ! $property->getValueGenerator()
882 882
                         || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) {
883 883
                         $actualData[$name] = $property->getValue($entity);
@@ -1030,7 +1030,7 @@  discard block
 block discarded – undo
1030 1030
             // Entity with this $oid after deletion treated as NEW, even if the $oid
1031 1031
             // is obtained by a new entity because the old one went out of scope.
1032 1032
             //$this->entityStates[$oid] = self::STATE_NEW;
1033
-            if (! $class->isIdentifierComposite()) {
1033
+            if ( ! $class->isIdentifierComposite()) {
1034 1034
                 $property = $class->getProperty($class->getSingleIdentifierFieldName());
1035 1035
 
1036 1036
                 if ($property instanceof FieldMetadata && $property->hasValueGenerator()) {
@@ -1083,7 +1083,7 @@  discard block
 block discarded – undo
1083 1083
         // Calculate dependencies for new nodes
1084 1084
         while ($class = array_pop($newNodes)) {
1085 1085
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
1086
-                if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1086
+                if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1087 1087
                     continue;
1088 1088
                 }
1089 1089
 
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 
1098 1098
                 $weight = ! array_filter(
1099 1099
                     $property->getJoinColumns(),
1100
-                    function (JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); }
1100
+                    function(JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); }
1101 1101
                 );
1102 1102
 
1103 1103
                 $calc->addDependency($targetClass->getClassName(), $class->getClassName(), $weight);
@@ -1391,7 +1391,7 @@  discard block
 block discarded – undo
1391 1391
         $persister = $this->getEntityPersister($class->getClassName());
1392 1392
         $id        = $persister->getIdentifier($entity);
1393 1393
 
1394
-        if (! $id) {
1394
+        if ( ! $id) {
1395 1395
             return self::STATE_NEW;
1396 1396
         }
1397 1397
 
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
1627 1627
 
1628 1628
             default:
1629
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1629
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1630 1630
         }
1631 1631
 
1632 1632
         $this->cascadePersist($entity, $visited);
@@ -1696,7 +1696,7 @@  discard block
 block discarded – undo
1696 1696
             case self::STATE_DETACHED:
1697 1697
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
1698 1698
             default:
1699
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1699
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1700 1700
         }
1701 1701
 
1702 1702
     }
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
                 if ($managedCopy === null) {
1786 1786
                     // If the identifier is ASSIGNED, it is NEW, otherwise an error
1787 1787
                     // since the managed entity was not found.
1788
-                    if (! $class->isIdentifierComposite()
1788
+                    if ( ! $class->isIdentifierComposite()
1789 1789
                         && $class->getProperty($class->getSingleIdentifierFieldName()) instanceof FieldMetadata
1790 1790
                         && $class->getProperty($class->getSingleIdentifierFieldName())->hasValueGenerator()) {
1791 1791
                         throw EntityNotFoundException::fromClassNameAndIdentifier(
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
      */
1837 1837
     private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy)
1838 1838
     {
1839
-        if (! ($class->isVersioned() && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) {
1839
+        if ( ! ($class->isVersioned() && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) {
1840 1840
             return;
1841 1841
         }
1842 1842
 
@@ -1860,7 +1860,7 @@  discard block
 block discarded – undo
1860 1860
      */
1861 1861
     private function isLoaded($entity)
1862 1862
     {
1863
-        return !($entity instanceof Proxy) || $entity->__isInitialized();
1863
+        return ! ($entity instanceof Proxy) || $entity->__isInitialized();
1864 1864
     }
1865 1865
 
1866 1866
     /**
@@ -2022,7 +2022,7 @@  discard block
 block discarded – undo
2022 2022
         $class = $this->em->getClassMetadata(get_class($entity));
2023 2023
 
2024 2024
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2025
-            if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) {
2025
+            if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) {
2026 2026
                 continue;
2027 2027
             }
2028 2028
 
@@ -2064,7 +2064,7 @@  discard block
 block discarded – undo
2064 2064
         $class = $this->em->getClassMetadata(get_class($entity));
2065 2065
 
2066 2066
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2067
-            if (! ($association instanceof AssociationMetadata && in_array('detach', $association->getCascade()))) {
2067
+            if ( ! ($association instanceof AssociationMetadata && in_array('detach', $association->getCascade()))) {
2068 2068
                 continue;
2069 2069
             }
2070 2070
 
@@ -2107,7 +2107,7 @@  discard block
 block discarded – undo
2107 2107
         $class = $this->em->getClassMetadata(get_class($entity));
2108 2108
 
2109 2109
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2110
-            if (! ($association instanceof AssociationMetadata && in_array('merge', $association->getCascade()))) {
2110
+            if ( ! ($association instanceof AssociationMetadata && in_array('merge', $association->getCascade()))) {
2111 2111
                 continue;
2112 2112
             }
2113 2113
 
@@ -2146,7 +2146,7 @@  discard block
 block discarded – undo
2146 2146
         $class = $this->em->getClassMetadata(get_class($entity));
2147 2147
 
2148 2148
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2149
-            if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) {
2149
+            if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) {
2150 2150
                 continue;
2151 2151
             }
2152 2152
 
@@ -2162,7 +2162,7 @@  discard block
 block discarded – undo
2162 2162
 
2163 2163
                 case ($relatedEntities instanceof Collection):
2164 2164
                 case (is_array($relatedEntities)):
2165
-                    if (! ($association instanceof ToManyAssociationMetadata)) {
2165
+                    if ( ! ($association instanceof ToManyAssociationMetadata)) {
2166 2166
                         throw ORMInvalidArgumentException::invalidAssociation(
2167 2167
                             $this->em->getClassMetadata($targetEntity),
2168 2168
                             $association,
@@ -2177,7 +2177,7 @@  discard block
 block discarded – undo
2177 2177
                     break;
2178 2178
 
2179 2179
                 case ($relatedEntities !== null):
2180
-                    if (! $relatedEntities instanceof $targetEntity) {
2180
+                    if ( ! $relatedEntities instanceof $targetEntity) {
2181 2181
                         throw ORMInvalidArgumentException::invalidAssociation(
2182 2182
                             $this->em->getClassMetadata($targetEntity),
2183 2183
                             $association,
@@ -2208,7 +2208,7 @@  discard block
 block discarded – undo
2208 2208
         $class             = $this->em->getClassMetadata(get_class($entity));
2209 2209
 
2210 2210
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2211
-            if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) {
2211
+            if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) {
2212 2212
                 continue;
2213 2213
             }
2214 2214
 
@@ -2291,7 +2291,7 @@  discard block
 block discarded – undo
2291 2291
             case LockMode::NONE === $lockMode:
2292 2292
             case LockMode::PESSIMISTIC_READ === $lockMode:
2293 2293
             case LockMode::PESSIMISTIC_WRITE === $lockMode:
2294
-                if (!$this->em->getConnection()->isTransactionActive()) {
2294
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
2295 2295
                     throw TransactionRequiredException::transactionRequired();
2296 2296
                 }
2297 2297
 
@@ -2535,7 +2535,7 @@  discard block
 block discarded – undo
2535 2535
         }
2536 2536
 
2537 2537
         foreach ($class->getDeclaredPropertiesIterator() as $field => $association) {
2538
-            if (! ($association instanceof AssociationMetadata)) {
2538
+            if ( ! ($association instanceof AssociationMetadata)) {
2539 2539
                 continue;
2540 2540
             }
2541 2541
 
@@ -2584,7 +2584,7 @@  discard block
 block discarded – undo
2584 2584
                 continue;
2585 2585
             }
2586 2586
 
2587
-            if (! $association->isOwningSide()) {
2587
+            if ( ! $association->isOwningSide()) {
2588 2588
                 // use the given entity association
2589 2589
                 if (isset($data[$field]) && is_object($data[$field]) &&
2590 2590
                     isset($this->entityStates[spl_object_hash($data[$field])])) {
@@ -2634,7 +2634,7 @@  discard block
 block discarded – undo
2634 2634
                 $associatedId[$targetField] = $joinColumnValue;
2635 2635
             }
2636 2636
 
2637
-            if (! $associatedId) {
2637
+            if ( ! $associatedId) {
2638 2638
                 // Foreign key is NULL
2639 2639
                 $association->setValue($entity, null);
2640 2640
                 $this->originalEntityData[$oid][$field] = null;
@@ -2643,7 +2643,7 @@  discard block
 block discarded – undo
2643 2643
             }
2644 2644
 
2645 2645
             // @todo guilhermeblanco Can we remove the need of this somehow?
2646
-            if (!isset($hints['fetchMode'][$class->getClassName()][$field])) {
2646
+            if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2647 2647
                 $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode();
2648 2648
             }
2649 2649
 
@@ -2660,7 +2660,7 @@  discard block
 block discarded – undo
2660 2660
                     // If this is an uninitialized proxy, we are deferring eager loads,
2661 2661
                     // this association is marked as eager fetch, and its an uninitialized proxy (wtf!)
2662 2662
                     // then we can append this entity for eager loading!
2663
-                    if (!$targetClass->isIdentifierComposite() &&
2663
+                    if ( ! $targetClass->isIdentifierComposite() &&
2664 2664
                         $newValue instanceof Proxy &&
2665 2665
                         isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2666 2666
                         $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER &&
@@ -2691,7 +2691,7 @@  discard block
 block discarded – undo
2691 2691
                             break;
2692 2692
 
2693 2693
                         // Deferred eager load only works for single identifier classes
2694
-                        case (isset($hints[self::HINT_DEFEREAGERLOAD]) && !$targetClass->isIdentifierComposite()):
2694
+                        case (isset($hints[self::HINT_DEFEREAGERLOAD]) && ! $targetClass->isIdentifierComposite()):
2695 2695
                             // TODO: Is there a faster approach?
2696 2696
                             $this->eagerLoadingEntities[$targetClass->getRootClassName()][$relatedIdHash] = current($associatedId);
2697 2697
 
@@ -3063,7 +3063,7 @@  discard block
 block discarded – undo
3063 3063
     {
3064 3064
         $class = $this->em->getClassMetadata(get_class($entity));
3065 3065
 
3066
-        if (! $class->getProperty($propertyName)) {
3066
+        if ( ! $class->getProperty($propertyName)) {
3067 3067
             return; // ignore non-persistent fields
3068 3068
         }
3069 3069
 
@@ -3203,7 +3203,7 @@  discard block
 block discarded – undo
3203 3203
      */
3204 3204
     private function afterTransactionComplete()
3205 3205
     {
3206
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3206
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3207 3207
             $persister->afterTransactionComplete();
3208 3208
         });
3209 3209
     }
@@ -3213,7 +3213,7 @@  discard block
 block discarded – undo
3213 3213
      */
3214 3214
     private function afterTransactionRolledBack()
3215 3215
     {
3216
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3216
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3217 3217
             $persister->afterTransactionRolledBack();
3218 3218
         });
3219 3219
     }
@@ -3296,11 +3296,11 @@  discard block
 block discarded – undo
3296 3296
      */
3297 3297
     private function mergeEntityStateIntoManagedCopy($entity, $managedCopy)
3298 3298
     {
3299
-        if (! $this->isLoaded($entity)) {
3299
+        if ( ! $this->isLoaded($entity)) {
3300 3300
             return;
3301 3301
         }
3302 3302
 
3303
-        if (! $this->isLoaded($managedCopy)) {
3303
+        if ( ! $this->isLoaded($managedCopy)) {
3304 3304
             $managedCopy->__load();
3305 3305
         }
3306 3306
 
@@ -3309,7 +3309,7 @@  discard block
 block discarded – undo
3309 3309
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
3310 3310
             switch (true) {
3311 3311
                 case ($property instanceof FieldMetadata):
3312
-                    if (! $property->isPrimaryKey()) {
3312
+                    if ( ! $property->isPrimaryKey()) {
3313 3313
                         $property->setValue($managedCopy, $property->getValue($entity));
3314 3314
                     }
3315 3315
 
@@ -3331,7 +3331,7 @@  discard block
 block discarded – undo
3331 3331
                         continue 2;
3332 3332
                     }
3333 3333
 
3334
-                    if (! in_array('merge', $property->getCascade())) {
3334
+                    if ( ! in_array('merge', $property->getCascade())) {
3335 3335
                         if ($this->getEntityState($other) === self::STATE_DETACHED) {
3336 3336
                             $targetEntity    = $property->getTargetEntity();
3337 3337
                             $targetClass     = $this->em->getClassMetadata($targetEntity);
@@ -3363,7 +3363,7 @@  discard block
 block discarded – undo
3363 3363
 
3364 3364
                     $managedCol = $property->getValue($managedCopy);
3365 3365
 
3366
-                    if (! $managedCol) {
3366
+                    if ( ! $managedCol) {
3367 3367
                         $managedCol = $property->wrap($managedCopy, [], $this->em);
3368 3368
 
3369 3369
                         $property->setValue($managedCopy, $managedCol);
@@ -3373,7 +3373,7 @@  discard block
 block discarded – undo
3373 3373
                         $managedCol->initialize();
3374 3374
 
3375 3375
                         // clear and set dirty a managed collection if its not also the same collection to merge from.
3376
-                        if (! $managedCol->isEmpty() && $managedCol !== $mergeCol) {
3376
+                        if ( ! $managedCol->isEmpty() && $managedCol !== $mergeCol) {
3377 3377
                             $managedCol->unwrap()->clear();
3378 3378
                             $managedCol->setDirty(true);
3379 3379
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php 1 patch
Spacing   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Persisters\Collection;
6 6
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     {
35 35
         $association = $collection->getMapping();
36 36
 
37
-        if (! $association->isOwningSide()) {
37
+        if ( ! $association->isOwningSide()) {
38 38
             return; // ignore inverse side
39 39
         }
40 40
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             /** @var JoinColumnMetadata $joinColumn */
47 47
             $referencedColumnName = $joinColumn->getReferencedColumnName();
48 48
 
49
-            if (! $joinColumn->getType()) {
49
+            if ( ! $joinColumn->getType()) {
50 50
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
51 51
             }
52 52
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $association = $collection->getMapping();
68 68
 
69
-        if (! $association->isOwningSide()) {
69
+        if ( ! $association->isOwningSide()) {
70 70
             return; // ignore inverse side
71 71
         }
72 72
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $association = $collection->getMapping();
99 99
 
100
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
100
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
101 101
             throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections.");
102 102
         }
103 103
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             : $association->getMappedBy()
108 108
         ;
109 109
 
110
-        $criteria  = [
110
+        $criteria = [
111 111
             $mappedKey                   => $collection->getOwner(),
112 112
             $association->getIndexedBy() => $index,
113 113
         ];
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
145 145
             $referencedColumnName = $joinColumn->getReferencedColumnName();
146 146
 
147
-            if (! $joinColumn->getType()) {
147
+            if ( ! $joinColumn->getType()) {
148 148
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
149 149
             }
150 150
 
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
         }*/
178 178
 
179 179
         $sql = 'SELECT COUNT(*)'
180
-            . ' FROM ' . $joinTableName . ' t'
180
+            . ' FROM '.$joinTableName.' t'
181 181
             . $joinTargetEntitySQL
182
-            . ' WHERE ' . implode(' AND ', $conditions);
182
+            . ' WHERE '.implode(' AND ', $conditions);
183 183
 
184 184
         return $this->conn->fetchColumn($sql, $params, 0, $types);
185 185
     }
@@ -201,13 +201,13 @@  discard block
 block discarded – undo
201 201
     {
202 202
         $association = $collection->getMapping();
203 203
 
204
-        if (! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
204
+        if ( ! ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy())) {
205 205
             throw new \BadMethodCallException("Selecting a collection by index is only supported on indexed collections.");
206 206
         }
207 207
 
208 208
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictionsWithKey($collection, $key, true);
209 209
 
210
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
210
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
211 211
 
212 212
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
213 213
     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, true);
225 225
 
226
-        $sql = 'SELECT 1 FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
226
+        $sql = 'SELECT 1 FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
227 227
 
228 228
         return (bool) $this->conn->fetchColumn($sql, $params, 0, $types);
229 229
     }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
         list($quotedJoinTable, $whereClauses, $params, $types) = $this->getJoinTableRestrictions($collection, $element, false);
241 241
 
242
-        $sql = 'DELETE FROM ' . $quotedJoinTable . ' WHERE ' . implode(' AND ', $whereClauses);
242
+        $sql = 'DELETE FROM '.$quotedJoinTable.' WHERE '.implode(' AND ', $whereClauses);
243 243
 
244 244
         return (bool) $this->conn->executeUpdate($sql, $params, $types);
245 245
     }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         $onConditions  = $this->getOnConditionSQL($association);
258 258
         $whereClauses  = $params = $types = [];
259 259
 
260
-        if (! $association->isOwningSide()) {
260
+        if ( ! $association->isOwningSide()) {
261 261
             $association = $targetClass->getProperty($association->getMappedBy());
262 262
             $joinColumns = $association->getJoinTable()->getInverseJoinColumns();
263 263
         } else {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
270 270
             $referencedColumnName = $joinColumn->getReferencedColumnName();
271 271
 
272
-            if (! $joinColumn->getType()) {
272
+            if ( ! $joinColumn->getType()) {
273 273
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $ownerMetadata, $this->em));
274 274
             }
275 275
 
@@ -297,11 +297,11 @@  discard block
 block discarded – undo
297 297
 
298 298
         $resultSetMapping->addRootEntityFromClassMetadata($targetClass->getClassName(), 'te');
299 299
 
300
-        $sql = 'SELECT ' . $resultSetMapping->generateSelectClause()
301
-            . ' FROM ' . $tableName . ' te'
302
-            . ' JOIN ' . $joinTableName . ' t ON'
300
+        $sql = 'SELECT '.$resultSetMapping->generateSelectClause()
301
+            . ' FROM '.$tableName.' te'
302
+            . ' JOIN '.$joinTableName.' t ON'
303 303
             . implode(' AND ', $onConditions)
304
-            . ' WHERE ' . implode(' AND ', $whereClauses);
304
+            . ' WHERE '.implode(' AND ', $whereClauses);
305 305
 
306 306
         $sql .= $this->getOrderingSql($criteria, $targetClass);
307 307
         $sql .= $this->getLimitSql($criteria);
@@ -338,8 +338,8 @@  discard block
 block discarded – undo
338 338
 
339 339
         // A join is needed if there is filtering on the target entity
340 340
         $tableName = $rootClass->table->getQuotedQualifiedName($this->platform);
341
-        $joinSql   = ' JOIN ' . $tableName . ' te'
342
-            . ' ON' . implode(' AND ', $this->getOnConditionSQL($association));
341
+        $joinSql   = ' JOIN '.$tableName.' te'
342
+            . ' ON'.implode(' AND ', $this->getOnConditionSQL($association));
343 343
 
344 344
         return [$joinSql, $filterSql];
345 345
     }
@@ -358,18 +358,18 @@  discard block
 block discarded – undo
358 358
 
359 359
         foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
360 360
             if ($filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) {
361
-                $filterClauses[] = '(' . $filterExpr . ')';
361
+                $filterClauses[] = '('.$filterExpr.')';
362 362
             }
363 363
         }
364 364
 
365
-        if (! $filterClauses) {
365
+        if ( ! $filterClauses) {
366 366
             return '';
367 367
         }
368 368
 
369 369
         $filterSql = implode(' AND ', $filterClauses);
370 370
 
371 371
         return isset($filterClauses[1])
372
-            ? '(' . $filterSql . ')'
372
+            ? '('.$filterSql.')'
373 373
             : $filterSql
374 374
         ;
375 375
     }
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
             $quotedColumnName           = $this->platform->quoteIdentifier($joinColumn->getColumnName());
401 401
             $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName());
402 402
 
403
-            $conditions[] = ' t.' . $quotedColumnName . ' = ' . 'te.' . $quotedReferencedColumnName;
403
+            $conditions[] = ' t.'.$quotedColumnName.' = '.'te.'.$quotedReferencedColumnName;
404 404
         }
405 405
 
406 406
         return $conditions;
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
             $columns[] = $this->platform->quoteIdentifier($joinColumn->getColumnName());
423 423
         }
424 424
 
425
-        return 'DELETE FROM ' . $joinTableName . ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
425
+        return 'DELETE FROM '.$joinTableName.' WHERE '.implode(' = ? AND ', $columns).' = ?';
426 426
     }
427 427
 
428 428
     /**
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
479 479
             $referencedColumnName = $joinColumn->getReferencedColumnName();
480 480
 
481
-            if (! $joinColumn->getType()) {
481
+            if ( ! $joinColumn->getType()) {
482 482
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
483 483
             }
484 484
 
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
492 492
             $referencedColumnName = $joinColumn->getReferencedColumnName();
493 493
 
494
-            if (! $joinColumn->getType()) {
494
+            if ( ! $joinColumn->getType()) {
495 495
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
496 496
             }
497 497
 
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
546 546
             $referencedColumnName = $joinColumn->getReferencedColumnName();
547 547
 
548
-            if (! $joinColumn->getType()) {
548
+            if ( ! $joinColumn->getType()) {
549 549
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $class, $this->em));
550 550
             }
551 551
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
559 559
             $referencedColumnName = $joinColumn->getReferencedColumnName();
560 560
 
561
-            if (! $joinColumn->getType()) {
561
+            if ( ! $joinColumn->getType()) {
562 562
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
563 563
             }
564 564
 
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
         $sourceClass       = $this->em->getClassMetadata($owningAssociation->getSourceEntity());
646 646
         $targetClass       = $this->em->getClassMetadata($owningAssociation->getTargetEntity());
647 647
 
648
-        if (! $owningAssociation->isOwningSide()) {
648
+        if ( ! $owningAssociation->isOwningSide()) {
649 649
             $owningAssociation  = $targetClass->getProperty($owningAssociation->getMappedBy());
650 650
             $joinTable          = $owningAssociation->getJoinTable();
651 651
             $joinColumns        = $joinTable->getJoinColumns();
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
         }
658 658
 
659 659
         $joinTableName   = $joinTable->getQuotedQualifiedName($this->platform);
660
-        $quotedJoinTable = $joinTableName . ' t';
660
+        $quotedJoinTable = $joinTableName.' t';
661 661
         $whereClauses    = [];
662 662
         $params          = [];
663 663
         $types           = [];
@@ -671,11 +671,11 @@  discard block
 block discarded – undo
671 671
                 $quotedColumnName           = $this->platform->quoteIdentifier($joinColumn->getColumnName());
672 672
                 $quotedReferencedColumnName = $this->platform->quoteIdentifier($joinColumn->getReferencedColumnName());
673 673
 
674
-                $joinConditions[] = ' t.' . $quotedColumnName . ' = ' . 'tr.' . $quotedReferencedColumnName;
674
+                $joinConditions[] = ' t.'.$quotedColumnName.' = '.'tr.'.$quotedReferencedColumnName;
675 675
             }
676 676
 
677 677
             $tableName        = $targetClass->table->getQuotedQualifiedName($this->platform);
678
-            $quotedJoinTable .= ' JOIN ' . $tableName . ' tr ON ' . implode(' AND ', $joinConditions);
678
+            $quotedJoinTable .= ' JOIN '.$tableName.' tr ON '.implode(' AND ', $joinConditions);
679 679
             $indexByProperty  = $targetClass->getProperty($indexBy);
680 680
 
681 681
             switch (true) {
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
699 699
             $referencedColumnName = $joinColumn->getReferencedColumnName();
700 700
 
701
-            if (! $joinColumn->getType()) {
701
+            if ( ! $joinColumn->getType()) {
702 702
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
703 703
             }
704 704
 
@@ -707,13 +707,13 @@  discard block
 block discarded – undo
707 707
             $types[]        = $joinColumn->getType();
708 708
         }
709 709
 
710
-        if (! $joinNeeded) {
710
+        if ( ! $joinNeeded) {
711 711
             foreach ($joinColumns as $joinColumn) {
712 712
                 /** @var JoinColumnMetadata $joinColumn */
713 713
                 $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
714 714
                 $referencedColumnName = $joinColumn->getReferencedColumnName();
715 715
 
716
-                if (! $joinColumn->getType()) {
716
+                if ( ! $joinColumn->getType()) {
717 717
                     $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
718 718
                 }
719 719
 
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association);
728 728
 
729 729
             if ($filterSql) {
730
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
730
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
731 731
                 $whereClauses[] = $filterSql;
732 732
             }
733 733
         }
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
         $association       = $collection->getMapping();
752 752
         $owningAssociation = $association;
753 753
 
754
-        if (! $association->isOwningSide()) {
754
+        if ( ! $association->isOwningSide()) {
755 755
             $sourceClass      = $this->em->getClassMetadata($association->getTargetEntity());
756 756
             $targetClass      = $this->em->getClassMetadata($association->getSourceEntity());
757 757
             $sourceIdentifier = $this->uow->getEntityIdentifier($element);
@@ -777,11 +777,11 @@  discard block
 block discarded – undo
777 777
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
778 778
             $referencedColumnName = $joinColumn->getReferencedColumnName();
779 779
 
780
-            if (! $joinColumn->getType()) {
780
+            if ( ! $joinColumn->getType()) {
781 781
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $sourceClass, $this->em));
782 782
             }
783 783
 
784
-            $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?';
784
+            $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?';
785 785
             $params[]       = $sourceIdentifier[$sourceClass->fieldNames[$referencedColumnName]];
786 786
             $types[]        = $joinColumn->getType();
787 787
         }
@@ -791,11 +791,11 @@  discard block
 block discarded – undo
791 791
             $quotedColumnName     = $this->platform->quoteIdentifier($joinColumn->getColumnName());
792 792
             $referencedColumnName = $joinColumn->getReferencedColumnName();
793 793
 
794
-            if (! $joinColumn->getType()) {
794
+            if ( ! $joinColumn->getType()) {
795 795
                 $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
796 796
             }
797 797
 
798
-            $whereClauses[] = ($addFilters ? 't.' : '') . $quotedColumnName . ' = ?';
798
+            $whereClauses[] = ($addFilters ? 't.' : '').$quotedColumnName.' = ?';
799 799
             $params[]       = $targetIdentifier[$targetClass->fieldNames[$referencedColumnName]];
800 800
             $types[]        = $joinColumn->getType();
801 801
         }
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
             list($joinTargetEntitySQL, $filterSql) = $this->getFilterSql($association);
807 807
 
808 808
             if ($filterSql) {
809
-                $quotedJoinTable .= ' ' . $joinTargetEntitySQL;
809
+                $quotedJoinTable .= ' '.$joinTargetEntitySQL;
810 810
                 $whereClauses[] = $filterSql;
811 811
             }
812 812
         }
@@ -855,10 +855,10 @@  discard block
 block discarded – undo
855 855
                 $property   = $targetClass->getProperty($name);
856 856
                 $columnName = $this->platform->quoteIdentifier($property->getColumnName());
857 857
 
858
-                $orderBy[] = $columnName . ' ' . $direction;
858
+                $orderBy[] = $columnName.' '.$direction;
859 859
             }
860 860
 
861
-            return ' ORDER BY ' . implode(', ', $orderBy);
861
+            return ' ORDER BY '.implode(', ', $orderBy);
862 862
         }
863 863
         return '';
864 864
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/Parser.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query;
6 6
 
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
         $tokenStr = substr($dql, (int) $token['position'], $length);
471 471
 
472 472
         // Building informative message
473
-        $message = 'line 0, col ' . $tokenPos . " near '" . $tokenStr . "': Error: " . $message;
473
+        $message = 'line 0, col '.$tokenPos." near '".$tokenStr."': Error: ".$message;
474 474
 
475 475
         throw QueryException::semanticalError($message, QueryException::dqlError($this->query->getDQL()));
476 476
     }
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
             // If the namespace is not given then assumes the first FROM entity namespace
618 618
             if (strpos($className, '\\') === false && ! class_exists($className) && strpos($fromClassName, '\\') !== false) {
619 619
                 $namespace  = substr($fromClassName, 0, strrpos($fromClassName, '\\'));
620
-                $fqcn       = $namespace . '\\' . $className;
620
+                $fqcn       = $namespace.'\\'.$className;
621 621
 
622 622
                 if (class_exists($fqcn)) {
623 623
                     $expression->className  = $fqcn;
@@ -666,13 +666,13 @@  discard block
 block discarded – undo
666 666
                 }
667 667
 
668 668
                 $this->semanticalError(
669
-                    "There is no mapped field named '$field' on class " . $class->getClassName() . ".", $deferredItem['token']
669
+                    "There is no mapped field named '$field' on class ".$class->getClassName().".", $deferredItem['token']
670 670
                 );
671 671
             }
672 672
 
673 673
             if (array_intersect($class->identifier, $expr->partialFieldSet) != $class->identifier) {
674 674
                 $this->semanticalError(
675
-                    "The partial field selection of class " . $class->getClassName() . " must contain the identifier.",
675
+                    "The partial field selection of class ".$class->getClassName()." must contain the identifier.",
676 676
                     $deferredItem['token']
677 677
                 );
678 678
             }
@@ -741,9 +741,9 @@  discard block
 block discarded – undo
741 741
             $property = $class->getProperty($field);
742 742
 
743 743
             // Check if field or association exists
744
-            if (! $property) {
744
+            if ( ! $property) {
745 745
                 $this->semanticalError(
746
-                    'Class ' . $class->getClassName() . ' has no field or association named ' . $field,
746
+                    'Class '.$class->getClassName().' has no field or association named '.$field,
747 747
                     $deferredItem['token']
748 748
                 );
749 749
             }
@@ -782,8 +782,8 @@  discard block
 block discarded – undo
782 782
                 // Build the error message
783 783
                 $semanticalError  = 'Invalid PathExpression. ';
784 784
                 $semanticalError .= \count($expectedStringTypes) === 1
785
-                    ? 'Must be a ' . $expectedStringTypes[0] . '.'
786
-                    : implode(' or ', $expectedStringTypes) . ' expected.';
785
+                    ? 'Must be a '.$expectedStringTypes[0].'.'
786
+                    : implode(' or ', $expectedStringTypes).' expected.';
787 787
 
788 788
                 $this->semanticalError($semanticalError, $deferredItem['token']);
789 789
             }
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
 
953 953
             list($namespaceAlias, $simpleClassName) = explode(':', $this->lexer->token['value']);
954 954
 
955
-            $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
955
+            $schemaName = $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
956 956
         }
957 957
 
958 958
         return $schemaName;
@@ -967,7 +967,7 @@  discard block
 block discarded – undo
967 967
      */
968 968
     private function validateAbstractSchemaName($schemaName)
969 969
     {
970
-        if (! (class_exists($schemaName, true) || interface_exists($schemaName, true))) {
970
+        if ( ! (class_exists($schemaName, true) || interface_exists($schemaName, true))) {
971 971
             $this->semanticalError("Class '$schemaName' is not defined.", $this->lexer->token);
972 972
         }
973 973
     }
@@ -1023,7 +1023,7 @@  discard block
 block discarded – undo
1023 1023
 
1024 1024
         if ( ! isset($this->queryComponents[$identVariable])) {
1025 1025
             $this->semanticalError(
1026
-                'Identification Variable ' . $identVariable .' used in join path expression but was not defined before.'
1026
+                'Identification Variable '.$identVariable.' used in join path expression but was not defined before.'
1027 1027
             );
1028 1028
         }
1029 1029
 
@@ -1036,8 +1036,8 @@  discard block
 block discarded – undo
1036 1036
         $qComp = $this->queryComponents[$identVariable];
1037 1037
         $class = $qComp['metadata'];
1038 1038
 
1039
-        if (! (($property = $class->getProperty($field)) !== null && $property instanceof AssociationMetadata)) {
1040
-            $this->semanticalError('Class ' . $class->getClassName() . ' has no association named ' . $field);
1039
+        if ( ! (($property = $class->getProperty($field)) !== null && $property instanceof AssociationMetadata)) {
1040
+            $this->semanticalError('Class '.$class->getClassName().' has no association named '.$field);
1041 1041
         }
1042 1042
 
1043 1043
         return new AST\JoinAssociationPathExpression($identVariable, $field);
@@ -2459,7 +2459,7 @@  discard block
 block discarded – undo
2459 2459
         // Peek beyond the matching closing parenthesis ')'
2460 2460
         $peek = $this->peekBeyondClosingParenthesis();
2461 2461
 
2462
-        if (in_array($peek['value'], ["=",  "<", "<=", "<>", ">", ">=", "!="]) ||
2462
+        if (in_array($peek['value'], ["=", "<", "<=", "<>", ">", ">=", "!="]) ||
2463 2463
             in_array($peek['type'], [Lexer::T_NOT, Lexer::T_BETWEEN, Lexer::T_LIKE, Lexer::T_IN, Lexer::T_IS, Lexer::T_EXISTS]) ||
2464 2464
             $this->isMathOperator($peek)) {
2465 2465
             $condPrimary->simpleConditionalExpression = $this->SimpleConditionalExpression();
@@ -2564,7 +2564,7 @@  discard block
 block discarded – undo
2564 2564
             return $this->NullComparisonExpression();
2565 2565
         }
2566 2566
 
2567
-        if ($token['type'] === Lexer::T_IS  && $lookahead['type'] === Lexer::T_EMPTY) {
2567
+        if ($token['type'] === Lexer::T_IS && $lookahead['type'] === Lexer::T_EMPTY) {
2568 2568
             return $this->EmptyCollectionComparisonExpression();
2569 2569
         }
2570 2570
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/QueryExpressionVisitor.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query;
6 6
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             $expressionList[] = $this->dispatch($child);
100 100
         }
101 101
 
102
-        switch($expr->getType()) {
102
+        switch ($expr->getType()) {
103 103
             case CompositeExpression::TYPE_AND:
104 104
                 return new Expr\Andx($expressionList);
105 105
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                 return new Expr\Orx($expressionList);
108 108
 
109 109
             default:
110
-                throw new \RuntimeException("Unknown composite " . $expr->getType());
110
+                throw new \RuntimeException("Unknown composite ".$expr->getType());
111 111
         }
112 112
     }
113 113
 
@@ -121,10 +121,10 @@  discard block
 block discarded – undo
121 121
             throw new QueryException('No aliases are set before invoking walkComparison().');
122 122
         }
123 123
 
124
-        $field = $this->queryAliases[0] . '.' . $comparison->getField();
124
+        $field = $this->queryAliases[0].'.'.$comparison->getField();
125 125
 
126
-        foreach($this->queryAliases as $alias) {
127
-            if(strpos($comparison->getField() . '.', $alias . '.') === 0) {
126
+        foreach ($this->queryAliases as $alias) {
127
+            if (strpos($comparison->getField().'.', $alias.'.') === 0) {
128 128
                 $field = $comparison->getField();
129 129
                 break;
130 130
             }
@@ -135,13 +135,13 @@  discard block
 block discarded – undo
135 135
 
136 136
         foreach ($this->parameters as $parameter) {
137 137
             if ($parameter->getName() === $parameterName) {
138
-                $parameterName .= '_' . $parameterCount;
138
+                $parameterName .= '_'.$parameterCount;
139 139
                 break;
140 140
             }
141 141
         }
142 142
 
143 143
         $parameter = new Parameter($parameterName, $this->walkValue($comparison->getValue()));
144
-        $placeholder = ':' . $parameterName;
144
+        $placeholder = ':'.$parameterName;
145 145
 
146 146
         switch ($comparison->getOperator()) {
147 147
             case Comparison::IN:
@@ -168,17 +168,17 @@  discard block
 block discarded – undo
168 168
 
169 169
                 return $this->expr->neq($field, $placeholder);
170 170
             case Comparison::CONTAINS:
171
-                $parameter->setValue('%' . $parameter->getValue() . '%', $parameter->getType());
171
+                $parameter->setValue('%'.$parameter->getValue().'%', $parameter->getType());
172 172
                 $this->parameters[] = $parameter;
173 173
 
174 174
                 return $this->expr->like($field, $placeholder);
175 175
             case Comparison::STARTS_WITH:
176
-                $parameter->setValue($parameter->getValue() . '%', $parameter->getType());
176
+                $parameter->setValue($parameter->getValue().'%', $parameter->getType());
177 177
                 $this->parameters[] = $parameter;
178 178
 
179 179
                 return $this->expr->like($field, $placeholder);
180 180
             case Comparison::ENDS_WITH:
181
-                $parameter->setValue('%' . $parameter->getValue(), $parameter->getType());
181
+                $parameter->setValue('%'.$parameter->getValue(), $parameter->getType());
182 182
                 $this->parameters[] = $parameter;
183 183
 
184 184
                 return $this->expr->like($field, $placeholder);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                     );
195 195
                 }
196 196
 
197
-                throw new \RuntimeException("Unknown comparison operator: " . $comparison->getOperator());
197
+                throw new \RuntimeException("Unknown comparison operator: ".$comparison->getOperator());
198 198
         }
199 199
     }
200 200
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Query/SqlWalker.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Query;
6 6
 
@@ -273,10 +273,10 @@  discard block
 block discarded – undo
273 273
      */
274 274
     public function getSQLTableAlias($tableName, $dqlAlias = '')
275 275
     {
276
-        $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';
276
+        $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : '';
277 277
 
278
-        if (! isset($this->tableAliasMap[$tableName])) {
279
-            $this->tableAliasMap[$tableName] = 't' . $this->tableAliasCounter++;
278
+        if ( ! isset($this->tableAliasMap[$tableName])) {
279
+            $this->tableAliasMap[$tableName] = 't'.$this->tableAliasCounter++;
280 280
         }
281 281
 
282 282
         return $this->tableAliasMap[$tableName];
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
      */
295 295
     public function setSQLTableAlias($tableName, $alias, $dqlAlias = '')
296 296
     {
297
-        $tableName .= ($dqlAlias) ? '@[' . $dqlAlias . ']' : '';
297
+        $tableName .= ($dqlAlias) ? '@['.$dqlAlias.']' : '';
298 298
 
299 299
         $this->tableAliasMap[$tableName] = $alias;
300 300
 
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
      */
309 309
     public function getSQLColumnAlias()
310 310
     {
311
-        return $this->platform->getSQLResultCasing('c' . $this->aliasCounter++);
311
+        return $this->platform->getSQLResultCasing('c'.$this->aliasCounter++);
312 312
 
313 313
     }
314 314
 
@@ -336,14 +336,14 @@  discard block
 block discarded – undo
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
             // Add filters on the root class
@@ -365,14 +365,14 @@  discard block
 block discarded – undo
365 365
             $tableName  = $subClass->table->getQuotedQualifiedName($this->platform);
366 366
             $tableAlias = $this->getSQLTableAlias($subClass->getTableName(), $dqlAlias);
367 367
 
368
-            $sql .= ' LEFT JOIN ' . $tableName . ' ' . $tableAlias . ' ON ';
368
+            $sql .= ' LEFT JOIN '.$tableName.' '.$tableAlias.' ON ';
369 369
 
370 370
             $sqlParts = [];
371 371
 
372 372
             foreach ($subClass->getIdentifierColumns($this->em) as $column) {
373 373
                 $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName());
374 374
 
375
-                $sqlParts[] = $baseTableAlias . '.' . $quotedColumnName . ' = ' . $tableAlias . '.' . $quotedColumnName;
375
+                $sqlParts[] = $baseTableAlias.'.'.$quotedColumnName.' = '.$tableAlias.'.'.$quotedColumnName;
376 376
             }
377 377
 
378 378
             $sql .= implode(' AND ', $sqlParts);
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
             $qComp       = $this->queryComponents[$dqlAlias];
394 394
             $association = $qComp['relation'];
395 395
 
396
-            if (! ($association instanceof ToManyAssociationMetadata)) {
396
+            if ( ! ($association instanceof ToManyAssociationMetadata)) {
397 397
                 continue;
398 398
             }
399 399
 
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                 $property      = $qComp['metadata']->getProperty($fieldName);
402 402
                 $tableName     = $property->getTableName();
403 403
                 $columnName    = $this->platform->quoteIdentifier($property->getColumnName());
404
-                $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias) . '.' . $columnName;
404
+                $orderedColumn = $this->getSQLTableAlias($tableName, $dqlAlias).'.'.$columnName;
405 405
 
406 406
                 // OrderByClause should replace an ordered relation. see - DDC-2475
407 407
                 if (isset($this->orderedColumnsMap[$orderedColumn])) {
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
                 }
410 410
 
411 411
                 $this->orderedColumnsMap[$orderedColumn] = $orientation;
412
-                $orderedColumns[] = $orderedColumn . ' ' . $orientation;
412
+                $orderedColumns[] = $orderedColumn.' '.$orientation;
413 413
             }
414 414
         }
415 415
 
@@ -449,19 +449,19 @@  discard block
 block discarded – undo
449 449
             $discrColumnType  = $discrColumn->getType();
450 450
             $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName());
451 451
             $sqlTableAlias    = ($this->useSqlTableAliases)
452
-                ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.'
452
+                ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.'
453 453
                 : '';
454 454
 
455 455
             $sqlParts[] = sprintf(
456 456
                 '%s IN (%s)',
457
-                $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform),
457
+                $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform),
458 458
                 implode(', ', $values)
459 459
             );
460 460
         }
461 461
 
462 462
         $sql = implode(' AND ', $sqlParts);
463 463
 
464
-        return isset($sqlParts[1]) ? '(' . $sql . ')' : $sql;
464
+        return isset($sqlParts[1]) ? '('.$sql.')' : $sql;
465 465
     }
466 466
 
467 467
     /**
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
      */
475 475
     private function generateFilterConditionSQL(ClassMetadata $targetEntity, $targetTableAlias)
476 476
     {
477
-        if (! $this->em->hasFilters()) {
477
+        if ( ! $this->em->hasFilters()) {
478 478
             return '';
479 479
         }
480 480
 
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 
506 506
         foreach ($this->em->getFilters()->getEnabledFilters() as $filter) {
507 507
             if ('' !== $filterExpr = $filter->addFilterConstraint($targetEntity, $targetTableAlias)) {
508
-                $filterClauses[] = '(' . $filterExpr . ')';
508
+                $filterClauses[] = '('.$filterExpr.')';
509 509
             }
510 510
         }
511 511
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
         }
538 538
 
539 539
         if ( ! $AST->orderByClause && ($orderBySql = $this->generateOrderedCollectionOrderByItems())) {
540
-            $sql .= ' ORDER BY ' . $orderBySql;
540
+            $sql .= ' ORDER BY '.$orderBySql;
541 541
         }
542 542
 
543 543
         if ($limit !== null || $offset !== null) {
@@ -549,11 +549,11 @@  discard block
 block discarded – undo
549 549
         }
550 550
 
551 551
         if ($lockMode === LockMode::PESSIMISTIC_READ) {
552
-            return $sql . ' ' . $this->platform->getReadLockSQL();
552
+            return $sql.' '.$this->platform->getReadLockSQL();
553 553
         }
554 554
 
555 555
         if ($lockMode === LockMode::PESSIMISTIC_WRITE) {
556
-            return $sql . ' ' . $this->platform->getWriteLockSQL();
556
+            return $sql.' '.$this->platform->getWriteLockSQL();
557 557
         }
558 558
 
559 559
         if ($lockMode !== LockMode::OPTIMISTIC) {
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
         foreach ($class->getIdentifierColumns($this->em) as $column) {
611 611
             $quotedColumnName = $this->platform->quoteIdentifier($column->getColumnName());
612 612
 
613
-            $sqlParts[] = $tableAlias . '.' . $quotedColumnName;
613
+            $sqlParts[] = $tableAlias.'.'.$quotedColumnName;
614 614
         }
615 615
 
616 616
         return implode(', ', $sqlParts);
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
     {
629 629
         $class = $this->queryComponents[$identificationVariable]['metadata'];
630 630
 
631
-        if (!$fieldName) {
631
+        if ( ! $fieldName) {
632 632
             return $this->getSQLTableAlias($class->getTableName(), $identificationVariable);
633 633
         }
634 634
 
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                 $property  = $class->getProperty($fieldName);
658 658
 
659 659
                 if ($this->useSqlTableAliases) {
660
-                    $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName) . '.';
660
+                    $sql .= $this->walkIdentificationVariable($dqlAlias, $fieldName).'.';
661 661
                 }
662 662
 
663 663
                 $sql .= $this->platform->quoteIdentifier($property->getColumnName());
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
                 $class       = $this->queryComponents[$dqlAlias]['metadata'];
672 672
                 $association = $class->getProperty($fieldName);
673 673
 
674
-                if (! $association->isOwningSide()) {
674
+                if ( ! $association->isOwningSide()) {
675 675
                     throw QueryException::associationPathInverseSideNotSupported($pathExpr);
676 676
                 }
677 677
 
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
                 $joinColumn = reset($joinColumns);
686 686
 
687 687
                 if ($this->useSqlTableAliases) {
688
-                    $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias) . '.';
688
+                    $sql .= $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias).'.';
689 689
                 }
690 690
 
691 691
                 $sql .= $this->platform->quoteIdentifier($joinColumn->getColumnName());
@@ -703,7 +703,7 @@  discard block
 block discarded – undo
703 703
      */
704 704
     public function walkSelectClause($selectClause)
705 705
     {
706
-        $sql = 'SELECT ' . (($selectClause->isDistinct) ? 'DISTINCT ' : '');
706
+        $sql = 'SELECT '.(($selectClause->isDistinct) ? 'DISTINCT ' : '');
707 707
         $sqlSelectExpressions = array_filter(array_map([$this, 'walkSelectExpression'], $selectClause->selectExpressions));
708 708
 
709 709
         if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true && $selectClause->isDistinct) {
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 
745 745
                 $sqlSelectExpressions[] = sprintf(
746 746
                     '%s AS %s',
747
-                    $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . '.' . $quotedColumnName, $this->platform),
747
+                    $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.'.'.$quotedColumnName, $this->platform),
748 748
                     $sqlColumnAlias
749 749
                 );
750 750
 
@@ -754,13 +754,13 @@  discard block
 block discarded – undo
754 754
 
755 755
             // Add foreign key columns of class and also parent classes
756 756
             foreach ($class->getDeclaredPropertiesIterator() as $association) {
757
-                if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) {
757
+                if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) {
758 758
                     continue;
759
-                } else if (! $addMetaColumns && ! $association->isPrimaryKey()) {
759
+                } else if ( ! $addMetaColumns && ! $association->isPrimaryKey()) {
760 760
                     continue;
761 761
                 }
762 762
 
763
-                $targetClass  = $this->em->getClassMetadata($association->getTargetEntity());
763
+                $targetClass = $this->em->getClassMetadata($association->getTargetEntity());
764 764
 
765 765
                 foreach ($association->getJoinColumns() as $joinColumn) {
766 766
                     /** @var JoinColumnMetadata $joinColumn */
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
                     $columnAlias          = $this->getSQLColumnAlias();
771 771
                     $sqlTableAlias        = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias);
772 772
 
773
-                    if (! $joinColumn->getType()) {
773
+                    if ( ! $joinColumn->getType()) {
774 774
                         $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
775 775
                     }
776 776
 
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
                         continue;
801 801
                     }
802 802
 
803
-                    if (! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) {
803
+                    if ( ! ($association instanceof ToOneAssociationMetadata && $association->isOwningSide())) {
804 804
                         continue;
805 805
                     }
806 806
 
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
                         $columnAlias          = $this->getSQLColumnAlias();
815 815
                         $sqlTableAlias        = $this->getSQLTableAlias($joinColumn->getTableName(), $dqlAlias);
816 816
 
817
-                        if (! $joinColumn->getType()) {
817
+                        if ( ! $joinColumn->getType()) {
818 818
                             $joinColumn->setType(PersisterHelper::getTypeOfColumn($referencedColumnName, $targetClass, $this->em));
819 819
                         }
820 820
 
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
             $sqlParts[] = $this->walkIdentificationVariableDeclaration($identificationVariableDecl);
849 849
         }
850 850
 
851
-        return ' FROM ' . implode(', ', $sqlParts);
851
+        return ' FROM '.implode(', ', $sqlParts);
852 852
     }
853 853
 
854 854
     /**
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
         $tableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias);
916 916
 
917 917
         $sql = $this->platform->appendLockHint(
918
-            $tableName . ' ' . $tableAlias,
918
+            $tableName.' '.$tableAlias,
919 919
             $this->query->getHint(Query::HINT_LOCK_MODE)
920 920
         );
921 921
 
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
         ;
961 961
 
962 962
         if ($this->query->getHint(Query::HINT_INTERNAL_ITERATION) == true &&
963
-            (!$this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) {
963
+            ( ! $this->query->getHint(self::HINT_DISTINCT) || isset($this->selectedClasses[$joinedDqlAlias]))) {
964 964
             if ($association instanceof ToManyAssociationMetadata) {
965 965
                 throw QueryException::iterateWithFetchJoinNotAllowed($owningAssociation);
966 966
             }
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
             }
1015 1015
 
1016 1016
             $targetTableJoin = [
1017
-                'table' => $targetTableName . ' ' . $targetTableAlias,
1017
+                'table' => $targetTableName.' '.$targetTableAlias,
1018 1018
                 'condition' => implode(' AND ', $conditions),
1019 1019
             ];
1020 1020
         } else if ($owningAssociation instanceof ManyToManyAssociationMetadata) {
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
                 );
1043 1043
             }
1044 1044
 
1045
-            $sql .= $joinTableName . ' ' . $joinTableAlias . ' ON ' . implode(' AND ', $conditions);
1045
+            $sql .= $joinTableName.' '.$joinTableAlias.' ON '.implode(' AND ', $conditions);
1046 1046
 
1047 1047
             // Join target table
1048 1048
             $sql .= ($joinType == AST\Join::JOIN_TYPE_LEFT || $joinType == AST\Join::JOIN_TYPE_LEFTOUTER) ? ' LEFT JOIN ' : ' INNER JOIN ';
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
             }
1082 1082
 
1083 1083
             $targetTableJoin = [
1084
-                'table' => $targetTableName . ' ' . $targetTableAlias,
1084
+                'table' => $targetTableName.' '.$targetTableAlias,
1085 1085
                 'condition' => implode(' AND ', $conditions),
1086 1086
             ];
1087 1087
         } else {
@@ -1089,23 +1089,23 @@  discard block
 block discarded – undo
1089 1089
         }
1090 1090
 
1091 1091
         // Handle WITH clause
1092
-        $withCondition = (null === $condExpr) ? '' : ('(' . $this->walkConditionalExpression($condExpr) . ')');
1092
+        $withCondition = (null === $condExpr) ? '' : ('('.$this->walkConditionalExpression($condExpr).')');
1093 1093
 
1094 1094
         if ($targetClass->inheritanceType === InheritanceType::JOINED) {
1095 1095
             $ctiJoins = $this->generateClassTableInheritanceJoins($targetClass, $joinedDqlAlias);
1096 1096
 
1097 1097
             // If we have WITH condition, we need to build nested joins for target class table and cti joins
1098 1098
             if ($withCondition) {
1099
-                $sql .= '(' . $targetTableJoin['table'] . $ctiJoins . ') ON ' . $targetTableJoin['condition'];
1099
+                $sql .= '('.$targetTableJoin['table'].$ctiJoins.') ON '.$targetTableJoin['condition'];
1100 1100
             } else {
1101
-                $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'] . $ctiJoins;
1101
+                $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'].$ctiJoins;
1102 1102
             }
1103 1103
         } else {
1104
-            $sql .= $targetTableJoin['table'] . ' ON ' . $targetTableJoin['condition'];
1104
+            $sql .= $targetTableJoin['table'].' ON '.$targetTableJoin['condition'];
1105 1105
         }
1106 1106
 
1107 1107
         if ($withCondition) {
1108
-            $sql .= ' AND ' . $withCondition;
1108
+            $sql .= ' AND '.$withCondition;
1109 1109
         }
1110 1110
 
1111 1111
         // Apply the indexes
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
             $orderByItems = array_merge($orderByItems, (array) $collectionOrderByItems);
1139 1139
         }
1140 1140
 
1141
-        return ' ORDER BY ' . implode(', ', $orderByItems);
1141
+        return ' ORDER BY '.implode(', ', $orderByItems);
1142 1142
     }
1143 1143
 
1144 1144
     /**
@@ -1155,10 +1155,10 @@  discard block
 block discarded – undo
1155 1155
         $this->orderedColumnsMap[$sql] = $type;
1156 1156
 
1157 1157
         if ($expr instanceof AST\Subselect) {
1158
-            return '(' . $sql . ') ' . $type;
1158
+            return '('.$sql.') '.$type;
1159 1159
         }
1160 1160
 
1161
-        return $sql . ' ' . $type;
1161
+        return $sql.' '.$type;
1162 1162
     }
1163 1163
 
1164 1164
     /**
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
      */
1167 1167
     public function walkHavingClause($havingClause)
1168 1168
     {
1169
-        return ' HAVING ' . $this->walkConditionalExpression($havingClause->conditionalExpression);
1169
+        return ' HAVING '.$this->walkConditionalExpression($havingClause->conditionalExpression);
1170 1170
     }
1171 1171
 
1172 1172
     /**
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
                 $conditions = [];
1190 1190
 
1191 1191
                 if ($join->conditionalExpression) {
1192
-                    $conditions[] = '(' . $this->walkConditionalExpression($join->conditionalExpression) . ')';
1192
+                    $conditions[] = '('.$this->walkConditionalExpression($join->conditionalExpression).')';
1193 1193
                 }
1194 1194
 
1195 1195
                 $condExprConjunction = ($class->inheritanceType === InheritanceType::JOINED && $joinType !== AST\Join::JOIN_TYPE_LEFT && $joinType !== AST\Join::JOIN_TYPE_LEFTOUTER)
@@ -1213,7 +1213,7 @@  discard block
 block discarded – undo
1213 1213
                 }
1214 1214
 
1215 1215
                 if ($conditions) {
1216
-                    $sql .= $condExprConjunction . implode(' AND ', $conditions);
1216
+                    $sql .= $condExprConjunction.implode(' AND ', $conditions);
1217 1217
                 }
1218 1218
 
1219 1219
                 break;
@@ -1243,7 +1243,7 @@  discard block
 block discarded – undo
1243 1243
             $scalarExpressions[] = $this->walkSimpleArithmeticExpression($scalarExpression);
1244 1244
         }
1245 1245
 
1246
-        $sql .= implode(', ', $scalarExpressions) . ')';
1246
+        $sql .= implode(', ', $scalarExpressions).')';
1247 1247
 
1248 1248
         return $sql;
1249 1249
     }
@@ -1265,7 +1265,7 @@  discard block
 block discarded – undo
1265 1265
             ? $this->conn->quote($nullIfExpression->secondExpression)
1266 1266
             : $this->walkSimpleArithmeticExpression($nullIfExpression->secondExpression);
1267 1267
 
1268
-        return 'NULLIF(' . $firstExpression . ', ' . $secondExpression . ')';
1268
+        return 'NULLIF('.$firstExpression.', '.$secondExpression.')';
1269 1269
     }
1270 1270
 
1271 1271
     /**
@@ -1280,11 +1280,11 @@  discard block
 block discarded – undo
1280 1280
         $sql = 'CASE';
1281 1281
 
1282 1282
         foreach ($generalCaseExpression->whenClauses as $whenClause) {
1283
-            $sql .= ' WHEN ' . $this->walkConditionalExpression($whenClause->caseConditionExpression);
1284
-            $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression);
1283
+            $sql .= ' WHEN '.$this->walkConditionalExpression($whenClause->caseConditionExpression);
1284
+            $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($whenClause->thenScalarExpression);
1285 1285
         }
1286 1286
 
1287
-        $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression) . ' END';
1287
+        $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($generalCaseExpression->elseScalarExpression).' END';
1288 1288
 
1289 1289
         return $sql;
1290 1290
     }
@@ -1298,14 +1298,14 @@  discard block
 block discarded – undo
1298 1298
      */
1299 1299
     public function walkSimpleCaseExpression($simpleCaseExpression)
1300 1300
     {
1301
-        $sql = 'CASE ' . $this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand);
1301
+        $sql = 'CASE '.$this->walkStateFieldPathExpression($simpleCaseExpression->caseOperand);
1302 1302
 
1303 1303
         foreach ($simpleCaseExpression->simpleWhenClauses as $simpleWhenClause) {
1304
-            $sql .= ' WHEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression);
1305
-            $sql .= ' THEN ' . $this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression);
1304
+            $sql .= ' WHEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->caseScalarExpression);
1305
+            $sql .= ' THEN '.$this->walkSimpleArithmeticExpression($simpleWhenClause->thenScalarExpression);
1306 1306
         }
1307 1307
 
1308
-        $sql .= ' ELSE ' . $this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression) . ' END';
1308
+        $sql .= ' ELSE '.$this->walkSimpleArithmeticExpression($simpleCaseExpression->elseScalarExpression).' END';
1309 1309
 
1310 1310
         return $sql;
1311 1311
     }
@@ -1367,7 +1367,7 @@  discard block
 block discarded – undo
1367 1367
                 $columnAlias = $this->getSQLColumnAlias();
1368 1368
                 $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++;
1369 1369
 
1370
-                $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias;
1370
+                $sql .= $expr->dispatch($this).' AS '.$columnAlias;
1371 1371
 
1372 1372
                 $this->scalarResultAliasMap[$resultAlias] = $columnAlias;
1373 1373
 
@@ -1382,7 +1382,7 @@  discard block
 block discarded – undo
1382 1382
                 $columnAlias = $this->getSQLColumnAlias();
1383 1383
                 $resultAlias = $selectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++;
1384 1384
 
1385
-                $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias;
1385
+                $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias;
1386 1386
 
1387 1387
                 $this->scalarResultAliasMap[$resultAlias] = $columnAlias;
1388 1388
 
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
                 break;
1394 1394
 
1395 1395
             case ($expr instanceof AST\NewObjectExpression):
1396
-                $sql .= $this->walkNewObject($expr,$selectExpression->fieldIdentificationVariable);
1396
+                $sql .= $this->walkNewObject($expr, $selectExpression->fieldIdentificationVariable);
1397 1397
                 break;
1398 1398
 
1399 1399
             default:
@@ -1422,7 +1422,7 @@  discard block
 block discarded – undo
1422 1422
 
1423 1423
                 // Select all fields from the queried class
1424 1424
                 foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
1425
-                    if (! ($property instanceof FieldMetadata)) {
1425
+                    if ( ! ($property instanceof FieldMetadata)) {
1426 1426
                         continue;
1427 1427
                     }
1428 1428
 
@@ -1457,11 +1457,11 @@  discard block
 block discarded – undo
1457 1457
                         $subClass = $this->em->getClassMetadata($subClassName);
1458 1458
 
1459 1459
                         foreach ($subClass->getDeclaredPropertiesIterator() as $fieldName => $property) {
1460
-                            if (! ($property instanceof FieldMetadata)) {
1460
+                            if ( ! ($property instanceof FieldMetadata)) {
1461 1461
                                 continue;
1462 1462
                             }
1463 1463
 
1464
-                            if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && !in_array($fieldName, $partialFieldSet))) {
1464
+                            if ($subClass->isInheritedProperty($fieldName) || ($partialFieldSet && ! in_array($fieldName, $partialFieldSet))) {
1465 1465
                                 continue;
1466 1466
                             }
1467 1467
 
@@ -1496,7 +1496,7 @@  discard block
 block discarded – undo
1496 1496
      */
1497 1497
     public function walkQuantifiedExpression($qExpr)
1498 1498
     {
1499
-        return ' ' . strtoupper($qExpr->type) . '(' . $this->walkSubselect($qExpr->subselect) . ')';
1499
+        return ' '.strtoupper($qExpr->type).'('.$this->walkSubselect($qExpr->subselect).')';
1500 1500
     }
1501 1501
 
1502 1502
     /**
@@ -1536,7 +1536,7 @@  discard block
 block discarded – undo
1536 1536
             $sqlParts[] = $this->walkIdentificationVariableDeclaration($subselectIdVarDecl);
1537 1537
         }
1538 1538
 
1539
-        return ' FROM ' . implode(', ', $sqlParts);
1539
+        return ' FROM '.implode(', ', $sqlParts);
1540 1540
     }
1541 1541
 
1542 1542
     /**
@@ -1544,7 +1544,7 @@  discard block
 block discarded – undo
1544 1544
      */
1545 1545
     public function walkSimpleSelectClause($simpleSelectClause)
1546 1546
     {
1547
-        return 'SELECT' . ($simpleSelectClause->isDistinct ? ' DISTINCT' : '')
1547
+        return 'SELECT'.($simpleSelectClause->isDistinct ? ' DISTINCT' : '')
1548 1548
             . $this->walkSimpleSelectExpression($simpleSelectClause->simpleSelectExpression);
1549 1549
     }
1550 1550
 
@@ -1563,10 +1563,10 @@  discard block
 block discarded – undo
1563 1563
      * @param null|string               $newObjectResultAlias
1564 1564
      * @return string The SQL.
1565 1565
      */
1566
-    public function walkNewObject($newObjectExpression, $newObjectResultAlias=null)
1566
+    public function walkNewObject($newObjectExpression, $newObjectResultAlias = null)
1567 1567
     {
1568 1568
         $sqlSelectExpressions = [];
1569
-        $objIndex             = $newObjectResultAlias?:$this->newObjectCounter++;
1569
+        $objIndex             = $newObjectResultAlias ?: $this->newObjectCounter++;
1570 1570
 
1571 1571
         foreach ($newObjectExpression->args as $argIndex => $e) {
1572 1572
             $resultAlias = $this->scalarResultCounter++;
@@ -1579,7 +1579,7 @@  discard block
 block discarded – undo
1579 1579
                     break;
1580 1580
 
1581 1581
                 case ($e instanceof AST\Subselect):
1582
-                    $sqlSelectExpressions[] = '(' . $e->dispatch($this) . ') AS ' . $columnAlias;
1582
+                    $sqlSelectExpressions[] = '('.$e->dispatch($this).') AS '.$columnAlias;
1583 1583
                     break;
1584 1584
 
1585 1585
                 case ($e instanceof AST\PathExpression):
@@ -1588,7 +1588,7 @@  discard block
 block discarded – undo
1588 1588
                     $class     = $qComp['metadata'];
1589 1589
                     $fieldType = $class->getProperty($e->field)->getType();
1590 1590
 
1591
-                    $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias;
1591
+                    $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias;
1592 1592
                     break;
1593 1593
 
1594 1594
                 case ($e instanceof AST\Literal):
@@ -1602,11 +1602,11 @@  discard block
 block discarded – undo
1602 1602
                             break;
1603 1603
                     }
1604 1604
 
1605
-                    $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias;
1605
+                    $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias;
1606 1606
                     break;
1607 1607
 
1608 1608
                 default:
1609
-                    $sqlSelectExpressions[] = trim((string) $e->dispatch($this)) . ' AS ' . $columnAlias;
1609
+                    $sqlSelectExpressions[] = trim((string) $e->dispatch($this)).' AS '.$columnAlias;
1610 1610
                     break;
1611 1611
             }
1612 1612
 
@@ -1639,10 +1639,10 @@  discard block
 block discarded – undo
1639 1639
             case ($expr instanceof AST\Subselect):
1640 1640
                 $alias = $simpleSelectExpression->fieldIdentificationVariable ?: $this->scalarResultCounter++;
1641 1641
 
1642
-                $columnAlias = 'sclr' . $this->aliasCounter++;
1642
+                $columnAlias = 'sclr'.$this->aliasCounter++;
1643 1643
                 $this->scalarResultAliasMap[$alias] = $columnAlias;
1644 1644
 
1645
-                $sql .= '(' . $this->walkSubselect($expr) . ') AS ' . $columnAlias;
1645
+                $sql .= '('.$this->walkSubselect($expr).') AS '.$columnAlias;
1646 1646
                 break;
1647 1647
 
1648 1648
             case ($expr instanceof AST\Functions\FunctionNode):
@@ -1659,7 +1659,7 @@  discard block
 block discarded – undo
1659 1659
                 $columnAlias = $this->getSQLColumnAlias();
1660 1660
                 $this->scalarResultAliasMap[$alias] = $columnAlias;
1661 1661
 
1662
-                $sql .= $expr->dispatch($this) . ' AS ' . $columnAlias;
1662
+                $sql .= $expr->dispatch($this).' AS '.$columnAlias;
1663 1663
                 break;
1664 1664
 
1665 1665
             case ($expr instanceof AST\ParenthesisExpression):
@@ -1679,8 +1679,8 @@  discard block
 block discarded – undo
1679 1679
      */
1680 1680
     public function walkAggregateExpression($aggExpression)
1681 1681
     {
1682
-        return $aggExpression->functionName . '(' . ($aggExpression->isDistinct ? 'DISTINCT ' : '')
1683
-            . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression) . ')';
1682
+        return $aggExpression->functionName.'('.($aggExpression->isDistinct ? 'DISTINCT ' : '')
1683
+            . $this->walkSimpleArithmeticExpression($aggExpression->pathExpression).')';
1684 1684
     }
1685 1685
 
1686 1686
     /**
@@ -1694,7 +1694,7 @@  discard block
 block discarded – undo
1694 1694
             $sqlParts[] = $this->walkGroupByItem($groupByItem);
1695 1695
         }
1696 1696
 
1697
-        return ' GROUP BY ' . implode(', ', $sqlParts);
1697
+        return ' GROUP BY '.implode(', ', $sqlParts);
1698 1698
     }
1699 1699
 
1700 1700
     /**
@@ -1757,7 +1757,7 @@  discard block
 block discarded – undo
1757 1757
     {
1758 1758
         $class     = $this->em->getClassMetadata($deleteClause->abstractSchemaName);
1759 1759
         $tableName = $class->getTableName();
1760
-        $sql       = 'DELETE FROM ' . $class->table->getQuotedQualifiedName($this->platform);
1760
+        $sql       = 'DELETE FROM '.$class->table->getQuotedQualifiedName($this->platform);
1761 1761
 
1762 1762
         $this->setSQLTableAlias($tableName, $tableName, $deleteClause->aliasIdentificationVariable);
1763 1763
 
@@ -1773,12 +1773,12 @@  discard block
 block discarded – undo
1773 1773
     {
1774 1774
         $class     = $this->em->getClassMetadata($updateClause->abstractSchemaName);
1775 1775
         $tableName = $class->getTableName();
1776
-        $sql       = 'UPDATE ' . $class->table->getQuotedQualifiedName($this->platform);
1776
+        $sql       = 'UPDATE '.$class->table->getQuotedQualifiedName($this->platform);
1777 1777
 
1778 1778
         $this->setSQLTableAlias($tableName, $tableName, $updateClause->aliasIdentificationVariable);
1779 1779
         $this->rootAliases[] = $updateClause->aliasIdentificationVariable;
1780 1780
 
1781
-        $sql .= ' SET ' . implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems));
1781
+        $sql .= ' SET '.implode(', ', array_map([$this, 'walkUpdateItem'], $updateClause->updateItems));
1782 1782
 
1783 1783
         return $sql;
1784 1784
     }
@@ -1791,7 +1791,7 @@  discard block
 block discarded – undo
1791 1791
         $useTableAliasesBefore = $this->useSqlTableAliases;
1792 1792
         $this->useSqlTableAliases = false;
1793 1793
 
1794
-        $sql      = $this->walkPathExpression($updateItem->pathExpression) . ' = ';
1794
+        $sql      = $this->walkPathExpression($updateItem->pathExpression).' = ';
1795 1795
         $newValue = $updateItem->newValue;
1796 1796
 
1797 1797
         switch (true) {
@@ -1834,7 +1834,7 @@  discard block
 block discarded – undo
1834 1834
 
1835 1835
             if ($filterClauses) {
1836 1836
                 if ($condSql) {
1837
-                    $condSql = '(' . $condSql . ') AND ';
1837
+                    $condSql = '('.$condSql.') AND ';
1838 1838
                 }
1839 1839
 
1840 1840
                 $condSql .= implode(' AND ', $filterClauses);
@@ -1842,11 +1842,11 @@  discard block
 block discarded – undo
1842 1842
         }
1843 1843
 
1844 1844
         if ($condSql) {
1845
-            return ' WHERE ' . (( ! $discrSql) ? $condSql : '(' . $condSql . ') AND ' . $discrSql);
1845
+            return ' WHERE '.(( ! $discrSql) ? $condSql : '('.$condSql.') AND '.$discrSql);
1846 1846
         }
1847 1847
 
1848 1848
         if ($discrSql) {
1849
-            return ' WHERE ' . $discrSql;
1849
+            return ' WHERE '.$discrSql;
1850 1850
         }
1851 1851
 
1852 1852
         return '';
@@ -1889,7 +1889,7 @@  discard block
 block discarded – undo
1889 1889
         // if only one ConditionalPrimary is defined
1890 1890
         return ( ! ($factor instanceof AST\ConditionalFactor))
1891 1891
             ? $this->walkConditionalPrimary($factor)
1892
-            : ($factor->not ? 'NOT ' : '') . $this->walkConditionalPrimary($factor->conditionalPrimary);
1892
+            : ($factor->not ? 'NOT ' : '').$this->walkConditionalPrimary($factor->conditionalPrimary);
1893 1893
     }
1894 1894
 
1895 1895
     /**
@@ -1904,7 +1904,7 @@  discard block
 block discarded – undo
1904 1904
         if ($primary->isConditionalExpression()) {
1905 1905
             $condExpr = $primary->conditionalExpression;
1906 1906
 
1907
-            return '(' . $this->walkConditionalExpression($condExpr) . ')';
1907
+            return '('.$this->walkConditionalExpression($condExpr).')';
1908 1908
         }
1909 1909
     }
1910 1910
 
@@ -1915,7 +1915,7 @@  discard block
 block discarded – undo
1915 1915
     {
1916 1916
         $sql = ($existsExpr->not) ? 'NOT ' : '';
1917 1917
 
1918
-        $sql .= 'EXISTS (' . $this->walkSubselect($existsExpr->subselect) . ')';
1918
+        $sql .= 'EXISTS ('.$this->walkSubselect($existsExpr->subselect).')';
1919 1919
 
1920 1920
         return $sql;
1921 1921
     }
@@ -1964,7 +1964,7 @@  discard block
 block discarded – undo
1964 1964
             $targetTableAlias = $this->getSQLTableAlias($targetClass->getTableName());
1965 1965
             $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias);
1966 1966
 
1967
-            $sql .= $targetTableName . ' ' . $targetTableAlias . ' WHERE ';
1967
+            $sql .= $targetTableName.' '.$targetTableAlias.' WHERE ';
1968 1968
 
1969 1969
             $sqlParts = [];
1970 1970
 
@@ -1985,7 +1985,7 @@  discard block
 block discarded – undo
1985 1985
                     $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++);
1986 1986
                 }
1987 1987
 
1988
-                $sqlParts[] = $targetTableAlias . '.'  . $quotedTargetColumnName . ' = ' . $entitySql;
1988
+                $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql;
1989 1989
             }
1990 1990
 
1991 1991
             $sql .= implode(' AND ', $sqlParts);
@@ -1999,7 +1999,7 @@  discard block
 block discarded – undo
1999 1999
             $sourceTableAlias = $this->getSQLTableAlias($class->getTableName(), $dqlAlias);
2000 2000
 
2001 2001
             // join to target table
2002
-            $sql .= $joinTableName . ' ' . $joinTableAlias . ' INNER JOIN ' . $targetTableName . ' ' . $targetTableAlias . ' ON ';
2002
+            $sql .= $joinTableName.' '.$joinTableAlias.' INNER JOIN '.$targetTableName.' '.$targetTableAlias.' ON ';
2003 2003
 
2004 2004
             // join conditions
2005 2005
             $joinSqlParts = [];
@@ -2050,13 +2050,13 @@  discard block
 block discarded – undo
2050 2050
                     $this->parserResult->addParameterMapping($dqlParamKey, $this->sqlParamIndex++);
2051 2051
                 }
2052 2052
 
2053
-                $sqlParts[] = $targetTableAlias . '.' . $quotedTargetColumnName . ' = ' . $entitySql;
2053
+                $sqlParts[] = $targetTableAlias.'.'.$quotedTargetColumnName.' = '.$entitySql;
2054 2054
             }
2055 2055
 
2056 2056
             $sql .= implode(' AND ', $sqlParts);
2057 2057
         }
2058 2058
 
2059
-        return $sql . ')';
2059
+        return $sql.')';
2060 2060
     }
2061 2061
 
2062 2062
     /**
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
         $sizeFunc = new AST\Functions\SizeFunction('size');
2068 2068
         $sizeFunc->collectionPathExpression = $emptyCollCompExpr->expression;
2069 2069
 
2070
-        return $sizeFunc->getSql($this) . ($emptyCollCompExpr->not ? ' > 0' : ' = 0');
2070
+        return $sizeFunc->getSql($this).($emptyCollCompExpr->not ? ' > 0' : ' = 0');
2071 2071
     }
2072 2072
 
2073 2073
     /**
@@ -2076,19 +2076,19 @@  discard block
 block discarded – undo
2076 2076
     public function walkNullComparisonExpression($nullCompExpr)
2077 2077
     {
2078 2078
         $expression = $nullCompExpr->expression;
2079
-        $comparison = ' IS' . ($nullCompExpr->not ? ' NOT' : '') . ' NULL';
2079
+        $comparison = ' IS'.($nullCompExpr->not ? ' NOT' : '').' NULL';
2080 2080
 
2081 2081
         // Handle ResultVariable
2082 2082
         if (is_string($expression) && isset($this->queryComponents[$expression]['resultVariable'])) {
2083
-            return $this->walkResultVariable($expression) . $comparison;
2083
+            return $this->walkResultVariable($expression).$comparison;
2084 2084
         }
2085 2085
 
2086 2086
         // Handle InputParameter mapping inclusion to ParserResult
2087 2087
         if ($expression instanceof AST\InputParameter) {
2088
-            return $this->walkInputParameter($expression) . $comparison;
2088
+            return $this->walkInputParameter($expression).$comparison;
2089 2089
         }
2090 2090
 
2091
-        return $expression->dispatch($this) . $comparison;
2091
+        return $expression->dispatch($this).$comparison;
2092 2092
     }
2093 2093
 
2094 2094
     /**
@@ -2096,7 +2096,7 @@  discard block
 block discarded – undo
2096 2096
      */
2097 2097
     public function walkInExpression($inExpr)
2098 2098
     {
2099
-        $sql = $this->walkArithmeticExpression($inExpr->expression) . ($inExpr->not ? ' NOT' : '') . ' IN (';
2099
+        $sql = $this->walkArithmeticExpression($inExpr->expression).($inExpr->not ? ' NOT' : '').' IN (';
2100 2100
 
2101 2101
         $sql .= ($inExpr->subselect)
2102 2102
             ? $this->walkSubselect($inExpr->subselect)
@@ -2119,7 +2119,7 @@  discard block
 block discarded – undo
2119 2119
         $discrColumnType  = $discrColumn->getType();
2120 2120
         $quotedColumnName = $this->platform->quoteIdentifier($discrColumn->getColumnName());
2121 2121
         $sqlTableAlias    = $this->useSqlTableAliases
2122
-            ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias) . '.'
2122
+            ? $this->getSQLTableAlias($discrColumn->getTableName(), $dqlAlias).'.'
2123 2123
             : '';
2124 2124
 
2125 2125
         $sqlParameterList = [];
@@ -2149,7 +2149,7 @@  discard block
 block discarded – undo
2149 2149
 
2150 2150
         return sprintf(
2151 2151
             '%s %sIN (%s)',
2152
-            $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias . $quotedColumnName, $this->platform),
2152
+            $discrColumnType->convertToDatabaseValueSQL($sqlTableAlias.$quotedColumnName, $this->platform),
2153 2153
             ($instanceOfExpr->not ? 'NOT ' : ''),
2154 2154
             implode(', ', $sqlParameterList)
2155 2155
         );
@@ -2196,8 +2196,8 @@  discard block
 block discarded – undo
2196 2196
             $sql .= ' NOT';
2197 2197
         }
2198 2198
 
2199
-        $sql .= ' BETWEEN ' . $this->walkArithmeticExpression($betweenExpr->leftBetweenExpression)
2200
-            . ' AND ' . $this->walkArithmeticExpression($betweenExpr->rightBetweenExpression);
2199
+        $sql .= ' BETWEEN '.$this->walkArithmeticExpression($betweenExpr->leftBetweenExpression)
2200
+            . ' AND '.$this->walkArithmeticExpression($betweenExpr->rightBetweenExpression);
2201 2201
 
2202 2202
         return $sql;
2203 2203
     }
@@ -2212,7 +2212,7 @@  discard block
 block discarded – undo
2212 2212
             ? $this->walkResultVariable($stringExpr)
2213 2213
             : $stringExpr->dispatch($this);
2214 2214
 
2215
-        $sql = $leftExpr . ($likeExpr->not ? ' NOT' : '') . ' LIKE ';
2215
+        $sql = $leftExpr.($likeExpr->not ? ' NOT' : '').' LIKE ';
2216 2216
 
2217 2217
         if ($likeExpr->stringPattern instanceof AST\InputParameter) {
2218 2218
             $sql .= $this->walkInputParameter($likeExpr->stringPattern);
@@ -2225,7 +2225,7 @@  discard block
 block discarded – undo
2225 2225
         }
2226 2226
 
2227 2227
         if ($likeExpr->escapeChar) {
2228
-            $sql .= ' ESCAPE ' . $this->walkLiteral($likeExpr->escapeChar);
2228
+            $sql .= ' ESCAPE '.$this->walkLiteral($likeExpr->escapeChar);
2229 2229
         }
2230 2230
 
2231 2231
         return $sql;
@@ -2252,7 +2252,7 @@  discard block
 block discarded – undo
2252 2252
             ? $leftExpr->dispatch($this)
2253 2253
             : (is_numeric($leftExpr) ? $leftExpr : $this->conn->quote($leftExpr));
2254 2254
 
2255
-        $sql .= ' ' . $compExpr->operator . ' ';
2255
+        $sql .= ' '.$compExpr->operator.' ';
2256 2256
 
2257 2257
         $sql .= ($rightExpr instanceof AST\Node)
2258 2258
             ? $rightExpr->dispatch($this)
@@ -2284,7 +2284,7 @@  discard block
 block discarded – undo
2284 2284
     {
2285 2285
         return ($arithmeticExpr->isSimpleArithmeticExpression())
2286 2286
             ? $this->walkSimpleArithmeticExpression($arithmeticExpr->simpleArithmeticExpression)
2287
-            : '(' . $this->walkSubselect($arithmeticExpr->subselect) . ')';
2287
+            : '('.$this->walkSubselect($arithmeticExpr->subselect).')';
2288 2288
     }
2289 2289
 
2290 2290
     /**
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
 
2339 2339
         $sign = $factor->isNegativeSigned() ? '-' : ($factor->isPositiveSigned() ? '+' : '');
2340 2340
 
2341
-        return $sign . $this->walkArithmeticPrimary($factor->arithmeticPrimary);
2341
+        return $sign.$this->walkArithmeticPrimary($factor->arithmeticPrimary);
2342 2342
     }
2343 2343
 
2344 2344
     /**
@@ -2351,7 +2351,7 @@  discard block
 block discarded – undo
2351 2351
     public function walkArithmeticPrimary($primary)
2352 2352
     {
2353 2353
         if ($primary instanceof AST\SimpleArithmeticExpression) {
2354
-            return '(' . $this->walkSimpleArithmeticExpression($primary) . ')';
2354
+            return '('.$this->walkSimpleArithmeticExpression($primary).')';
2355 2355
         }
2356 2356
 
2357 2357
         if ($primary instanceof AST\Node) {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
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
 
@@ -88,9 +88,9 @@  discard block
 block discarded – undo
88 88
     protected function onNotFoundMetadata(
89 89
         string $className,
90 90
         ClassMetadataBuildingContext $metadataBuildingContext
91
-    ) : ?ClassMetadata
91
+    ) : ? ClassMetadata
92 92
     {
93
-        if (! $this->evm->hasListeners(Events::onClassMetadataNotFound)) {
93
+        if ( ! $this->evm->hasListeners(Events::onClassMetadataNotFound)) {
94 94
             return null;
95 95
         }
96 96
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     protected function doLoadMetadata(
111 111
         string $className,
112
-        ?ClassMetadata $parent,
112
+        ? ClassMetadata $parent,
113 113
         ClassMetadataBuildingContext $metadataBuildingContext
114 114
     ) : ClassMetadata
115 115
     {
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
             }
175 175
         }
176 176
 
177
-        if (! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) {
177
+        if ( ! $classMetadata->discriminatorMap && $classMetadata->inheritanceType !== InheritanceType::NONE && $classMetadata->isRootEntity()) {
178 178
             $this->addDefaultDiscriminatorMap($classMetadata);
179 179
         }
180 180
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      */
201 201
     protected function completeRuntimeMetadata(ClassMetadata $class, ClassMetadata $parent = null) : void
202 202
     {
203
-        if (! $parent || ! $parent->isMappedSuperclass) {
203
+        if ( ! $parent || ! $parent->isMappedSuperclass) {
204 204
             return;
205 205
         }
206 206
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                 continue;
219 219
             }
220 220
 
221
-            if (! ($property instanceof ToOneAssociationMetadata)) {
221
+            if ( ! ($property instanceof ToOneAssociationMetadata)) {
222 222
                 continue;
223 223
             }
224 224
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
      */
243 243
     protected function validateRuntimeMetadata(ClassMetadata $class, ClassMetadata $parent = null) : void
244 244
     {
245
-        if (! $class->getReflectionClass()) {
245
+        if ( ! $class->getReflectionClass()) {
246 246
             // only validate if there is a reflection class instance
247 247
             return;
248 248
         }
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
         // verify inheritance
255 255
         if ( ! $class->isMappedSuperclass && $class->inheritanceType !== InheritanceType::NONE) {
256 256
             if ( ! $parent) {
257
-                if (! $class->discriminatorMap) {
257
+                if ( ! $class->discriminatorMap) {
258 258
                     throw MappingException::missingDiscriminatorMap($class->getClassName());
259 259
                 }
260 260
 
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 
548 548
     private function completeFieldIdentifierGeneratorMapping(FieldMetadata $field)
549 549
     {
550
-        if (!$field->hasValueGenerator()) {
550
+        if ( ! $field->hasValueGenerator()) {
551 551
             return;
552 552
         }
553 553
 
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
                 break;
615 615
 
616 616
             default:
617
-                throw new ORMException("Unknown generator type: " . $generator->getType());
617
+                throw new ORMException("Unknown generator type: ".$generator->getType());
618 618
         }
619 619
     }
620 620
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
      */
624 624
     protected function getFqcnFromAlias($namespaceAlias, $simpleClassName) : string
625 625
     {
626
-        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias) . '\\' . $simpleClassName;
626
+        return $this->em->getConfiguration()->getEntityNamespace($namespaceAlias).'\\'.$simpleClassName;
627 627
     }
628 628
 
629 629
     /**
@@ -647,7 +647,7 @@  discard block
 block discarded – undo
647 647
      */
648 648
     private function getTargetPlatform() : Platforms\AbstractPlatform
649 649
     {
650
-        if (!$this->targetPlatform) {
650
+        if ( ! $this->targetPlatform) {
651 651
             $this->targetPlatform = $this->em->getConnection()->getDatabasePlatform();
652 652
         }
653 653
 
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         $generatedProperties = [];
666 666
 
667 667
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
668
-            if (! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) {
668
+            if ( ! ($property instanceof LocalColumnMetadata && $property->hasValueGenerator())) {
669 669
                 continue;
670 670
             }
671 671
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/QueryBuilder.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM;
6 6
 
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
     public function setParameter($key, $value, $type = null)
519 519
     {
520 520
         $filteredParameters = $this->parameters->filter(
521
-            function ($parameter) use ($key)
521
+            function($parameter) use ($key)
522 522
             {
523 523
                 /* @var Query\Parameter $parameter */
524 524
                 // Must not be identical because of string to integer conversion
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
             }
527 527
         );
528 528
 
529
-        if (! $filteredParameters->isEmpty()) {
529
+        if ( ! $filteredParameters->isEmpty()) {
530 530
             /* @var Query\Parameter $parameter */
531 531
             $parameter = $filteredParameters->first();
532 532
             $parameter->setValue($value, $type);
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
     public function getParameter($key)
600 600
     {
601 601
         $filteredParameters = $this->parameters->filter(
602
-            function ($parameter) use ($key)
602
+            function($parameter) use ($key)
603 603
             {
604 604
                 /* @var Query\Parameter $parameter */
605 605
                 // Must not be identical because of string to integer conversion
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
         }
683 683
 
684 684
         $isMultiple = is_array($this->dqlParts[$dqlPartName])
685
-            && !($dqlPartName == 'join' && !$append);
685
+            && ! ($dqlPartName == 'join' && ! $append);
686 686
 
687 687
         // Allow adding any part retrieved from self::getDQLParts().
688 688
         if (is_array($dqlPart) && $dqlPartName != 'join') {
@@ -899,7 +899,7 @@  discard block
 block discarded – undo
899 899
     {
900 900
         $rootAliases = $this->getRootAliases();
901 901
 
902
-        if (!in_array($alias, $rootAliases)) {
902
+        if ( ! in_array($alias, $rootAliases)) {
903 903
             throw new Query\QueryException(
904 904
                 sprintf('Specified root alias %s must be set before invoking indexBy().', $alias)
905 905
             );
@@ -1301,15 +1301,15 @@  discard block
 block discarded – undo
1301 1301
             foreach ($criteria->getOrderings() as $sort => $order) {
1302 1302
 
1303 1303
                 $hasValidAlias = false;
1304
-                foreach($allAliases as $alias) {
1305
-                    if(strpos($sort . '.', $alias . '.') === 0) {
1304
+                foreach ($allAliases as $alias) {
1305
+                    if (strpos($sort.'.', $alias.'.') === 0) {
1306 1306
                         $hasValidAlias = true;
1307 1307
                         break;
1308 1308
                     }
1309 1309
                 }
1310 1310
 
1311
-                if(!$hasValidAlias) {
1312
-                    $sort = $allAliases[0] . '.' . $sort;
1311
+                if ( ! $hasValidAlias) {
1312
+                    $sort = $allAliases[0].'.'.$sort;
1313 1313
                 }
1314 1314
 
1315 1315
                 $this->addOrderBy($sort, $order);
@@ -1382,7 +1382,7 @@  discard block
 block discarded – undo
1382 1382
     private function getDQLForSelect()
1383 1383
     {
1384 1384
         $dql = 'SELECT'
1385
-             . ($this->dqlParts['distinct']===true ? ' DISTINCT' : '')
1385
+             . ($this->dqlParts['distinct'] === true ? ' DISTINCT' : '')
1386 1386
              . $this->getReducedDQLQueryPart('select', ['pre' => ' ', 'separator' => ', ']);
1387 1387
 
1388 1388
         $fromParts   = $this->getDQLPart('from');
@@ -1398,7 +1398,7 @@  discard block
 block discarded – undo
1398 1398
 
1399 1399
                 if ($from instanceof Expr\From && isset($joinParts[$from->getAlias()])) {
1400 1400
                     foreach ($joinParts[$from->getAlias()] as $join) {
1401
-                        $fromClause .= ' ' . ((string) $join);
1401
+                        $fromClause .= ' '.((string) $join);
1402 1402
                     }
1403 1403
                 }
1404 1404
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\ORM\Internal\Hydration;
6 6
 
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     protected function prepare()
70 70
     {
71
-        if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) {
71
+        if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) {
72 72
             $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true;
73 73
         }
74 74
 
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 
79 79
             // Remember which associations are "fetch joined", so that we know where to inject
80 80
             // collection stubs or proxies and where not.
81
-            if (! isset($this->rsm->relationMap[$dqlAlias])) {
81
+            if ( ! isset($this->rsm->relationMap[$dqlAlias])) {
82 82
                 continue;
83 83
             }
84 84
 
85 85
             $parent = $this->rsm->parentAliasMap[$dqlAlias];
86 86
 
87
-            if (! isset($this->rsm->aliasMap[$parent])) {
87
+            if ( ! isset($this->rsm->aliasMap[$parent])) {
88 88
                 throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent);
89 89
             }
90 90
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
                 $class        = $this->getClassMetadata($className);
111 111
                 $inverseAssoc = $class->getProperty($association->getInversedBy());
112 112
 
113
-                if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) {
113
+                if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) {
114 114
                     continue;
115 115
                 }
116 116
 
@@ -176,14 +176,14 @@  discard block
 block discarded – undo
176 176
         $value       = $association->getValue($entity);
177 177
         $oid         = spl_object_hash($entity);
178 178
 
179
-        if (! $value instanceof PersistentCollection) {
179
+        if ( ! $value instanceof PersistentCollection) {
180 180
             $value = $association->wrap($entity, $value, $this->em);
181 181
 
182 182
             $association->setValue($entity, $value);
183 183
 
184 184
             $this->uow->setOriginalEntityProperty($oid, $fieldName, $value);
185 185
 
186
-            $this->initializedCollections[$oid . $fieldName] = $value;
186
+            $this->initializedCollections[$oid.$fieldName] = $value;
187 187
         } else if (
188 188
             isset($this->hints[Query::HINT_REFRESH]) ||
189 189
             (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized())
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
             $value->setInitialized(true);
194 194
             $value->unwrap()->clear();
195 195
 
196
-            $this->initializedCollections[$oid . $fieldName] = $value;
196
+            $this->initializedCollections[$oid.$fieldName] = $value;
197 197
         } else {
198 198
             // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN!
199
-            $this->existingCollections[$oid . $fieldName] = $value;
199
+            $this->existingCollections[$oid.$fieldName] = $value;
200 200
         }
201 201
 
202 202
         return $value;
@@ -314,10 +314,10 @@  discard block
 block discarded – undo
314 314
                 $parentAlias = $this->rsm->parentAliasMap[$dqlAlias];
315 315
                 // we need the $path to save into the identifier map which entities were already
316 316
                 // seen for this parent-child relationship
317
-                $path = $parentAlias . '.' . $dqlAlias;
317
+                $path = $parentAlias.'.'.$dqlAlias;
318 318
 
319 319
                 // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs
320
-                if (! isset($nonemptyComponents[$parentAlias])) {
320
+                if ( ! isset($nonemptyComponents[$parentAlias])) {
321 321
                     // TODO: Add special case code where we hydrate the right join objects into identity map at least
322 322
                     continue;
323 323
                 }
@@ -348,15 +348,15 @@  discard block
 block discarded – undo
348 348
                 $oid = spl_object_hash($parentObject);
349 349
 
350 350
                 // Check the type of the relation (many or single-valued)
351
-                if (! ($association instanceof ToOneAssociationMetadata)) {
351
+                if ( ! ($association instanceof ToOneAssociationMetadata)) {
352 352
                     // PATH A: Collection-valued association
353 353
                     $reflFieldValue = $association->getValue($parentObject);
354 354
 
355 355
                     if (isset($nonemptyComponents[$dqlAlias])) {
356
-                        $collKey = $oid . $relationField;
356
+                        $collKey = $oid.$relationField;
357 357
                         if (isset($this->initializedCollections[$collKey])) {
358 358
                             $reflFieldValue = $this->initializedCollections[$collKey];
359
-                        } else if (! isset($this->existingCollections[$collKey])) {
359
+                        } else if ( ! isset($this->existingCollections[$collKey])) {
360 360
                             $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias);
361 361
                         }
362 362
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                         $index          = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false;
365 365
                         $indexIsValid   = $index !== false ? isset($reflFieldValue[$index]) : false;
366 366
 
367
-                        if (! $indexExists || ! $indexIsValid) {
367
+                        if ( ! $indexExists || ! $indexIsValid) {
368 368
                             if (isset($this->existingCollections[$collKey])) {
369 369
                                 // Collection exists, only look for the element in the identity map.
370 370
                                 if ($element = $this->getEntityFromIdentityMap($entityName, $data)) {
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
                     // PATH B: Single-valued association
401 401
                     $reflFieldValue = $association->getValue($parentObject);
402 402
 
403
-                    if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) ||
403
+                    if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) ||
404 404
                         ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized())) {
405 405
                         // we only need to take action if this value is null,
406 406
                         // we refresh the entity or its an uninitialized proxy.
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
                 $entityKey = $this->rsm->entityMappings[$dqlAlias] ?: 0;
462 462
 
463 463
                 // if this row has a NULL value for the root result id then make it a null result.
464
-                if ( ! isset($nonemptyComponents[$dqlAlias]) ) {
464
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
465 465
                     if ($this->rsm->isMixed) {
466 466
                         $result[] = [$entityKey => null];
467 467
                     } else {
@@ -517,13 +517,13 @@  discard block
 block discarded – undo
517 517
             }
518 518
         }
519 519
 
520
-        if ( ! isset($resultKey) ) {
520
+        if ( ! isset($resultKey)) {
521 521
             $this->resultCounter++;
522 522
         }
523 523
 
524 524
         // Append scalar values to mixed result sets
525 525
         if (isset($rowData['scalars'])) {
526
-            if ( ! isset($resultKey) ) {
526
+            if ( ! isset($resultKey)) {
527 527
                 $resultKey = (isset($this->rsm->indexByMap['scalars']))
528 528
                     ? $row[$this->rsm->indexByMap['scalars']]
529 529
                     : $this->resultCounter - 1;
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
 
537 537
         // Append new object to mixed result sets
538 538
         if (isset($rowData['newObjects'])) {
539
-            if ( ! isset($resultKey) ) {
539
+            if ( ! isset($resultKey)) {
540 540
                 $resultKey = $this->resultCounter - 1;
541 541
             }
542 542
 
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
                 $args   = $newObject['args'];
549 549
                 $obj    = $class->newInstanceArgs($args);
550 550
 
551
-                if ($hasNoScalars && \count($rowData['newObjects']) === 1 ) {
551
+                if ($hasNoScalars && \count($rowData['newObjects']) === 1) {
552 552
                     $result[$resultKey] = $obj;
553 553
 
554 554
                     continue;
Please login to merge, or discard this patch.