Test Setup Failed
Push — develop ( 082d66...6f26e1 )
by Guilherme
63:04
created
lib/Doctrine/ORM/Mapping/Driver/DriverChain.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * <http://www.doctrine-project.org>.
18 18
  */
19 19
 
20
-declare(strict_types=1);
20
+declare(strict_types = 1);
21 21
 
22 22
 namespace Doctrine\ORM\Mapping\Driver;
23 23
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         foreach ($this->drivers AS $namespace => $driver) {
127 127
             $oid = spl_object_hash($driver);
128 128
 
129
-            if (!isset($driverClasses[$oid])) {
129
+            if ( ! isset($driverClasses[$oid])) {
130 130
                 $driverClasses[$oid] = $driver->getAllClassNames();
131 131
             }
132 132
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/UnitOfWork.php 1 patch
Spacing   +43 added lines, -43 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
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
         $oid  = spl_object_hash($entity);
451 451
         $data = [];
452 452
 
453
-        if (!isset($this->entityChangeSets[$oid])) {
453
+        if ( ! isset($this->entityChangeSets[$oid])) {
454 454
             return $data;
455 455
         }
456 456
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
                     || ! $class->getProperty($name) instanceof FieldMetadata
534 534
                     || ! $class->getProperty($name)->hasValueGenerator()
535 535
                     || $class->getProperty($name)->getValueGenerator()->getType() !== GeneratorType::IDENTITY
536
-                ) && (! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
536
+                ) && ( ! $class->isVersioned() || $name !== $class->versionProperty->getName())) {
537 537
                 $actualData[$name] = $value;
538 538
             }
539 539
         }
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
                     if ($owner === null) { // cloned
588 588
                         $actualValue->setOwner($entity, $property);
589 589
                     } else if ($owner !== $entity) { // no clone, we have to fix
590
-                        if (! $actualValue->isInitialized()) {
590
+                        if ( ! $actualValue->isInitialized()) {
591 591
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
592 592
                         }
593 593
 
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
                             // A PersistentCollection was de-referenced, so delete it.
628 628
                             $coid = spl_object_hash($orgValue);
629 629
 
630
-                            if (!isset($this->collectionDeletions[$coid])) {
630
+                            if ( ! isset($this->collectionDeletions[$coid])) {
631 631
                                 $this->collectionDeletions[$coid] = $orgValue;
632 632
                                 $changeSet[$propName] = $orgValue; // Signal changeset, to-many associations will be ignored
633 633
                             }
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 
650 650
         // Look for changes in associations of the entity
651 651
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
652
-            if (! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) {
652
+            if ( ! ($property instanceof AssociationMetadata) || ($value = $property->getValue($entity)) === null) {
653 653
                 continue;
654 654
             }
655 655
 
@@ -753,13 +753,13 @@  discard block
 block discarded – undo
753 753
         $targetClass    = $this->em->getClassMetadata($targetEntity);
754 754
 
755 755
         foreach ($unwrappedValue as $key => $entry) {
756
-            if (! ($entry instanceof $targetEntity)) {
756
+            if ( ! ($entry instanceof $targetEntity)) {
757 757
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $association, $entry);
758 758
             }
759 759
 
760 760
             $state = $this->getEntityState($entry, self::STATE_NEW);
761 761
 
762
-            if (! ($entry instanceof $targetEntity)) {
762
+            if ( ! ($entry instanceof $targetEntity)) {
763 763
                 throw ORMException::unexpectedAssociationValue(
764 764
                     $association->getSourceEntity(),
765 765
                     $association->getName(),
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
         $persister = $this->getEntityPersister($class->getClassName());
819 819
         $generationPlan->executeImmediate($this->em, $entity);
820 820
 
821
-        if (! $generationPlan->containsDeferred()) {
821
+        if ( ! $generationPlan->containsDeferred()) {
822 822
             $id = $this->em->getIdentifierFlattener()->flattenIdentifier($class, $persister->getIdentifier($entity));
823 823
             $this->entityIdentifiers[$oid] = $id;
824 824
         }
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
     {
852 852
         $oid = spl_object_hash($entity);
853 853
 
854
-        if (! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
854
+        if ( ! isset($this->entityStates[$oid]) || $this->entityStates[$oid] !== self::STATE_MANAGED) {
855 855
             throw ORMInvalidArgumentException::entityNotManaged($entity);
856 856
         }
857 857
 
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
                     break;
874 874
 
875 875
                 case ($property instanceof FieldMetadata):
876
-                    if (! $property->isPrimaryKey()
876
+                    if ( ! $property->isPrimaryKey()
877 877
                         || ! $property->getValueGenerator()
878 878
                         || $property->getValueGenerator()->getType() !== GeneratorType::IDENTITY) {
879 879
                         $actualData[$name] = $property->getValue($entity);
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
             // Entity with this $oid after deletion treated as NEW, even if the $oid
1027 1027
             // is obtained by a new entity because the old one went out of scope.
1028 1028
             //$this->entityStates[$oid] = self::STATE_NEW;
1029
-            if (! $class->isIdentifierComposite()) {
1029
+            if ( ! $class->isIdentifierComposite()) {
1030 1030
                 $property = $class->getProperty($class->getSingleIdentifierFieldName());
1031 1031
 
1032 1032
                 if ($property instanceof FieldMetadata && $property->hasValueGenerator()) {
@@ -1079,7 +1079,7 @@  discard block
 block discarded – undo
1079 1079
         // Calculate dependencies for new nodes
1080 1080
         while ($class = array_pop($newNodes)) {
1081 1081
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
1082
-                if (! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1082
+                if ( ! ($property instanceof ToOneAssociationMetadata && $property->isOwningSide())) {
1083 1083
                     continue;
1084 1084
                 }
1085 1085
 
@@ -1094,7 +1094,7 @@  discard block
 block discarded – undo
1094 1094
                 $weight = count(
1095 1095
                     array_filter(
1096 1096
                         $property->getJoinColumns(),
1097
-                        function (JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); }
1097
+                        function(JoinColumnMetadata $joinColumn) { return $joinColumn->isNullable(); }
1098 1098
                     )
1099 1099
                 ) === 0;
1100 1100
 
@@ -1389,7 +1389,7 @@  discard block
 block discarded – undo
1389 1389
         $persister = $this->getEntityPersister($class->getClassName());
1390 1390
         $id        = $persister->getIdentifier($entity);
1391 1391
 
1392
-        if (! $id) {
1392
+        if ( ! $id) {
1393 1393
             return self::STATE_NEW;
1394 1394
         }
1395 1395
 
@@ -1624,7 +1624,7 @@  discard block
 block discarded – undo
1624 1624
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
1625 1625
 
1626 1626
             default:
1627
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1627
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1628 1628
         }
1629 1629
 
1630 1630
         $this->cascadePersist($entity, $visited);
@@ -1694,7 +1694,7 @@  discard block
 block discarded – undo
1694 1694
             case self::STATE_DETACHED:
1695 1695
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
1696 1696
             default:
1697
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1697
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1698 1698
         }
1699 1699
 
1700 1700
     }
@@ -1783,7 +1783,7 @@  discard block
 block discarded – undo
1783 1783
                 if ($managedCopy === null) {
1784 1784
                     // If the identifier is ASSIGNED, it is NEW, otherwise an error
1785 1785
                     // since the managed entity was not found.
1786
-                    if (! $class->isIdentifierComposite()
1786
+                    if ( ! $class->isIdentifierComposite()
1787 1787
                         && $class->getProperty($class->getSingleIdentifierFieldName()) instanceof FieldMetadata
1788 1788
                         && $class->getProperty($class->getSingleIdentifierFieldName())->hasValueGenerator()) {
1789 1789
                         throw EntityNotFoundException::fromClassNameAndIdentifier(
@@ -1834,7 +1834,7 @@  discard block
 block discarded – undo
1834 1834
      */
1835 1835
     private function ensureVersionMatch(ClassMetadata $class, $entity, $managedCopy)
1836 1836
     {
1837
-        if (! ($class->isVersioned() && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) {
1837
+        if ( ! ($class->isVersioned() && $this->isLoaded($managedCopy) && $this->isLoaded($entity))) {
1838 1838
             return;
1839 1839
         }
1840 1840
 
@@ -1858,7 +1858,7 @@  discard block
 block discarded – undo
1858 1858
      */
1859 1859
     private function isLoaded($entity)
1860 1860
     {
1861
-        return !($entity instanceof Proxy) || $entity->__isInitialized();
1861
+        return ! ($entity instanceof Proxy) || $entity->__isInitialized();
1862 1862
     }
1863 1863
 
1864 1864
     /**
@@ -2020,7 +2020,7 @@  discard block
 block discarded – undo
2020 2020
         $class = $this->em->getClassMetadata(get_class($entity));
2021 2021
 
2022 2022
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2023
-            if (! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) {
2023
+            if ( ! ($association instanceof AssociationMetadata && in_array('refresh', $association->getCascade()))) {
2024 2024
                 continue;
2025 2025
             }
2026 2026
 
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
         $class = $this->em->getClassMetadata(get_class($entity));
2063 2063
 
2064 2064
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2065
-            if (! ($association instanceof AssociationMetadata && in_array('detach', $association->getCascade()))) {
2065
+            if ( ! ($association instanceof AssociationMetadata && in_array('detach', $association->getCascade()))) {
2066 2066
                 continue;
2067 2067
             }
2068 2068
 
@@ -2105,7 +2105,7 @@  discard block
 block discarded – undo
2105 2105
         $class = $this->em->getClassMetadata(get_class($entity));
2106 2106
 
2107 2107
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2108
-            if (! ($association instanceof AssociationMetadata && in_array('merge', $association->getCascade()))) {
2108
+            if ( ! ($association instanceof AssociationMetadata && in_array('merge', $association->getCascade()))) {
2109 2109
                 continue;
2110 2110
             }
2111 2111
 
@@ -2144,7 +2144,7 @@  discard block
 block discarded – undo
2144 2144
         $class = $this->em->getClassMetadata(get_class($entity));
2145 2145
 
2146 2146
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2147
-            if (! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) {
2147
+            if ( ! ($association instanceof AssociationMetadata && in_array('persist', $association->getCascade()))) {
2148 2148
                 continue;
2149 2149
             }
2150 2150
 
@@ -2160,7 +2160,7 @@  discard block
 block discarded – undo
2160 2160
 
2161 2161
                 case ($relatedEntities instanceof Collection):
2162 2162
                 case (is_array($relatedEntities)):
2163
-                    if (! ($association instanceof ToManyAssociationMetadata)) {
2163
+                    if ( ! ($association instanceof ToManyAssociationMetadata)) {
2164 2164
                         throw ORMInvalidArgumentException::invalidAssociation(
2165 2165
                             $this->em->getClassMetadata($targetEntity),
2166 2166
                             $association,
@@ -2175,7 +2175,7 @@  discard block
 block discarded – undo
2175 2175
                     break;
2176 2176
 
2177 2177
                 case ($relatedEntities !== null):
2178
-                    if (! $relatedEntities instanceof $targetEntity) {
2178
+                    if ( ! $relatedEntities instanceof $targetEntity) {
2179 2179
                         throw ORMInvalidArgumentException::invalidAssociation(
2180 2180
                             $this->em->getClassMetadata($targetEntity),
2181 2181
                             $association,
@@ -2206,7 +2206,7 @@  discard block
 block discarded – undo
2206 2206
         $class             = $this->em->getClassMetadata(get_class($entity));
2207 2207
 
2208 2208
         foreach ($class->getDeclaredPropertiesIterator() as $association) {
2209
-            if (! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) {
2209
+            if ( ! ($association instanceof AssociationMetadata && in_array('remove', $association->getCascade()))) {
2210 2210
                 continue;
2211 2211
             }
2212 2212
 
@@ -2289,7 +2289,7 @@  discard block
 block discarded – undo
2289 2289
             case LockMode::NONE === $lockMode:
2290 2290
             case LockMode::PESSIMISTIC_READ === $lockMode:
2291 2291
             case LockMode::PESSIMISTIC_WRITE === $lockMode:
2292
-                if (!$this->em->getConnection()->isTransactionActive()) {
2292
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
2293 2293
                     throw TransactionRequiredException::transactionRequired();
2294 2294
                 }
2295 2295
 
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
         }
2534 2534
 
2535 2535
         foreach ($class->getDeclaredPropertiesIterator() as $field => $association) {
2536
-            if (! ($association instanceof AssociationMetadata)) {
2536
+            if ( ! ($association instanceof AssociationMetadata)) {
2537 2537
                 continue;
2538 2538
             }
2539 2539
 
@@ -2582,7 +2582,7 @@  discard block
 block discarded – undo
2582 2582
                 continue;
2583 2583
             }
2584 2584
 
2585
-            if (! $association->isOwningSide()) {
2585
+            if ( ! $association->isOwningSide()) {
2586 2586
                 // use the given entity association
2587 2587
                 if (isset($data[$field]) && is_object($data[$field]) &&
2588 2588
                     isset($this->entityStates[spl_object_hash($data[$field])])) {
@@ -2632,7 +2632,7 @@  discard block
 block discarded – undo
2632 2632
                 $associatedId[$targetField] = $joinColumnValue;
2633 2633
             }
2634 2634
 
2635
-            if (! $associatedId) {
2635
+            if ( ! $associatedId) {
2636 2636
                 // Foreign key is NULL
2637 2637
                 $association->setValue($entity, null);
2638 2638
                 $this->originalEntityData[$oid][$field] = null;
@@ -2641,7 +2641,7 @@  discard block
 block discarded – undo
2641 2641
             }
2642 2642
 
2643 2643
             // @todo guilhermeblanco Can we remove the need of this somehow?
2644
-            if (!isset($hints['fetchMode'][$class->getClassName()][$field])) {
2644
+            if ( ! isset($hints['fetchMode'][$class->getClassName()][$field])) {
2645 2645
                 $hints['fetchMode'][$class->getClassName()][$field] = $association->getFetchMode();
2646 2646
             }
2647 2647
 
@@ -2658,7 +2658,7 @@  discard block
 block discarded – undo
2658 2658
                     // If this is an uninitialized proxy, we are deferring eager loads,
2659 2659
                     // this association is marked as eager fetch, and its an uninitialized proxy (wtf!)
2660 2660
                     // then we can append this entity for eager loading!
2661
-                    if (!$targetClass->isIdentifierComposite() &&
2661
+                    if ( ! $targetClass->isIdentifierComposite() &&
2662 2662
                         $newValue instanceof Proxy &&
2663 2663
                         isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2664 2664
                         $hints['fetchMode'][$class->getClassName()][$field] === FetchMode::EAGER &&
@@ -2689,7 +2689,7 @@  discard block
 block discarded – undo
2689 2689
                             break;
2690 2690
 
2691 2691
                         // Deferred eager load only works for single identifier classes
2692
-                        case (isset($hints[self::HINT_DEFEREAGERLOAD]) && !$targetClass->isIdentifierComposite()):
2692
+                        case (isset($hints[self::HINT_DEFEREAGERLOAD]) && ! $targetClass->isIdentifierComposite()):
2693 2693
                             // TODO: Is there a faster approach?
2694 2694
                             $this->eagerLoadingEntities[$targetClass->getRootClassName()][$relatedIdHash] = current($associatedId);
2695 2695
 
@@ -3061,7 +3061,7 @@  discard block
 block discarded – undo
3061 3061
     {
3062 3062
         $class = $this->em->getClassMetadata(get_class($entity));
3063 3063
 
3064
-        if (! $class->getProperty($propertyName)) {
3064
+        if ( ! $class->getProperty($propertyName)) {
3065 3065
             return; // ignore non-persistent fields
3066 3066
         }
3067 3067
 
@@ -3201,7 +3201,7 @@  discard block
 block discarded – undo
3201 3201
      */
3202 3202
     private function afterTransactionComplete()
3203 3203
     {
3204
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3204
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3205 3205
             $persister->afterTransactionComplete();
3206 3206
         });
3207 3207
     }
@@ -3211,7 +3211,7 @@  discard block
 block discarded – undo
3211 3211
      */
3212 3212
     private function afterTransactionRolledBack()
3213 3213
     {
3214
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3214
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3215 3215
             $persister->afterTransactionRolledBack();
3216 3216
         });
3217 3217
     }
@@ -3294,11 +3294,11 @@  discard block
 block discarded – undo
3294 3294
      */
3295 3295
     private function mergeEntityStateIntoManagedCopy($entity, $managedCopy)
3296 3296
     {
3297
-        if (! $this->isLoaded($entity)) {
3297
+        if ( ! $this->isLoaded($entity)) {
3298 3298
             return;
3299 3299
         }
3300 3300
 
3301
-        if (! $this->isLoaded($managedCopy)) {
3301
+        if ( ! $this->isLoaded($managedCopy)) {
3302 3302
             $managedCopy->__load();
3303 3303
         }
3304 3304
 
@@ -3307,7 +3307,7 @@  discard block
 block discarded – undo
3307 3307
         foreach ($class->getDeclaredPropertiesIterator() as $property) {
3308 3308
             switch (true) {
3309 3309
                 case ($property instanceof FieldMetadata):
3310
-                    if (! $property->isPrimaryKey()) {
3310
+                    if ( ! $property->isPrimaryKey()) {
3311 3311
                         $property->setValue($managedCopy, $property->getValue($entity));
3312 3312
                     }
3313 3313
 
@@ -3329,7 +3329,7 @@  discard block
 block discarded – undo
3329 3329
                         continue 2;
3330 3330
                     }
3331 3331
 
3332
-                    if (! in_array('merge', $property->getCascade())) {
3332
+                    if ( ! in_array('merge', $property->getCascade())) {
3333 3333
                         if ($this->getEntityState($other) === self::STATE_DETACHED) {
3334 3334
                             $targetEntity    = $property->getTargetEntity();
3335 3335
                             $targetClass     = $this->em->getClassMetadata($targetEntity);
@@ -3361,7 +3361,7 @@  discard block
 block discarded – undo
3361 3361
 
3362 3362
                     $managedCol = $property->getValue($managedCopy);
3363 3363
 
3364
-                    if (! $managedCol) {
3364
+                    if ( ! $managedCol) {
3365 3365
                         $managedCol = $property->wrap($managedCopy, [], $this->em);
3366 3366
 
3367 3367
                         $property->setValue($managedCopy, $managedCol);
@@ -3371,7 +3371,7 @@  discard block
 block discarded – undo
3371 3371
                         $managedCol->initialize();
3372 3372
 
3373 3373
                         // clear and set dirty a managed collection if its not also the same collection to merge from.
3374
-                        if (! $managedCol->isEmpty() && $managedCol !== $mergeCol) {
3374
+                        if ( ! $managedCol->isEmpty() && $managedCol !== $mergeCol) {
3375 3375
                             $managedCol->unwrap()->clear();
3376 3376
                             $managedCol->setDirty(true);
3377 3377
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php 1 patch
Spacing   +7 added lines, -7 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\Tools\Console\Command;
6 6
 
@@ -165,8 +165,8 @@  discard block
 block discarded – undo
165 165
 
166 166
         $matches = array_filter(
167 167
             $this->getMappedEntities($entityManager),
168
-            function ($mappedEntity) use ($entityName) {
169
-                return preg_match('{' . preg_quote($entityName) . '}', $mappedEntity);
168
+            function($mappedEntity) use ($entityName) {
169
+                return preg_match('{'.preg_quote($entityName).'}', $mappedEntity);
170 170
             }
171 171
         );
172 172
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
             $output[] = $this->formatField(
225 225
                 sprintf('  %s', $parentClass->getParent()),
226
-                ($parentClass->isRootEntity() ? '(Root) ' : '') . $this->formatValue($attributes)
226
+                ($parentClass->isRootEntity() ? '(Root) ' : '').$this->formatValue($attributes)
227 227
             );
228 228
         }
229 229
 
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         }
249 249
 
250 250
         if (is_bool($value)) {
251
-            return '<comment>' . ($value ? 'True' : 'False') . '</comment>';
251
+            return '<comment>'.($value ? 'True' : 'False').'</comment>';
252 252
         }
253 253
 
254 254
         if (empty($value)) {
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
             if ($property instanceof FieldMetadata) {
332 332
                 $output = array_merge($output, $this->formatColumn($property));
333
-            }  else if ($property instanceof AssociationMetadata) {
333
+            } else if ($property instanceof AssociationMetadata) {
334 334
                 // @todo guilhermeblanco Fix me! We are trying to iterate through an AssociationMetadata instance
335 335
                 foreach ($property as $field => $value) {
336 336
                     $output[] = $this->formatField(sprintf('    %s', $field), $this->formatValue($value));
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         return $this->formatField(
387 387
             'Entity listeners',
388 388
             array_map(
389
-                function ($entityListener) {
389
+                function($entityListener) {
390 390
                     return get_class($entityListener);
391 391
                 },
392 392
                 $entityListeners
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaValidator.php 1 patch
Spacing   +13 added lines, -13 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\Tools;
6 6
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         $ce = [];
82 82
 
83 83
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $association) {
84
-            if (! ($association instanceof AssociationMetadata)) {
84
+            if ( ! ($association instanceof AssociationMetadata)) {
85 85
                 continue;
86 86
             }
87 87
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         }
90 90
 
91 91
         foreach ($class->getSubClasses() as $subClass) {
92
-            if (!in_array($class->getClassName(), class_parents($subClass))) {
92
+            if ( ! in_array($class->getClassName(), class_parents($subClass))) {
93 93
                 $message = "According to the discriminator map class, '%s' has to be a child of '%s', but these entities are not related through inheritance.";
94 94
 
95 95
                 $ce[] = sprintf($message, $subClass, $class->getClassName());
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $fieldName       = $association->getName();
112 112
         $targetEntity    = $association->getTargetEntity();
113 113
 
114
-        if (!class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) {
114
+        if ( ! class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) {
115 115
             $message = "The target entity '%s' specified on %s#%s is unknown or not an entity.";
116 116
 
117 117
             return [
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 
133 133
         /** @var ClassMetadata $targetMetadata */
134 134
         $targetMetadata    = $metadataFactory->getMetadataFor($targetEntity);
135
-        $containsForeignId = array_filter($targetMetadata->identifier, function ($identifier) use ($targetMetadata) {
135
+        $containsForeignId = array_filter($targetMetadata->identifier, function($identifier) use ($targetMetadata) {
136 136
             $targetProperty = $targetMetadata->getProperty($identifier);
137 137
 
138 138
             return $targetProperty instanceof AssociationMetadata;
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             /** @var AssociationMetadata $targetAssociation */
149 149
             $targetAssociation = $targetMetadata->getProperty($mappedBy);
150 150
 
151
-            if (! $targetAssociation) {
151
+            if ( ! $targetAssociation) {
152 152
                 $message = "The association %s#%s refers to the owning side property %s#%s which does not exist.";
153 153
 
154 154
                 $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $mappedBy);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             /** @var AssociationMetadata $targetAssociation */
173 173
             $targetAssociation = $targetMetadata->getProperty($inversedBy);
174 174
 
175
-            if (! $targetAssociation) {
175
+            if ( ! $targetAssociation) {
176 176
                 $message = "The association %s#%s refers to the inverse side property %s#%s which does not exist.";
177 177
 
178 178
                 $ce[] = sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $inversedBy);
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                 $joinTable               = $association->getJoinTable();
217 217
 
218 218
                 foreach ($joinTable->getJoinColumns() as $joinColumn) {
219
-                    if (! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns)) {
219
+                    if ( ! in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns)) {
220 220
                         $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
221 221
 
222 222
                         $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $class->getClassName());
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
                 }
226 226
 
227 227
                 foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) {
228
-                    if (! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns)) {
228
+                    if ( ! in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns)) {
229 229
                         $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
230 230
 
231 231
                         $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $targetMetadata->getClassName());
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
                 if (count($targetIdentifierColumns) !== count($joinTable->getInverseJoinColumns())) {
237 237
                     $columnNames = array_map(
238
-                        function (JoinColumnMetadata $joinColumn) {
238
+                        function(JoinColumnMetadata $joinColumn) {
239 239
                             return $joinColumn->getReferencedColumnName();
240 240
                         },
241 241
                         $joinTable->getInverseJoinColumns()
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 
251 251
                 if (count($classIdentifierColumns) !== count($joinTable->getJoinColumns())) {
252 252
                     $columnNames = array_map(
253
-                        function (JoinColumnMetadata $joinColumn) {
253
+                        function(JoinColumnMetadata $joinColumn) {
254 254
                             return $joinColumn->getReferencedColumnName();
255 255
                         },
256 256
                         $joinTable->getJoinColumns()
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                 $joinColumns       = $association->getJoinColumns();
268 268
 
269 269
                 foreach ($joinColumns as $joinColumn) {
270
-                    if (!in_array($joinColumn->getReferencedColumnName(), $identifierColumns)) {
270
+                    if ( ! in_array($joinColumn->getReferencedColumnName(), $identifierColumns)) {
271 271
                         $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
272 272
 
273 273
                         $ce[] = sprintf($message, $joinColumn->getReferencedColumnName(), $targetMetadata->getClassName());
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
                     continue;
299 299
                 }
300 300
 
301
-                if (! ($targetProperty instanceof AssociationMetadata)) {
301
+                if ( ! ($targetProperty instanceof AssociationMetadata)) {
302 302
                     $message = "The association %s#%s is ordered by a property '%s' that is non-existing field on the target entity '%s'.";
303 303
 
304 304
                     $ce[] = sprintf($message, $class->getClassName(), $fieldName, $orderField, $targetMetadata->getClassName());
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/EntityGenerator.php 1 patch
Spacing   +131 added lines, -131 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\Tools;
6 6
 
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
      */
329 329
     public function writeEntityClass(ClassMetadata $metadata, $outputDirectory)
330 330
     {
331
-        $path = $outputDirectory . '/' . str_replace('\\', DIRECTORY_SEPARATOR, $metadata->getClassName()) . $this->extension;
331
+        $path = $outputDirectory.'/'.str_replace('\\', DIRECTORY_SEPARATOR, $metadata->getClassName()).$this->extension;
332 332
         $dir = dirname($path);
333 333
 
334 334
         if ( ! is_dir($dir)) {
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
         }
345 345
 
346 346
         if ($this->backupExisting && file_exists($path)) {
347
-            $backupPath = dirname($path) . DIRECTORY_SEPARATOR . basename($path) . "~";
348
-            if (!copy($path, $backupPath)) {
347
+            $backupPath = dirname($path).DIRECTORY_SEPARATOR.basename($path)."~";
348
+            if ( ! copy($path, $backupPath)) {
349 349
                 throw new \RuntimeException("Attempt to backup overwritten entity file but copy operation failed.");
350 350
             }
351 351
         }
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
         $body = str_replace('<spaces>', $this->spaces, $body);
407 407
         $last = strrpos($currentCode, '}');
408 408
 
409
-        return substr($currentCode, 0, $last) . $body . ($body ? "\n" : '') . "}\n";
409
+        return substr($currentCode, 0, $last).$body.($body ? "\n" : '')."}\n";
410 410
     }
411 411
 
412 412
     /**
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
     public function setFieldVisibility($visibility)
471 471
     {
472 472
         if ($visibility !== static::FIELD_VISIBLE_PRIVATE && $visibility !== static::FIELD_VISIBLE_PROTECTED) {
473
-            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): ' . $visibility);
473
+            throw new \InvalidArgumentException('Invalid provided visibility (only private and protected are allowed): '.$visibility);
474 474
         }
475 475
 
476 476
         $this->fieldVisibility = $visibility;
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
     protected function generateEntityNamespace(ClassMetadata $metadata)
569 569
     {
570 570
         if ($this->hasNamespace($metadata)) {
571
-            return 'namespace ' . $this->getNamespace($metadata) .';';
571
+            return 'namespace '.$this->getNamespace($metadata).';';
572 572
         }
573 573
     }
574 574
 
@@ -588,8 +588,8 @@  discard block
 block discarded – undo
588 588
      */
589 589
     protected function generateEntityClassName(ClassMetadata $metadata)
590 590
     {
591
-        return 'class ' . $this->getClassName($metadata) .
592
-            ($this->extendsClass() ? ' extends ' . $this->getClassToExtendName() : null);
591
+        return 'class '.$this->getClassName($metadata).
592
+            ($this->extendsClass() ? ' extends '.$this->getClassToExtendName() : null);
593 593
     }
594 594
 
595 595
     /**
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
         $optionalFields = [];
675 675
 
676 676
         foreach ($metadata->getDeclaredPropertiesIterator() as $property) {
677
-            if (! $property->isNullable()) {
677
+            if ( ! $property->isNullable()) {
678 678
                 $requiredFields[] = $property;
679 679
 
680 680
                 continue;
@@ -703,13 +703,13 @@  discard block
 block discarded – undo
703 703
             $fieldName  = $property->getName();
704 704
             $fieldType  = $property->getTypeName();
705 705
             $mappedType = $this->getType($fieldType);
706
-            $param      = '$' . $fieldName;
706
+            $param      = '$'.$fieldName;
707 707
 
708
-            $paramTypes[] = $mappedType . ($property->isNullable() ? '|null' : '');
708
+            $paramTypes[] = $mappedType.($property->isNullable() ? '|null' : '');
709 709
             $paramVariables[] = $param;
710 710
 
711 711
             if ($fieldType === 'datetime') {
712
-                $param = $mappedType . ' ' . $param;
712
+                $param = $mappedType.' '.$param;
713 713
             }
714 714
 
715 715
             if ($property->isNullable()) {
@@ -718,13 +718,13 @@  discard block
 block discarded – undo
718 718
 
719 719
             $params[] = $param;
720 720
 
721
-            $fields[] = '$this->' . $fieldName . ' = $' . $fieldName . ';';
721
+            $fields[] = '$this->'.$fieldName.' = $'.$fieldName.';';
722 722
         }
723 723
 
724 724
         $maxParamTypeLength = max(array_map('strlen', $paramTypes));
725 725
         $paramTags = array_map(
726
-            function ($type, $variable) use ($maxParamTypeLength) {
727
-                return '@param ' . $type . str_repeat(' ', $maxParamTypeLength - strlen($type) + 1) . $variable;
726
+            function($type, $variable) use ($maxParamTypeLength) {
727
+                return '@param '.$type.str_repeat(' ', $maxParamTypeLength - strlen($type) + 1).$variable;
728 728
             },
729 729
             $paramTypes,
730 730
             $paramVariables
@@ -732,8 +732,8 @@  discard block
 block discarded – undo
732 732
 
733 733
         // Generate multi line constructor if the signature exceeds 120 characters.
734 734
         if (array_sum(array_map('strlen', $params)) + count($params) * 2 + 29 > 120) {
735
-            $delimiter = "\n" . $this->spaces;
736
-            $params = $delimiter . implode(',' . $delimiter, $params) . "\n";
735
+            $delimiter = "\n".$this->spaces;
736
+            $params = $delimiter.implode(','.$delimiter, $params)."\n";
737 737
         } else {
738 738
             $params = implode(', ', $params);
739 739
         }
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
         $replacements = [
742 742
             '<paramTags>' => implode("\n * ", $paramTags),
743 743
             '<params>'    => $params,
744
-            '<fields>'    => implode("\n" . $this->spaces, $fields),
744
+            '<fields>'    => implode("\n".$this->spaces, $fields),
745 745
         ];
746 746
 
747 747
         $constructor = str_replace(
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 
787 787
             if ($inClass) {
788 788
                 $inClass = false;
789
-                $lastSeenClass = $lastSeenNamespace . ($lastSeenNamespace ? '\\' : '') . $token[1];
789
+                $lastSeenClass = $lastSeenNamespace.($lastSeenNamespace ? '\\' : '').$token[1];
790 790
                 $this->staticReflection[$lastSeenClass]['properties'] = [];
791 791
                 $this->staticReflection[$lastSeenClass]['methods'] = [];
792 792
             }
@@ -794,16 +794,16 @@  discard block
 block discarded – undo
794 794
             if (T_NAMESPACE === $token[0]) {
795 795
                 $lastSeenNamespace = '';
796 796
                 $inNamespace = true;
797
-            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i-1][0]) {
797
+            } elseif (T_CLASS === $token[0] && T_DOUBLE_COLON !== $tokens[$i - 1][0]) {
798 798
                 $inClass = true;
799 799
             } elseif (T_FUNCTION === $token[0]) {
800
-                if (T_STRING === $tokens[$i+2][0]) {
801
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+2][1]);
802
-                } elseif ($tokens[$i+2] == '&' && T_STRING === $tokens[$i+3][0]) {
803
-                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i+3][1]);
800
+                if (T_STRING === $tokens[$i + 2][0]) {
801
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 2][1]);
802
+                } elseif ($tokens[$i + 2] == '&' && T_STRING === $tokens[$i + 3][0]) {
803
+                    $this->staticReflection[$lastSeenClass]['methods'][] = strtolower($tokens[$i + 3][1]);
804 804
                 }
805
-            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i+2][0]) {
806
-                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i+2][1], 1);
805
+            } elseif (in_array($token[0], [T_VAR, T_PUBLIC, T_PRIVATE, T_PROTECTED], true) && T_FUNCTION !== $tokens[$i + 2][0]) {
806
+                $this->staticReflection[$lastSeenClass]['properties'][] = substr($tokens[$i + 2][1], 1);
807 807
             }
808 808
         }
809 809
     }
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
      */
817 817
     protected function hasProperty($property, ClassMetadata $metadata)
818 818
     {
819
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->getClassName()))) {
819
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->getClassName()))) {
820 820
             // don't generate property if its already on the base class.
821 821
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->getClassName());
822 822
 
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
      */
847 847
     protected function hasMethod($method, ClassMetadata $metadata)
848 848
     {
849
-        if ($this->extendsClass() || (!$this->isNew && class_exists($metadata->getClassName()))) {
849
+        if ($this->extendsClass() || ( ! $this->isNew && class_exists($metadata->getClassName()))) {
850 850
             // don't generate method if its already on the base class.
851 851
             $reflClass = new \ReflectionClass($this->getClassToExtend() ?: $metadata->getClassName());
852 852
 
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
      */
876 876
     protected function getTraits(ClassMetadata $metadata)
877 877
     {
878
-        if (! ($metadata->getReflectionClass() !== null || class_exists($metadata->getClassName()))) {
878
+        if ( ! ($metadata->getReflectionClass() !== null || class_exists($metadata->getClassName()))) {
879 879
             return [];
880 880
         }
881 881
 
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
     {
925 925
         $refl = new \ReflectionClass($this->getClassToExtend());
926 926
 
927
-        return '\\' . $refl->getName();
927
+        return '\\'.$refl->getName();
928 928
     }
929 929
 
930 930
     /**
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
     {
958 958
         $lines = [];
959 959
         $lines[] = '/**';
960
-        $lines[] = ' * ' . $this->getClassName($metadata);
960
+        $lines[] = ' * '.$this->getClassName($metadata);
961 961
 
962 962
         if ($this->generateAnnotations) {
963 963
             $lines[] = ' *';
@@ -972,12 +972,12 @@  discard block
 block discarded – undo
972 972
 
973 973
             foreach ($methods as $method) {
974 974
                 if ($code = $this->$method($metadata)) {
975
-                    $lines[] = ' * ' . $code;
975
+                    $lines[] = ' * '.$code;
976 976
                 }
977 977
             }
978 978
 
979 979
             if (isset($metadata->lifecycleCallbacks) && $metadata->lifecycleCallbacks) {
980
-                $lines[] = ' * @' . $this->annotationsPrefix . 'HasLifecycleCallbacks';
980
+                $lines[] = ' * @'.$this->annotationsPrefix.'HasLifecycleCallbacks';
981 981
             }
982 982
         }
983 983
 
@@ -993,17 +993,17 @@  discard block
 block discarded – undo
993 993
      */
994 994
     protected function generateEntityAnnotation(ClassMetadata $metadata)
995 995
     {
996
-        $prefix = '@' . $this->annotationsPrefix;
996
+        $prefix = '@'.$this->annotationsPrefix;
997 997
 
998 998
         if ($metadata->isEmbeddedClass) {
999
-            return $prefix . 'Embeddable';
999
+            return $prefix.'Embeddable';
1000 1000
         }
1001 1001
 
1002 1002
         $customRepository = $metadata->getCustomRepositoryClassName()
1003
-            ? '(repositoryClass="' . $metadata->getCustomRepositoryClassName() . '")'
1003
+            ? '(repositoryClass="'.$metadata->getCustomRepositoryClassName().'")'
1004 1004
             : '';
1005 1005
 
1006
-        return $prefix . ($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity') . $customRepository;
1006
+        return $prefix.($metadata->isMappedSuperclass ? 'MappedSuperclass' : 'Entity').$customRepository;
1007 1007
     }
1008 1008
 
1009 1009
     /**
@@ -1020,28 +1020,28 @@  discard block
 block discarded – undo
1020 1020
         $table = [];
1021 1021
 
1022 1022
         if ($metadata->table->getSchema()) {
1023
-            $table[] = 'schema="' . $metadata->table->getSchema() . '"';
1023
+            $table[] = 'schema="'.$metadata->table->getSchema().'"';
1024 1024
         }
1025 1025
 
1026 1026
         if ($metadata->table->getName()) {
1027
-            $table[] = 'name="' . $metadata->table->getName() . '"';
1027
+            $table[] = 'name="'.$metadata->table->getName().'"';
1028 1028
         }
1029 1029
 
1030 1030
         if ($metadata->table->getOptions()) {
1031
-            $table[] = 'options={' . $this->exportTableOptions($metadata->table->getOptions()) . '}';
1031
+            $table[] = 'options={'.$this->exportTableOptions($metadata->table->getOptions()).'}';
1032 1032
         }
1033 1033
 
1034 1034
         if ($metadata->table->getUniqueConstraints()) {
1035 1035
             $constraints = $this->generateTableConstraints('UniqueConstraint', $metadata->table->getUniqueConstraints());
1036
-            $table[] = 'uniqueConstraints={' . $constraints . '}';
1036
+            $table[] = 'uniqueConstraints={'.$constraints.'}';
1037 1037
         }
1038 1038
 
1039 1039
         if ($metadata->table->getIndexes()) {
1040 1040
             $constraints = $this->generateTableConstraints('Index', $metadata->table->getIndexes());
1041
-            $table[] = 'indexes={' . $constraints . '}';
1041
+            $table[] = 'indexes={'.$constraints.'}';
1042 1042
         }
1043 1043
 
1044
-        return '@' . $this->annotationsPrefix . 'Table(' . implode(', ', $table) . ')';
1044
+        return '@'.$this->annotationsPrefix.'Table('.implode(', ', $table).')';
1045 1045
     }
1046 1046
 
1047 1047
     /**
@@ -1058,10 +1058,10 @@  discard block
 block discarded – undo
1058 1058
             $columns = [];
1059 1059
 
1060 1060
             foreach ($constraint['columns'] as $column) {
1061
-                $columns[] = '"' . $column . '"';
1061
+                $columns[] = '"'.$column.'"';
1062 1062
             }
1063 1063
 
1064
-            $annotations[] = '@' . $this->annotationsPrefix . $constraintName . '(name="' . $name . '", columns={' . implode(', ', $columns) . '})';
1064
+            $annotations[] = '@'.$this->annotationsPrefix.$constraintName.'(name="'.$name.'", columns={'.implode(', ', $columns).'})';
1065 1065
         }
1066 1066
 
1067 1067
         return implode(', ', $annotations);
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
     protected function generateInheritanceAnnotation(ClassMetadata $metadata)
1076 1076
     {
1077 1077
         if ($metadata->inheritanceType !== InheritanceType::NONE) {
1078
-            return '@' . $this->annotationsPrefix . 'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1078
+            return '@'.$this->annotationsPrefix.'InheritanceType("'.$this->getInheritanceTypeString($metadata->inheritanceType).'")';
1079 1079
         }
1080 1080
     }
1081 1081
 
@@ -1096,7 +1096,7 @@  discard block
 block discarded – undo
1096 1096
                 $discrColumn->getLength()
1097 1097
             );
1098 1098
 
1099
-            return '@' . $this->annotationsPrefix . 'DiscriminatorColumn(' . $columnDefinition . ')';
1099
+            return '@'.$this->annotationsPrefix.'DiscriminatorColumn('.$columnDefinition.')';
1100 1100
         }
1101 1101
     }
1102 1102
 
@@ -1111,10 +1111,10 @@  discard block
 block discarded – undo
1111 1111
             $inheritanceClassMap = [];
1112 1112
 
1113 1113
             foreach ($metadata->discriminatorMap as $type => $class) {
1114
-                $inheritanceClassMap[] .= '"' . $type . '" = "' . $class . '"';
1114
+                $inheritanceClassMap[] .= '"'.$type.'" = "'.$class.'"';
1115 1115
             }
1116 1116
 
1117
-            return '@' . $this->annotationsPrefix . 'DiscriminatorMap({' . implode(', ', $inheritanceClassMap) . '})';
1117
+            return '@'.$this->annotationsPrefix.'DiscriminatorMap({'.implode(', ', $inheritanceClassMap).'})';
1118 1118
         }
1119 1119
     }
1120 1120
 
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
 
1146 1146
         foreach ($metadata->getDeclaredPropertiesIterator() as $fieldName => $property) {
1147 1147
             if ($property instanceof FieldMetadata) {
1148
-                $nullable  = $property->isNullable() ? 'null' : null;
1148
+                $nullable = $property->isNullable() ? 'null' : null;
1149 1149
 
1150 1150
                 if ($code = $this->generateEntityStubMethod($metadata, 'get', $fieldName, $property->getTypeName(), $nullable)) {
1151 1151
                     $methods[] = $code;
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
         ;
1202 1202
 
1203 1203
         foreach ($joinColumns as $joinColumn) {
1204
-            if (! $joinColumn->isNullable()) {
1204
+            if ( ! $joinColumn->isNullable()) {
1205 1205
                 return false;
1206 1206
             }
1207 1207
         }
@@ -1253,7 +1253,7 @@  discard block
 block discarded – undo
1253 1253
 
1254 1254
             if ($property instanceof FieldMetadata) {
1255 1255
                 $options      = $property->getOptions();
1256
-                $defaultValue = isset($options['default']) ? ' = ' . var_export($options['default'], true) : null;
1256
+                $defaultValue = isset($options['default']) ? ' = '.var_export($options['default'], true) : null;
1257 1257
 
1258 1258
                 $lines[] = $this->generateFieldMappingPropertyDocBlock($property, $metadata);
1259 1259
             } else {
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
                 $lines[] = $this->generateAssociationMappingPropertyDocBlock($property, $metadata);
1263 1263
             }
1264 1264
 
1265
-            $lines[] = $this->spaces . $this->fieldVisibility . ' $' . $fieldName . $defaultValue . ";\n";
1265
+            $lines[] = $this->spaces.$this->fieldVisibility.' $'.$fieldName.$defaultValue.";\n";
1266 1266
         }
1267 1267
 
1268 1268
         return implode("\n", $lines);
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
      */
1301 1301
     protected function generateEntityStubMethod(ClassMetadata $metadata, $type, $fieldName, $typeHint = null, $defaultValue = null)
1302 1302
     {
1303
-        $methodName = $type . Inflector::classify($fieldName);
1303
+        $methodName = $type.Inflector::classify($fieldName);
1304 1304
         $variableName = Inflector::camelize($fieldName);
1305 1305
 
1306 1306
         if (in_array($type, ["add", "remove"])) {
@@ -1321,18 +1321,18 @@  discard block
 block discarded – undo
1321 1321
         $variableType   = $typeHint ? $this->getType($typeHint) : null;
1322 1322
 
1323 1323
         if ($typeHint && ! isset($types[$typeHint])) {
1324
-            $variableType   =  '\\' . ltrim($variableType, '\\');
1325
-            $methodTypeHint =  '\\' . $typeHint . ' ';
1324
+            $variableType   = '\\'.ltrim($variableType, '\\');
1325
+            $methodTypeHint = '\\'.$typeHint.' ';
1326 1326
         }
1327 1327
 
1328 1328
         $replacements = [
1329
-          '<description>'       => ucfirst($type) . ' ' . $variableName . '.',
1329
+          '<description>'       => ucfirst($type).' '.$variableName.'.',
1330 1330
           '<methodTypeHint>'    => $methodTypeHint,
1331
-          '<variableType>'      => $variableType . (null !== $defaultValue ? ('|' . $defaultValue) : ''),
1331
+          '<variableType>'      => $variableType.(null !== $defaultValue ? ('|'.$defaultValue) : ''),
1332 1332
           '<variableName>'      => $variableName,
1333 1333
           '<methodName>'        => $methodName,
1334 1334
           '<fieldName>'         => $fieldName,
1335
-          '<variableDefault>'   => ($defaultValue !== null ) ? (' = ' . $defaultValue) : '',
1335
+          '<variableDefault>'   => ($defaultValue !== null) ? (' = '.$defaultValue) : '',
1336 1336
           '<entity>'            => $this->getClassName($metadata)
1337 1337
         ];
1338 1338
 
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
         $this->staticReflection[$metadata->getClassName()]['methods'][] = $methodName;
1361 1361
 
1362 1362
         $replacements = [
1363
-            '<name>'        => $this->annotationsPrefix . ucfirst($name),
1363
+            '<name>'        => $this->annotationsPrefix.ucfirst($name),
1364 1364
             '<methodName>'  => $methodName,
1365 1365
         ];
1366 1366
 
@@ -1380,25 +1380,25 @@  discard block
 block discarded – undo
1380 1380
      */
1381 1381
     protected function generateIdentifierAnnotation(Property $metadata)
1382 1382
     {
1383
-        $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Id';
1383
+        $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Id';
1384 1384
 
1385 1385
         if ($metadata instanceof FieldMetadata) {
1386 1386
             if ($generatorType = $this->getIdGeneratorTypeString($metadata->getValueGenerator()->getType())) {
1387
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'GeneratedValue(strategy="' . $generatorType . '")';
1387
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'GeneratedValue(strategy="'.$generatorType.'")';
1388 1388
             }
1389 1389
 
1390 1390
             if ($metadata->getValueGenerator()->getType()) {
1391 1391
                 $generator = [];
1392 1392
 
1393 1393
                 if (isset($metadata->getValueGenerator()->getDefinition()['sequenceName'])) {
1394
-                    $generator[] = 'sequenceName="' . $metadata->getValueGenerator()->getDefinition()['sequenceName'] . '"';
1394
+                    $generator[] = 'sequenceName="'.$metadata->getValueGenerator()->getDefinition()['sequenceName'].'"';
1395 1395
                 }
1396 1396
 
1397 1397
                 if (isset($metadata->getValueGenerator()->getDefinition()['allocationSize'])) {
1398
-                    $generator[] = 'allocationSize=' . $metadata->getValueGenerator()->getDefinition()['allocationSize'];
1398
+                    $generator[] = 'allocationSize='.$metadata->getValueGenerator()->getDefinition()['allocationSize'];
1399 1399
                 }
1400 1400
 
1401
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'SequenceGenerator(' . implode(', ', $generator) . ')';
1401
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'SequenceGenerator('.implode(', ', $generator).')';
1402 1402
             }
1403 1403
         }
1404 1404
 
@@ -1414,34 +1414,34 @@  discard block
 block discarded – undo
1414 1414
     {
1415 1415
         $lines            = [];
1416 1416
         $joinTableAnnot   = [];
1417
-        $joinTableAnnot[] = 'name="' . $joinTable->getName() . '"';
1417
+        $joinTableAnnot[] = 'name="'.$joinTable->getName().'"';
1418 1418
 
1419
-        if (! empty($joinTable->getSchema())) {
1420
-            $joinTableAnnot[] = 'schema="' . $joinTable->getSchema() . '"';
1419
+        if ( ! empty($joinTable->getSchema())) {
1420
+            $joinTableAnnot[] = 'schema="'.$joinTable->getSchema().'"';
1421 1421
         }
1422 1422
 
1423
-        $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinTable(' . implode(', ', $joinTableAnnot) . ',';
1424
-        $lines[] = $this->spaces . ' *   joinColumns={';
1423
+        $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinTable('.implode(', ', $joinTableAnnot).',';
1424
+        $lines[] = $this->spaces.' *   joinColumns={';
1425 1425
 
1426 1426
         $joinColumnsLines = [];
1427 1427
 
1428 1428
         foreach ($joinTable->getJoinColumns() as $joinColumn) {
1429
-            $joinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1429
+            $joinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1430 1430
         }
1431 1431
 
1432
-        $lines[] = implode(",". PHP_EOL, $joinColumnsLines);
1433
-        $lines[] = $this->spaces . ' *   },';
1434
-        $lines[] = $this->spaces . ' *   inverseJoinColumns={';
1432
+        $lines[] = implode(",".PHP_EOL, $joinColumnsLines);
1433
+        $lines[] = $this->spaces.' *   },';
1434
+        $lines[] = $this->spaces.' *   inverseJoinColumns={';
1435 1435
 
1436 1436
         $inverseJoinColumnsLines = [];
1437 1437
 
1438 1438
         foreach ($joinTable->getInverseJoinColumns() as $joinColumn) {
1439
-            $inverseJoinColumnsLines[] = $this->spaces . ' *     ' . $this->generateJoinColumnAnnotation($joinColumn);
1439
+            $inverseJoinColumnsLines[] = $this->spaces.' *     '.$this->generateJoinColumnAnnotation($joinColumn);
1440 1440
         }
1441 1441
 
1442
-        $lines[] = implode(",". PHP_EOL, $inverseJoinColumnsLines);
1443
-        $lines[] = $this->spaces . ' *   }';
1444
-        $lines[] = $this->spaces . ' * )';
1442
+        $lines[] = implode(",".PHP_EOL, $inverseJoinColumnsLines);
1443
+        $lines[] = $this->spaces.' *   }';
1444
+        $lines[] = $this->spaces.' * )';
1445 1445
 
1446 1446
         return implode(PHP_EOL, $lines);
1447 1447
     }
@@ -1455,23 +1455,23 @@  discard block
 block discarded – undo
1455 1455
     {
1456 1456
         $joinColumnAnnot = [];
1457 1457
 
1458
-        $joinColumnAnnot[] = 'name="' . $joinColumn->getColumnName() . '"';
1459
-        $joinColumnAnnot[] = 'referencedColumnName="' . $joinColumn->getReferencedColumnName() . '"';
1458
+        $joinColumnAnnot[] = 'name="'.$joinColumn->getColumnName().'"';
1459
+        $joinColumnAnnot[] = 'referencedColumnName="'.$joinColumn->getReferencedColumnName().'"';
1460 1460
 
1461 1461
         if ($joinColumn->isUnique()) {
1462 1462
             $joinColumnAnnot[] = 'unique=true';
1463 1463
         }
1464 1464
 
1465
-        if (!$joinColumn->isNullable()) {
1465
+        if ( ! $joinColumn->isNullable()) {
1466 1466
             $joinColumnAnnot[] = 'nullable=false';
1467 1467
         }
1468 1468
 
1469
-        if (!empty($joinColumn->getOnDelete())) {
1470
-            $joinColumnAnnot[] = 'onDelete="' . $joinColumn->getOnDelete() . '"';
1469
+        if ( ! empty($joinColumn->getOnDelete())) {
1470
+            $joinColumnAnnot[] = 'onDelete="'.$joinColumn->getOnDelete().'"';
1471 1471
         }
1472 1472
 
1473 1473
         if ($joinColumn->getColumnDefinition()) {
1474
-            $joinColumnAnnot[] = 'columnDefinition="' . $joinColumn->getColumnDefinition() . '"';
1474
+            $joinColumnAnnot[] = 'columnDefinition="'.$joinColumn->getColumnDefinition().'"';
1475 1475
         }
1476 1476
 
1477 1477
         $options = [];
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
             $joinColumnAnnot[] = 'options={'.implode(',', $options).'}';
1487 1487
         }
1488 1488
 
1489
-        return '@' . $this->annotationsPrefix . 'JoinColumn(' . implode(', ', $joinColumnAnnot) . ')';
1489
+        return '@'.$this->annotationsPrefix.'JoinColumn('.implode(', ', $joinColumnAnnot).')';
1490 1490
     }
1491 1491
 
1492 1492
     /**
@@ -1498,16 +1498,16 @@  discard block
 block discarded – undo
1498 1498
     protected function generateAssociationMappingPropertyDocBlock(AssociationMetadata $association, ClassMetadata $metadata)
1499 1499
     {
1500 1500
         $lines = [];
1501
-        $lines[] = $this->spaces . '/**';
1501
+        $lines[] = $this->spaces.'/**';
1502 1502
 
1503 1503
         if ($association instanceof ToManyAssociationMetadata) {
1504
-            $lines[] = $this->spaces . ' * @var \Doctrine\Common\Collections\Collection';
1504
+            $lines[] = $this->spaces.' * @var \Doctrine\Common\Collections\Collection';
1505 1505
         } else {
1506
-            $lines[] = $this->spaces . ' * @var \\' . ltrim($association->getTargetEntity(), '\\');
1506
+            $lines[] = $this->spaces.' * @var \\'.ltrim($association->getTargetEntity(), '\\');
1507 1507
         }
1508 1508
 
1509 1509
         if ($this->generateAnnotations) {
1510
-            $lines[] = $this->spaces . ' *';
1510
+            $lines[] = $this->spaces.' *';
1511 1511
 
1512 1512
             if ($association->isPrimaryKey()) {
1513 1513
                 $lines[] = $this->generateIdentifierAnnotation($association);
@@ -1527,18 +1527,18 @@  discard block
 block discarded – undo
1527 1527
 
1528 1528
             $typeOptions = [];
1529 1529
 
1530
-            $typeOptions[] = 'targetEntity="' . $association->getTargetEntity() . '"';
1530
+            $typeOptions[] = 'targetEntity="'.$association->getTargetEntity().'"';
1531 1531
 
1532 1532
             if ($association->getMappedBy()) {
1533
-                $typeOptions[] = 'mappedBy="' . $association->getMappedBy() . '"';
1533
+                $typeOptions[] = 'mappedBy="'.$association->getMappedBy().'"';
1534 1534
             }
1535 1535
 
1536 1536
             if ($association->getInversedBy()) {
1537
-                $typeOptions[] = 'inversedBy="' . $association->getInversedBy() . '"';
1537
+                $typeOptions[] = 'inversedBy="'.$association->getInversedBy().'"';
1538 1538
             }
1539 1539
 
1540 1540
             if ($association instanceof ToManyAssociationMetadata && $association->getIndexedBy()) {
1541
-                $typeOptions[] = 'indexBy="' . $association->getIndexedBy() . '"';
1541
+                $typeOptions[] = 'indexBy="'.$association->getIndexedBy().'"';
1542 1542
             }
1543 1543
 
1544 1544
             if ($association->isOrphanRemoval()) {
@@ -1558,28 +1558,28 @@  discard block
 block discarded – undo
1558 1558
                     $cascades = ['"all"'];
1559 1559
                 }
1560 1560
 
1561
-                $typeOptions[] = 'cascade={' . implode(',', $cascades) . '}';
1561
+                $typeOptions[] = 'cascade={'.implode(',', $cascades).'}';
1562 1562
             }
1563 1563
 
1564 1564
             if ($association->getFetchMode() !== FetchMode::LAZY) {
1565
-                $typeOptions[] = 'fetch="' . $association->getFetchMode() . '"';
1565
+                $typeOptions[] = 'fetch="'.$association->getFetchMode().'"';
1566 1566
             }
1567 1567
 
1568
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . '' . $type . '(' . implode(', ', $typeOptions) . ')';
1568
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.''.$type.'('.implode(', ', $typeOptions).')';
1569 1569
 
1570 1570
             if ($association instanceof ToOneAssociationMetadata && $association->getJoinColumns()) {
1571
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'JoinColumns({';
1571
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'JoinColumns({';
1572 1572
 
1573 1573
                 $joinColumnsLines = [];
1574 1574
 
1575 1575
                 foreach ($association->getJoinColumns() as $joinColumn) {
1576 1576
                     if ($joinColumnAnnot = $this->generateJoinColumnAnnotation($joinColumn)) {
1577
-                        $joinColumnsLines[] = $this->spaces . ' *   ' . $joinColumnAnnot;
1577
+                        $joinColumnsLines[] = $this->spaces.' *   '.$joinColumnAnnot;
1578 1578
                     }
1579 1579
                 }
1580 1580
 
1581 1581
                 $lines[] = implode(",\n", $joinColumnsLines);
1582
-                $lines[] = $this->spaces . ' * })';
1582
+                $lines[] = $this->spaces.' * })';
1583 1583
             }
1584 1584
 
1585 1585
             if ($association instanceof ToManyAssociationMetadata) {
@@ -1588,20 +1588,20 @@  discard block
 block discarded – undo
1588 1588
                 }
1589 1589
 
1590 1590
                 if ($association->getOrderBy()) {
1591
-                    $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'OrderBy({';
1591
+                    $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'OrderBy({';
1592 1592
                     $orderBy = [];
1593 1593
 
1594 1594
                     foreach ($association->getOrderBy() as $name => $direction) {
1595
-                        $orderBy[] = $this->spaces . ' *     "' . $name . '"="' . $direction . '"';
1595
+                        $orderBy[] = $this->spaces.' *     "'.$name.'"="'.$direction.'"';
1596 1596
                     }
1597 1597
 
1598
-                    $lines[] = implode(',' . PHP_EOL, $orderBy);
1599
-                    $lines[] = $this->spaces . ' * })';
1598
+                    $lines[] = implode(','.PHP_EOL, $orderBy);
1599
+                    $lines[] = $this->spaces.' * })';
1600 1600
                 }
1601 1601
             }
1602 1602
         }
1603 1603
 
1604
-        $lines[] = $this->spaces . ' */';
1604
+        $lines[] = $this->spaces.' */';
1605 1605
 
1606 1606
         return implode("\n", $lines);
1607 1607
     }
@@ -1618,43 +1618,43 @@  discard block
 block discarded – undo
1618 1618
 
1619 1619
         $lines = [];
1620 1620
 
1621
-        $lines[] = $this->spaces . '/**';
1622
-        $lines[] = $this->spaces . ' * @var '
1621
+        $lines[] = $this->spaces.'/**';
1622
+        $lines[] = $this->spaces.' * @var '
1623 1623
             . $this->getType($fieldType)
1624 1624
             . ($propertyMetadata->isNullable() ? '|null' : '');
1625 1625
 
1626 1626
         if ($this->generateAnnotations) {
1627 1627
             $column  = [];
1628
-            $lines[] = $this->spaces . ' *';
1628
+            $lines[] = $this->spaces.' *';
1629 1629
 
1630 1630
             if ($propertyMetadata->getColumnName()) {
1631
-                $column[] = 'name="' . $propertyMetadata->getColumnName() . '"';
1631
+                $column[] = 'name="'.$propertyMetadata->getColumnName().'"';
1632 1632
             }
1633 1633
 
1634
-            $column[] = 'type="' . $fieldType . '"';
1634
+            $column[] = 'type="'.$fieldType.'"';
1635 1635
 
1636 1636
             if (is_int($propertyMetadata->getLength())) {
1637
-                $column[] = 'length=' . $propertyMetadata->getLength();
1637
+                $column[] = 'length='.$propertyMetadata->getLength();
1638 1638
             }
1639 1639
 
1640 1640
             if (is_int($propertyMetadata->getPrecision())) {
1641
-                $column[] = 'precision=' .  $propertyMetadata->getPrecision();
1641
+                $column[] = 'precision='.$propertyMetadata->getPrecision();
1642 1642
             }
1643 1643
 
1644 1644
             if (is_int($propertyMetadata->getScale())) {
1645
-                $column[] = 'scale=' .  $propertyMetadata->getScale();
1645
+                $column[] = 'scale='.$propertyMetadata->getScale();
1646 1646
             }
1647 1647
 
1648 1648
             if ($propertyMetadata->isNullable()) {
1649
-                $column[] = 'nullable=' .  var_export($propertyMetadata->isNullable(), true);
1649
+                $column[] = 'nullable='.var_export($propertyMetadata->isNullable(), true);
1650 1650
             }
1651 1651
 
1652 1652
             if ($propertyMetadata->isUnique()) {
1653
-                $column[] = 'unique=' . var_export($propertyMetadata->isUnique(), true);
1653
+                $column[] = 'unique='.var_export($propertyMetadata->isUnique(), true);
1654 1654
             }
1655 1655
 
1656 1656
             if ($propertyMetadata->getColumnDefinition()) {
1657
-                $column[] = 'columnDefinition="' . $propertyMetadata->getColumnDefinition() . '"';
1657
+                $column[] = 'columnDefinition="'.$propertyMetadata->getColumnDefinition().'"';
1658 1658
             }
1659 1659
 
1660 1660
             $options = [];
@@ -1669,18 +1669,18 @@  discard block
 block discarded – undo
1669 1669
                 $column[] = 'options={'.implode(',', $options).'}';
1670 1670
             }
1671 1671
 
1672
-            $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Column(' . implode(', ', $column) . ')';
1672
+            $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Column('.implode(', ', $column).')';
1673 1673
 
1674 1674
             if ($propertyMetadata->isPrimaryKey()) {
1675 1675
                 $lines[] = $this->generateIdentifierAnnotation($propertyMetadata);
1676 1676
             }
1677 1677
 
1678 1678
             if ($metadata->isVersioned() && $metadata->versionProperty->getName() === $propertyMetadata->getName()) {
1679
-                $lines[] = $this->spaces . ' * @' . $this->annotationsPrefix . 'Version';
1679
+                $lines[] = $this->spaces.' * @'.$this->annotationsPrefix.'Version';
1680 1680
             }
1681 1681
         }
1682 1682
 
1683
-        $lines[] = $this->spaces . ' */';
1683
+        $lines[] = $this->spaces.' */';
1684 1684
 
1685 1685
         return implode("\n", $lines);
1686 1686
     }
@@ -1693,27 +1693,27 @@  discard block
 block discarded – undo
1693 1693
     protected function generateEmbeddedPropertyDocBlock(array $embeddedClass)
1694 1694
     {
1695 1695
         $lines = [];
1696
-        $lines[] = $this->spaces . '/**';
1697
-        $lines[] = $this->spaces . ' * @var \\' . ltrim($embeddedClass['class'], '\\');
1696
+        $lines[] = $this->spaces.'/**';
1697
+        $lines[] = $this->spaces.' * @var \\'.ltrim($embeddedClass['class'], '\\');
1698 1698
 
1699 1699
         if ($this->generateAnnotations) {
1700
-            $lines[] = $this->spaces . ' *';
1700
+            $lines[] = $this->spaces.' *';
1701 1701
 
1702
-            $embedded = ['class="' . $embeddedClass['class'] . '"'];
1702
+            $embedded = ['class="'.$embeddedClass['class'].'"'];
1703 1703
 
1704 1704
             if (isset($embeddedClass['columnPrefix'])) {
1705 1705
                 if (is_string($embeddedClass['columnPrefix'])) {
1706
-                    $embedded[] = 'columnPrefix="' . $embeddedClass['columnPrefix'] . '"';
1706
+                    $embedded[] = 'columnPrefix="'.$embeddedClass['columnPrefix'].'"';
1707 1707
                 } else {
1708
-                    $embedded[] = 'columnPrefix=' . var_export($embeddedClass['columnPrefix'], true);
1708
+                    $embedded[] = 'columnPrefix='.var_export($embeddedClass['columnPrefix'], true);
1709 1709
                 }
1710 1710
             }
1711 1711
 
1712
-            $lines[] = $this->spaces . ' * @' .
1713
-                $this->annotationsPrefix . 'Embedded(' . implode(', ', $embedded) . ')';
1712
+            $lines[] = $this->spaces.' * @'.
1713
+                $this->annotationsPrefix.'Embedded('.implode(', ', $embedded).')';
1714 1714
         }
1715 1715
 
1716
-        $lines[] = $this->spaces . ' */';
1716
+        $lines[] = $this->spaces.' */';
1717 1717
 
1718 1718
         return implode("\n", $lines);
1719 1719
     }
@@ -1730,7 +1730,7 @@  discard block
 block discarded – undo
1730 1730
 
1731 1731
         foreach ($lines as $key => $value) {
1732 1732
             if ( ! empty($value)) {
1733
-                $lines[$key] = str_repeat($this->spaces, $num) . $lines[$key];
1733
+                $lines[$key] = str_repeat($this->spaces, $num).$lines[$key];
1734 1734
             }
1735 1735
         }
1736 1736
 
@@ -1798,8 +1798,8 @@  discard block
 block discarded – undo
1798 1798
 
1799 1799
         foreach ($options as $name => $option) {
1800 1800
             $optionValue = is_array($option)
1801
-                ? '{' . $this->exportTableOptions($option) . '}'
1802
-                : '"' . (string) $option . '"'
1801
+                ? '{'.$this->exportTableOptions($option).'}'
1802
+                : '"'.(string) $option.'"'
1803 1803
             ;
1804 1804
 
1805 1805
             $optionsStr[] = sprintf('"%s"=%s', $name, $optionValue);
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/DebugUnitOfWorkListener.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\Tools;
6 6
 
@@ -76,20 +76,20 @@  discard block
 block discarded – undo
76 76
         fwrite($fh, "Flush Operation [".$this->context."] - Dumping identity map:\n");
77 77
 
78 78
         foreach ($identityMap as $className => $map) {
79
-            fwrite($fh, "Class: ". $className . "\n");
79
+            fwrite($fh, "Class: ".$className."\n");
80 80
 
81 81
             foreach ($map as $entity) {
82
-                fwrite($fh, " Entity: " . $this->getIdString($entity, $uow) . " " . spl_object_hash($entity)."\n");
82
+                fwrite($fh, " Entity: ".$this->getIdString($entity, $uow)." ".spl_object_hash($entity)."\n");
83 83
                 fwrite($fh, "  Associations:\n");
84 84
 
85 85
                 $cm = $em->getClassMetadata($className);
86 86
 
87 87
                 foreach ($cm->getDeclaredPropertiesIterator() as $field => $association) {
88
-                    if (! ($association instanceof AssociationMetadata)) {
88
+                    if ( ! ($association instanceof AssociationMetadata)) {
89 89
                         continue;
90 90
                     }
91 91
 
92
-                    fwrite($fh, "   " . $field . " ");
92
+                    fwrite($fh, "   ".$field." ");
93 93
 
94 94
                     $value = $association->getValue($entity);
95 95
 
@@ -100,25 +100,25 @@  discard block
 block discarded – undo
100 100
                     }
101 101
 
102 102
                     if ($association instanceof ToOneAssociationMetadata) {
103
-                        if ($value instanceof Proxy && !$value->__isInitialized()) {
103
+                        if ($value instanceof Proxy && ! $value->__isInitialized()) {
104 104
                             fwrite($fh, "[PROXY] ");
105 105
                         }
106 106
 
107
-                        fwrite($fh, $this->getIdString($value, $uow) . " " . spl_object_hash($value) . "\n");
107
+                        fwrite($fh, $this->getIdString($value, $uow)." ".spl_object_hash($value)."\n");
108 108
                     } else {
109
-                        $initialized = !($value instanceof PersistentCollection) || $value->isInitialized();
109
+                        $initialized = ! ($value instanceof PersistentCollection) || $value->isInitialized();
110 110
 
111 111
                         if ($initialized) {
112
-                            fwrite($fh, "[INITIALIZED] " . $this->getType($value). " " . count($value) . " elements\n");
112
+                            fwrite($fh, "[INITIALIZED] ".$this->getType($value)." ".count($value)." elements\n");
113 113
 
114 114
                             foreach ($value as $obj) {
115
-                                fwrite($fh, "    " . $this->getIdString($obj, $uow) . " " . spl_object_hash($obj)."\n");
115
+                                fwrite($fh, "    ".$this->getIdString($obj, $uow)." ".spl_object_hash($obj)."\n");
116 116
                             }
117 117
                         } else {
118
-                            fwrite($fh, "[PROXY] " . $this->getType($value) . " unknown element size\n");
118
+                            fwrite($fh, "[PROXY] ".$this->getType($value)." unknown element size\n");
119 119
 
120 120
                             foreach ($value->unwrap() as $obj) {
121
-                                fwrite($fh, "    " . $this->getIdString($obj, $uow) . " " . spl_object_hash($obj)."\n");
121
+                                fwrite($fh, "    ".$this->getIdString($obj, $uow)." ".spl_object_hash($obj)."\n");
122 122
                             }
123 123
                         }
124 124
                     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +17 added lines, -17 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\Tools;
6 6
 
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
                     $pkColumns = [];
181 181
 
182 182
                     foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
183
-                        if (! ($property instanceof FieldMetadata)) {
183
+                        if ( ! ($property instanceof FieldMetadata)) {
184 184
                             continue;
185 185
                         }
186 186
 
187
-                        if (! $class->isInheritedProperty($fieldName)) {
187
+                        if ( ! $class->isInheritedProperty($fieldName)) {
188 188
                             $columnName = $this->platform->quoteIdentifier($property->getColumnName());
189 189
 
190 190
                             $this->gatherColumn($class, $property, $table);
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
             $processedClasses[$class->getClassName()] = true;
327 327
 
328 328
             foreach ($class->getDeclaredPropertiesIterator() as $property) {
329
-                if (! $property instanceof FieldMetadata
329
+                if ( ! $property instanceof FieldMetadata
330 330
                     || ! $property->hasValueGenerator()
331 331
                     || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE
332 332
                     || $class->getClassName() !== $class->getRootClassName()) {
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
                 $quotedName = $this->platform->quoteIdentifier($property->getValueGenerator()->getDefinition()['sequenceName']);
337 337
 
338
-                if (! $schema->hasSequence($quotedName)) {
338
+                if ( ! $schema->hasSequence($quotedName)) {
339 339
                     $schema->createSequence($quotedName, $property->getValueGenerator()->getDefinition()['allocationSize']);
340 340
                 }
341 341
             }
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
             }
349 349
         }
350 350
 
351
-        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas() ) {
351
+        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
352 352
             $schema->visit(new RemoveNamespacedAssets());
353 353
         }
354 354
 
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
                 break;
391 391
         }
392 392
 
393
-        if (!empty($discrColumn->getColumnDefinition())) {
393
+        if ( ! empty($discrColumn->getColumnDefinition())) {
394 394
             $options['columnDefinition'] = $discrColumn->getColumnDefinition();
395 395
         }
396 396
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         $pkColumns = [];
412 412
 
413 413
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
414
-            if (! ($property instanceof FieldMetadata)) {
414
+            if ( ! ($property instanceof FieldMetadata)) {
415 415
                 continue;
416 416
             }
417 417
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
     private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)
530 530
     {
531 531
         foreach ($class->getDeclaredPropertiesIterator() as $fieldName => $property) {
532
-            if (! ($property instanceof AssociationMetadata)) {
532
+            if ( ! ($property instanceof AssociationMetadata)) {
533 533
                 continue;
534 534
             }
535 535
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
                 continue;
538 538
             }
539 539
 
540
-            if (! $property->isOwningSide()) {
540
+            if ( ! $property->isOwningSide()) {
541 541
                 continue;
542 542
             }
543 543
 
@@ -627,7 +627,7 @@  discard block
 block discarded – undo
627 627
         $idColumns        = $class->getIdentifierColumns($this->em);
628 628
         $idColumnNameList = array_keys($idColumns);
629 629
 
630
-        if (! in_array($referencedColumnName, $idColumnNameList)) {
630
+        if ( ! in_array($referencedColumnName, $idColumnNameList)) {
631 631
             return null;
632 632
         }
633 633
 
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
         foreach ($class->getIdentifierFieldNames() as $fieldName) {
636 636
             $property = $class->getProperty($fieldName);
637 637
 
638
-            if (! ($property instanceof AssociationMetadata)) {
638
+            if ( ! ($property instanceof AssociationMetadata)) {
639 639
                 continue;
640 640
             }
641 641
 
@@ -717,7 +717,7 @@  discard block
 block discarded – undo
717 717
                 $property  = $definingClass->getProperty($referencedFieldName);
718 718
                 $columnDef = null;
719 719
 
720
-                if (!empty($joinColumn->getColumnDefinition())) {
720
+                if ( ! empty($joinColumn->getColumnDefinition())) {
721 721
                     $columnDef = $joinColumn->getColumnDefinition();
722 722
                 } elseif ($property->getColumnDefinition()) {
723 723
                     $columnDef = $property->getColumnDefinition();
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
 
726 726
                 $columnType    = $property->getTypeName();
727 727
                 $columnOptions = [
728
-                    'notnull'          => !$joinColumn->isNullable(),
728
+                    'notnull'          => ! $joinColumn->isNullable(),
729 729
                     'columnDefinition' => $columnDef,
730 730
                 ];
731 731
 
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
                 $uniqueConstraints[] = ['columns' => [$quotedColumnName]];
752 752
             }
753 753
 
754
-            if (!empty($joinColumn->getOnDelete())) {
754
+            if ( ! empty($joinColumn->getOnDelete())) {
755 755
                 $fkOptions['onDelete'] = $joinColumn->getOnDelete();
756 756
             }
757 757
         }
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
             }
780 780
 
781 781
             $blacklistedFks[$compositeName] = true;
782
-        } elseif (!isset($blacklistedFks[$compositeName])) {
782
+        } elseif ( ! isset($blacklistedFks[$compositeName])) {
783 783
             $addedFks[$compositeName] = [
784 784
                 'foreignTableName' => $foreignTableName,
785 785
                 'foreignColumns'   => $foreignColumns
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
                 if ($table->hasPrimaryKey()) {
891 891
                     $columns = $table->getPrimaryKey()->getColumns();
892 892
                     if (count($columns) == 1) {
893
-                        $checkSequence = $table->getName() . "_" . $columns[0] . "_seq";
893
+                        $checkSequence = $table->getName()."_".$columns[0]."_seq";
894 894
                         if ($fullSchema->hasSequence($checkSequence)) {
895 895
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
896 896
                         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/DefaultCache.php 1 patch
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Cache;
7 7
 
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
         foreach ($metadatas as $metadata) {
207 207
             foreach ($metadata->getDeclaredPropertiesIterator() as $association) {
208
-                if (! $association instanceof ToManyAssociationMetadata) {
208
+                if ( ! $association instanceof ToManyAssociationMetadata) {
209 209
                     continue;
210 210
                 }
211 211
 
@@ -262,8 +262,7 @@  discard block
 block discarded – undo
262 262
     public function getQueryCache($regionName = null)
263 263
     {
264 264
         if ($regionName === null) {
265
-            return $this->defaultQueryCache ?:
266
-                $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em);
265
+            return $this->defaultQueryCache ?: $this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em);
267 266
         }
268 267
 
269 268
         if ( ! isset($this->queryCaches[$regionName])) {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-declare(strict_types=1);
4
+declare(strict_types = 1);
5 5
 
6 6
 namespace Doctrine\ORM\Cache;
7 7
 
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
         $data = array_merge($data, $persister->getIdentifier($entity)); // why update has no identifier values ?
60 60
 
61 61
         foreach ($metadata->getDeclaredPropertiesIterator() as $name => $association) {
62
-            if (! isset($data[$name]) || $association instanceof FieldMetadata) {
62
+            if ( ! isset($data[$name]) || $association instanceof FieldMetadata) {
63 63
                 continue;
64 64
             }
65 65
 
66
-            if (! $association instanceof ToOneAssociationMetadata) {
66
+            if ( ! $association instanceof ToOneAssociationMetadata) {
67 67
                 unset($data[$name]);
68 68
 
69 69
                 continue;
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
             $targetClassMetadata = $this->em->getClassMetadata($targetEntity);
74 74
             $targetPersister     = $this->uow->getEntityPersister($targetEntity);
75 75
 
76
-            if (! $association->getCache()) {
76
+            if ( ! $association->getCache()) {
77 77
                 $owningAssociation   = ! $association->isOwningSide()
78 78
                     ? $targetClassMetadata->getProperty($association->getMappedBy())
79 79
                     : $association;
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
                 continue;
122 122
             }
123 123
 
124
-            if (! $association->isPrimaryKey()) {
124
+            if ( ! $association->isPrimaryKey()) {
125 125
                 $targetClass = ClassUtils::getClass($data[$name]);
126 126
                 $targetId    = $this->uow->getEntityIdentifier($data[$name]);
127 127
                 $data[$name] = new AssociationCacheEntry($targetClass, $targetId);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 ($association instanceof OneToOneAssociationMetadata && ! $association->isOwningSide())
172 172
             );
173 173
 
174
-            if (! $isEagerLoad) {
174
+            if ( ! $isEagerLoad) {
175 175
                 $data[$name] = $this->em->getReference($assocClass, $assocId);
176 176
 
177 177
                 continue;
Please login to merge, or discard this patch.