Completed
Pull Request — master (#7902)
by
unknown
63:54
created
lib/Doctrine/ORM/Internal/Hydration/ArrayHydrator.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -85,10 +85,10 @@  discard block
 block discarded – undo
85 85
                 // It's a joined result
86 86
 
87 87
                 $parent = $this->rsm->parentAliasMap[$dqlAlias];
88
-                $path   = $parent . '.' . $dqlAlias;
88
+                $path   = $parent.'.'.$dqlAlias;
89 89
 
90 90
                 // missing parent data, skipping as RIGHT JOIN hydration is not supported.
91
-                if (! isset($nonemptyComponents[$parent])) {
91
+                if ( ! isset($nonemptyComponents[$parent])) {
92 92
                     continue;
93 93
                 }
94 94
 
@@ -97,9 +97,9 @@  discard block
 block discarded – undo
97 97
                 if ($this->rsm->isMixed && isset($this->rootAliases[$parent])) {
98 98
                     $first = \reset($this->resultPointers);
99 99
                     // TODO: Exception if $key === null ?
100
-                    $baseElement =& $this->resultPointers[$parent][\key($first)];
100
+                    $baseElement = & $this->resultPointers[$parent][\key($first)];
101 101
                 } elseif (isset($this->resultPointers[$parent])) {
102
-                    $baseElement =& $this->resultPointers[$parent];
102
+                    $baseElement = & $this->resultPointers[$parent];
103 103
                 } else {
104 104
                     unset($this->resultPointers[$dqlAlias]); // Ticket #1228
105 105
 
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
                 $relation      = $parentClass->getProperty($relationAlias);
112 112
 
113 113
                 // Check the type of the relation (many or single-valued)
114
-                if (! $relation instanceof ToOneAssociationMetadata) {
114
+                if ( ! $relation instanceof ToOneAssociationMetadata) {
115 115
                     $oneToOne = false;
116 116
 
117
-                    if (! isset($baseElement[$relationAlias])) {
117
+                    if ( ! isset($baseElement[$relationAlias])) {
118 118
                         $baseElement[$relationAlias] = [];
119 119
                     }
120 120
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                         $index        = $indexExists ? $this->identifierMap[$path][$id[$parent]][$id[$dqlAlias]] : false;
124 124
                         $indexIsValid = $index !== false ? isset($baseElement[$relationAlias][$index]) : false;
125 125
 
126
-                        if (! $indexExists || ! $indexIsValid) {
126
+                        if ( ! $indexExists || ! $indexIsValid) {
127 127
                             $element = $data;
128 128
 
129 129
                             if (isset($this->rsm->indexByMap[$dqlAlias])) {
@@ -140,16 +140,16 @@  discard block
 block discarded – undo
140 140
                 } else {
141 141
                     $oneToOne = true;
142 142
 
143
-                    if (! isset($nonemptyComponents[$dqlAlias]) &&
143
+                    if ( ! isset($nonemptyComponents[$dqlAlias]) &&
144 144
                         ( ! isset($baseElement[$relationAlias]))
145 145
                     ) {
146 146
                         $baseElement[$relationAlias] = null;
147
-                    } elseif (! isset($baseElement[$relationAlias])) {
147
+                    } elseif ( ! isset($baseElement[$relationAlias])) {
148 148
                         $baseElement[$relationAlias] = $data;
149 149
                     }
150 150
                 }
151 151
 
152
-                $coll =& $baseElement[$relationAlias];
152
+                $coll = & $baseElement[$relationAlias];
153 153
 
154 154
                 if (\is_array($coll)) {
155 155
                     $this->updateResultPointer($coll, $index, $dqlAlias, $oneToOne);
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 $entityKey                    = $this->rsm->entityMappings[$dqlAlias] ?: 0;
162 162
 
163 163
                 // if this row has a NULL value for the root result id then make it a null result.
164
-                if (! isset($nonemptyComponents[$dqlAlias])) {
164
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
165 165
                     $result[] = $this->rsm->isMixed
166 166
                         ? [$entityKey => null]
167 167
                         : null;
@@ -198,13 +198,13 @@  discard block
 block discarded – undo
198 198
             }
199 199
         }
200 200
 
201
-        if (! isset($resultKey)) {
201
+        if ( ! isset($resultKey)) {
202 202
             $this->resultCounter++;
203 203
         }
204 204
 
205 205
         // Append scalar values to mixed result sets
206 206
         if (isset($rowData['scalars'])) {
207
-            if (! isset($resultKey)) {
207
+            if ( ! isset($resultKey)) {
208 208
                 // this only ever happens when no object is fetched (scalar result only)
209 209
                 $resultKey = isset($this->rsm->indexByMap['scalars'])
210 210
                     ? $row[$this->rsm->indexByMap['scalars']]
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
         // Append new object to mixed result sets
220 220
         if (isset($rowData['newObjects'])) {
221
-            if (! isset($resultKey)) {
221
+            if ( ! isset($resultKey)) {
222 222
                 $resultKey = $this->resultCounter - 1;
223 223
             }
224 224
 
@@ -259,22 +259,22 @@  discard block
 block discarded – undo
259 259
         }
260 260
 
261 261
         if ($oneToOne) {
262
-            $this->resultPointers[$dqlAlias] =& $coll;
262
+            $this->resultPointers[$dqlAlias] = & $coll;
263 263
 
264 264
             return;
265 265
         }
266 266
 
267 267
         if ($index !== false) {
268
-            $this->resultPointers[$dqlAlias] =& $coll[$index];
268
+            $this->resultPointers[$dqlAlias] = & $coll[$index];
269 269
 
270 270
             return;
271 271
         }
272 272
 
273
-        if (! $coll) {
273
+        if ( ! $coll) {
274 274
             return;
275 275
         }
276 276
 
277 277
         \end($coll);
278
-        $this->resultPointers[$dqlAlias] =& $coll[\key($coll)];
278
+        $this->resultPointers[$dqlAlias] = & $coll[\key($coll)];
279 279
     }
280 280
 }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     protected function prepare()
55 55
     {
56
-        if (! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) {
56
+        if ( ! isset($this->hints[UnitOfWork::HINT_DEFEREAGERLOAD])) {
57 57
             $this->hints[UnitOfWork::HINT_DEFEREAGERLOAD] = true;
58 58
         }
59 59
 
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
 
64 64
             // Remember which associations are "fetch joined", so that we know where to inject
65 65
             // collection stubs or proxies and where not.
66
-            if (! isset($this->rsm->relationMap[$dqlAlias])) {
66
+            if ( ! isset($this->rsm->relationMap[$dqlAlias])) {
67 67
                 continue;
68 68
             }
69 69
 
70 70
             $parent = $this->rsm->parentAliasMap[$dqlAlias];
71 71
 
72
-            if (! isset($this->rsm->aliasMap[$parent])) {
72
+            if ( ! isset($this->rsm->aliasMap[$parent])) {
73 73
                 throw HydrationException::parentObjectOfRelationNotFound($dqlAlias, $parent);
74 74
             }
75 75
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 $class        = $this->getClassMetadata($className);
96 96
                 $inverseAssoc = $class->getProperty($association->getInversedBy());
97 97
 
98
-                if (! ($inverseAssoc instanceof ToOneAssociationMetadata)) {
98
+                if ( ! ($inverseAssoc instanceof ToOneAssociationMetadata)) {
99 99
                     continue;
100 100
                 }
101 101
 
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
         $value       = $association->getValue($entity);
162 162
         $oid         = spl_object_id($entity);
163 163
 
164
-        if (! $value instanceof PersistentCollection) {
164
+        if ( ! $value instanceof PersistentCollection) {
165 165
             $value = $association->wrap($entity, $value, $this->em);
166 166
 
167 167
             $association->setValue($entity, $value);
168 168
 
169 169
             $this->uow->setOriginalEntityProperty($oid, $fieldName, $value);
170 170
 
171
-            $this->initializedCollections[$oid . $fieldName] = $value;
171
+            $this->initializedCollections[$oid.$fieldName] = $value;
172 172
         } elseif (isset($this->hints[Query::HINT_REFRESH]) ||
173 173
             (isset($this->hints['fetched'][$parentDqlAlias][$fieldName]) && ! $value->isInitialized())
174 174
         ) {
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
             $value->setInitialized(true);
178 178
             $value->unwrap()->clear();
179 179
 
180
-            $this->initializedCollections[$oid . $fieldName] = $value;
180
+            $this->initializedCollections[$oid.$fieldName] = $value;
181 181
         } else {
182 182
             // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN!
183
-            $this->existingCollections[$oid . $fieldName] = $value;
183
+            $this->existingCollections[$oid.$fieldName] = $value;
184 184
         }
185 185
 
186 186
         return $value;
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
         if (isset($this->rsm->discriminatorColumns[$dqlAlias])) {
204 204
             $fieldName = $this->rsm->discriminatorColumns[$dqlAlias];
205 205
 
206
-            if (! isset($this->rsm->metaMappings[$fieldName])) {
206
+            if ( ! isset($this->rsm->metaMappings[$fieldName])) {
207 207
                 throw HydrationException::missingDiscriminatorMetaMappingColumn($className, $fieldName, $dqlAlias);
208 208
             }
209 209
 
210 210
             $discrColumn = $this->rsm->metaMappings[$fieldName];
211 211
 
212
-            if (! isset($data[$discrColumn])) {
212
+            if ( ! isset($data[$discrColumn])) {
213 213
                 throw HydrationException::missingDiscriminatorColumn($className, $discrColumn, $dqlAlias);
214 214
             }
215 215
 
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             $discrMap           = $this->metadataCache[$className]->discriminatorMap;
221 221
             $discriminatorValue = (string) $data[$discrColumn];
222 222
 
223
-            if (! isset($discrMap[$discriminatorValue])) {
223
+            if ( ! isset($discrMap[$discriminatorValue])) {
224 224
                 throw HydrationException::invalidDiscriminatorValue($discriminatorValue, \array_keys($discrMap));
225 225
             }
226 226
 
@@ -296,10 +296,10 @@  discard block
 block discarded – undo
296 296
                 $parentAlias = $this->rsm->parentAliasMap[$dqlAlias];
297 297
                 // we need the $path to save into the identifier map which entities were already
298 298
                 // seen for this parent-child relationship
299
-                $path = $parentAlias . '.' . $dqlAlias;
299
+                $path = $parentAlias.'.'.$dqlAlias;
300 300
 
301 301
                 // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs
302
-                if (! isset($nonemptyComponents[$parentAlias])) {
302
+                if ( ! isset($nonemptyComponents[$parentAlias])) {
303 303
                     // TODO: Add special case code where we hydrate the right join objects into identity map at least
304 304
                     continue;
305 305
                 }
@@ -330,15 +330,15 @@  discard block
 block discarded – undo
330 330
                 $oid = spl_object_id($parentObject);
331 331
 
332 332
                 // Check the type of the relation (many or single-valued)
333
-                if (! ($association instanceof ToOneAssociationMetadata)) {
333
+                if ( ! ($association instanceof ToOneAssociationMetadata)) {
334 334
                     // PATH A: Collection-valued association
335 335
                     $reflFieldValue = $association->getValue($parentObject);
336 336
 
337 337
                     if (isset($nonemptyComponents[$dqlAlias])) {
338
-                        $collKey = $oid . $relationField;
338
+                        $collKey = $oid.$relationField;
339 339
                         if (isset($this->initializedCollections[$collKey])) {
340 340
                             $reflFieldValue = $this->initializedCollections[$collKey];
341
-                        } elseif (! isset($this->existingCollections[$collKey])) {
341
+                        } elseif ( ! isset($this->existingCollections[$collKey])) {
342 342
                             $reflFieldValue = $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias);
343 343
                         }
344 344
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                         $index        = $indexExists ? $this->identifierMap[$path][$id[$parentAlias]][$id[$dqlAlias]] : false;
347 347
                         $indexIsValid = $index !== false ? isset($reflFieldValue[$index]) : false;
348 348
 
349
-                        if (! $indexExists || ! $indexIsValid) {
349
+                        if ( ! $indexExists || ! $indexIsValid) {
350 350
                             if (isset($this->existingCollections[$collKey])) {
351 351
                                 $element = $this->getEntityFromIdentityMap($entityName, $data);
352 352
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                             // Update result pointer
376 376
                             $this->resultPointers[$dqlAlias] = $reflFieldValue[$index];
377 377
                         }
378
-                    } elseif (! $reflFieldValue) {
378
+                    } elseif ( ! $reflFieldValue) {
379 379
                         $this->initRelatedCollection($parentObject, $parentClass, $relationField, $parentAlias);
380 380
                     } elseif ($reflFieldValue instanceof PersistentCollection && $reflFieldValue->isInitialized() === false) {
381 381
                         $reflFieldValue->setInitialized(true);
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
                     // PATH B: Single-valued association
385 385
                     $reflFieldValue = $association->getValue($parentObject);
386 386
 
387
-                    if (! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) ||
387
+                    if ( ! $reflFieldValue || isset($this->hints[Query::HINT_REFRESH]) ||
388 388
                         ($reflFieldValue instanceof GhostObjectInterface && ! $reflFieldValue->isProxyInitialized())) {
389 389
                         // we only need to take action if this value is null,
390 390
                         // we refresh the entity or its an uninitialized proxy.
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
                 $entityKey                    = $this->rsm->entityMappings[$dqlAlias] ?: 0;
446 446
 
447 447
                 // if this row has a NULL value for the root result id then make it a null result.
448
-                if (! isset($nonemptyComponents[$dqlAlias])) {
448
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
449 449
                     if ($this->rsm->isMixed) {
450 450
                         $result[] = [$entityKey => null];
451 451
                     } else {
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
                 }
458 458
 
459 459
                 // check for existing result from the iterations before
460
-                if (! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) {
460
+                if ( ! isset($this->identifierMap[$dqlAlias][$id[$dqlAlias]])) {
461 461
                     $element = $this->getEntity($data, $dqlAlias);
462 462
 
463 463
                     if ($this->rsm->isMixed) {
@@ -500,13 +500,13 @@  discard block
 block discarded – undo
500 500
             }
501 501
         }
502 502
 
503
-        if (! isset($resultKey)) {
503
+        if ( ! isset($resultKey)) {
504 504
             $this->resultCounter++;
505 505
         }
506 506
 
507 507
         // Append scalar values to mixed result sets
508 508
         if (isset($rowData['scalars'])) {
509
-            if (! isset($resultKey)) {
509
+            if ( ! isset($resultKey)) {
510 510
                 $resultKey = isset($this->rsm->indexByMap['scalars'])
511 511
                     ? $row[$this->rsm->indexByMap['scalars']]
512 512
                     : $this->resultCounter - 1;
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 
520 520
         // Append new object to mixed result sets
521 521
         if (isset($rowData['newObjects'])) {
522
-            if (! isset($resultKey)) {
522
+            if ( ! isset($resultKey)) {
523 523
                 $resultKey = $this->resultCounter - 1;
524 524
             }
525 525
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/EntityManager.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     {
294 294
         $query = new Query($this);
295 295
 
296
-        if (! empty($dql)) {
296
+        if ( ! empty($dql)) {
297 297
             $query->setDQL($dql);
298 298
         }
299 299
 
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
             $this->checkLockRequirements($lockMode, $class);
385 385
         }
386 386
 
387
-        if (! \is_array($id)) {
387
+        if ( ! \is_array($id)) {
388 388
             if ($class->isIdentifierComposite()) {
389 389
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
390 390
             }
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
         $sortedId = [];
406 406
 
407 407
         foreach ($class->identifier as $identifier) {
408
-            if (! isset($id[$identifier])) {
408
+            if ( ! isset($id[$identifier])) {
409 409
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
410 410
             }
411 411
 
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
         // Check identity map first
423 423
         $entity = $unitOfWork->tryGetById($sortedId, $class->getRootClassName());
424 424
         if ($entity !== false) {
425
-            if (! ($entity instanceof $className)) {
425
+            if ( ! ($entity instanceof $className)) {
426 426
                 return null;
427 427
             }
428 428
 
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
         $class     = $this->metadataFactory->getMetadataFor(\ltrim($entityName, '\\'));
468 468
         $className = $class->getClassName();
469 469
 
470
-        if (! \is_array($id)) {
470
+        if ( ! \is_array($id)) {
471 471
             if ($class->isIdentifierComposite()) {
472 472
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
473 473
             }
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
         $sortedId = [];
493 493
 
494 494
         foreach ($class->identifier as $identifier) {
495
-            if (! isset($scalarId[$identifier])) {
495
+            if ( ! isset($scalarId[$identifier])) {
496 496
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
497 497
             }
498 498
 
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
         $class     = $this->metadataFactory->getMetadataFor(\ltrim($entityName, '\\'));
534 534
         $className = $class->getClassName();
535 535
 
536
-        if (! \is_array($id)) {
536
+        if ( ! \is_array($id)) {
537 537
             if ($class->isIdentifierComposite()) {
538 538
                 throw ORMInvalidArgumentException::invalidCompositeIdentifier();
539 539
             }
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
         $sortedId = [];
555 555
 
556 556
         foreach ($class->identifier as $identifier) {
557
-            if (! isset($id[$identifier])) {
557
+            if ( ! isset($id[$identifier])) {
558 558
                 throw MissingIdentifierField::fromFieldAndClass($identifier, $className);
559 559
             }
560 560
 
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
      */
627 627
     public function persist($entity)
628 628
     {
629
-        if (! \is_object($entity)) {
629
+        if ( ! \is_object($entity)) {
630 630
             throw ORMInvalidArgumentException::invalidObject('EntityManager#persist()', $entity);
631 631
         }
632 632
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
      */
649 649
     public function remove($entity)
650 650
     {
651
-        if (! \is_object($entity)) {
651
+        if ( ! \is_object($entity)) {
652 652
             throw ORMInvalidArgumentException::invalidObject('EntityManager#remove()', $entity);
653 653
         }
654 654
 
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
      */
669 669
     public function refresh($entity)
670 670
     {
671
-        if (! \is_object($entity)) {
671
+        if ( ! \is_object($entity)) {
672 672
             throw ORMInvalidArgumentException::invalidObject('EntityManager#refresh()', $entity);
673 673
         }
674 674
 
@@ -818,7 +818,7 @@  discard block
 block discarded – undo
818 818
      */
819 819
     public static function create($connection, Configuration $config, ?EventManager $eventManager = null)
820 820
     {
821
-        if (! $config->getMetadataDriverImpl()) {
821
+        if ( ! $config->getMetadataDriverImpl()) {
822 822
             throw MissingMappingDriverImplementation::create();
823 823
         }
824 824
 
@@ -845,12 +845,12 @@  discard block
 block discarded – undo
845 845
             return DriverManager::getConnection($connection, $config, $eventManager ?: new EventManager());
846 846
         }
847 847
 
848
-        if (! $connection instanceof Connection) {
848
+        if ( ! $connection instanceof Connection) {
849 849
             throw new InvalidArgumentException(
850 850
                 \sprintf(
851 851
                     'Invalid $connection argument of type %s given%s.',
852 852
                     \is_object($connection) ? \get_class($connection) : \gettype($connection),
853
-                    \is_object($connection) ? '' : ': "' . $connection . '"'
853
+                    \is_object($connection) ? '' : ': "'.$connection.'"'
854 854
                 )
855 855
             );
856 856
         }
@@ -898,13 +898,13 @@  discard block
 block discarded – undo
898 898
     {
899 899
         switch ($lockMode) {
900 900
             case LockMode::OPTIMISTIC:
901
-                if (! $class->isVersioned()) {
901
+                if ( ! $class->isVersioned()) {
902 902
                     throw OptimisticLockException::notVersioned($class->getClassName());
903 903
                 }
904 904
                 break;
905 905
             case LockMode::PESSIMISTIC_READ:
906 906
             case LockMode::PESSIMISTIC_WRITE:
907
-                if (! $this->getConnection()->isTransactionActive()) {
907
+                if ( ! $this->getConnection()->isTransactionActive()) {
908 908
                     throw TransactionRequiredException::transactionRequired();
909 909
                 }
910 910
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -191,13 +191,13 @@  discard block
 block discarded – undo
191 191
 
192 192
         $innerSql           = $this->getInnerSQL($AST);
193 193
         $sqlIdentifier      = $this->getSQLIdentifier($AST);
194
-        $sqlAliasIdentifier = \array_map(static function ($info) {
194
+        $sqlAliasIdentifier = \array_map(static function($info) {
195 195
             return $info['alias'];
196 196
         }, $sqlIdentifier);
197 197
 
198 198
         if ($hasOrderBy) {
199
-            $orderGroupBy = ' GROUP BY ' . \implode(', ', $sqlAliasIdentifier);
200
-            $sqlPiece     = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum';
199
+            $orderGroupBy = ' GROUP BY '.\implode(', ', $sqlAliasIdentifier);
200
+            $sqlPiece     = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum';
201 201
 
202 202
             $sqlAliasIdentifier[] = $sqlPiece;
203 203
             $sqlIdentifier[]      = [
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
         $sql = \sprintf('SELECT DISTINCT %s FROM (%s) dctrn_result', \implode(', ', $sqlAliasIdentifier), $innerSql);
211 211
 
212 212
         if ($hasOrderBy) {
213
-            $sql .= $orderGroupBy . $outerOrderBy;
213
+            $sql .= $orderGroupBy.$outerOrderBy;
214 214
         }
215 215
 
216 216
         // Apply the limit and offset.
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
         $innerSql           = $this->getInnerSQL($AST);
256 256
         $sqlIdentifier      = $this->getSQLIdentifier($AST);
257
-        $sqlAliasIdentifier = \array_map(static function ($info) {
257
+        $sqlAliasIdentifier = \array_map(static function($info) {
258 258
             return $info['alias'];
259 259
         }, $sqlIdentifier);
260 260
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
             $idVar = $pathExpression->identificationVariable;
312 312
             $field = $pathExpression->field;
313 313
 
314
-            if (! isset($selects[$idVar])) {
314
+            if ( ! isset($selects[$idVar])) {
315 315
                 $selects[$idVar] = [];
316 316
             }
317 317
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             if ($selectExpression instanceof SelectExpression) {
325 325
                 $idVar = $selectExpression->expression;
326 326
 
327
-                if (! \is_string($idVar)) {
327
+                if ( ! \is_string($idVar)) {
328 328
                     continue;
329 329
                 }
330 330
 
@@ -359,7 +359,7 @@  discard block
 block discarded – undo
359 359
         ?OrderByClause $orderByClause
360 360
     ) : string {
361 361
         // If the sql statement has an order by clause, we need to wrap it in a new select distinct statement
362
-        if (! $orderByClause) {
362
+        if ( ! $orderByClause) {
363 363
             return $sql;
364 364
         }
365 365
 
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
             $orderByItems[] = $orderByItemString;
398 398
             $identifier     = \substr($orderByItemString, 0, \strrpos($orderByItemString, ' '));
399 399
 
400
-            if (! \in_array($identifier, $identifiers, true)) {
400
+            if ( ! \in_array($identifier, $identifiers, true)) {
401 401
                 $identifiers[] = $identifier;
402 402
             }
403 403
         }
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
      */
551 551
     public function walkPathExpression($pathExpr)
552 552
     {
553
-        if (! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! \in_array($pathExpr, $this->orderByPathExpressions, true)) {
553
+        if ( ! $this->inSubSelect && ! $this->platformSupportsRowNumber() && ! \in_array($pathExpr, $this->orderByPathExpressions, true)) {
554 554
             $this->orderByPathExpressions[] = $pathExpr;
555 555
         }
556 556
 
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/Paginator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         /** @var Query $countQuery */
225 225
         $countQuery = $this->cloneQuery($this->query);
226 226
 
227
-        if (! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) {
227
+        if ( ! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) {
228 228
             $countQuery->setHint(CountWalker::HINT_DISTINCT, true);
229 229
         }
230 230
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
         foreach ($parameters as $key => $parameter) {
259 259
             $parameterName = $parameter->getName();
260 260
 
261
-            if (! (isset($parameterMappings[$parameterName]) || \array_key_exists($parameterName, $parameterMappings))) {
261
+            if ( ! (isset($parameterMappings[$parameterName]) || \array_key_exists($parameterName, $parameterMappings))) {
262 262
                 unset($parameters[$key]);
263 263
             }
264 264
         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Pagination/RowNumberOverFunction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,9 +28,9 @@
 block discarded – undo
28 28
      */
29 29
     public function getSql(SqlWalker $sqlWalker)
30 30
     {
31
-        return 'ROW_NUMBER() OVER(' . \trim($sqlWalker->walkOrderByClause(
31
+        return 'ROW_NUMBER() OVER('.\trim($sqlWalker->walkOrderByClause(
32 32
             $this->orderByClause
33
-        )) . ')';
33
+        )).')';
34 34
     }
35 35
 
36 36
     /**
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/Setup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         $cache = self::createCacheInstance($isDevMode, $cache);
88 88
 
89
-        if (! $cache instanceof CacheProvider) {
89
+        if ( ! $cache instanceof CacheProvider) {
90 90
             return $cache;
91 91
         }
92 92
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $namespace .= ':';
97 97
         }
98 98
 
99
-        $cache->setNamespace($namespace . 'dc2_' . \md5($proxyDir) . '_'); // to avoid collisions
99
+        $cache->setNamespace($namespace.'dc2_'.\md5($proxyDir).'_'); // to avoid collisions
100 100
 
101 101
         return $cache;
102 102
     }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaTool.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -180,11 +180,11 @@  discard block
 block discarded – undo
180 180
                     $pkColumns = [];
181 181
 
182 182
                     foreach ($class->getPropertiesIterator() 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);
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
                             }
220 220
                         }
221 221
 
222
-                        if (! empty($inheritedKeyColumns)) {
222
+                        if ( ! empty($inheritedKeyColumns)) {
223 223
                             // Add a FK constraint on the ID column
224 224
                             $rootClass = $this->em->getClassMetadata($class->getRootClassName());
225 225
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 }
265 265
             }
266 266
 
267
-            if (! $table->hasIndex('primary')) {
267
+            if ( ! $table->hasIndex('primary')) {
268 268
                 $table->setPrimaryKey($pkColumns);
269 269
             }
270 270
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             $processedClasses[$class->getClassName()] = true;
325 325
 
326 326
             foreach ($class->getPropertiesIterator() as $property) {
327
-                if (! $property instanceof FieldMetadata
327
+                if ( ! $property instanceof FieldMetadata
328 328
                     || ! $property->hasValueGenerator()
329 329
                     || $property->getValueGenerator()->getType() !== GeneratorType::SEQUENCE
330 330
                     || $class->getClassName() !== $class->getRootClassName()) {
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
                 $generator  = $property->getValueGenerator()->getGenerator();
335 335
                 $quotedName = $generator->getSequenceName();
336 336
 
337
-                if (! $schema->hasSequence($quotedName)) {
337
+                if ( ! $schema->hasSequence($quotedName)) {
338 338
                     $schema->createSequence($quotedName, $generator->getAllocationSize());
339 339
                 }
340 340
             }
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
             }
348 348
         }
349 349
 
350
-        if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
350
+        if ( ! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
351 351
             $schema->visit(new RemoveNamespacedAssets());
352 352
         }
353 353
 
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
                 break;
387 387
         }
388 388
 
389
-        if (! empty($discrColumn->getColumnDefinition())) {
389
+        if ( ! empty($discrColumn->getColumnDefinition())) {
390 390
             $options['columnDefinition'] = $discrColumn->getColumnDefinition();
391 391
         }
392 392
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
         $pkColumns = [];
405 405
 
406 406
         foreach ($class->getPropertiesIterator() as $fieldName => $property) {
407
-            if (! ($property instanceof FieldMetadata)) {
407
+            if ( ! ($property instanceof FieldMetadata)) {
408 408
                 continue;
409 409
             }
410 410
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
     private function gatherRelationsSql($class, $table, $schema, &$addedFks, &$blacklistedFks)
509 509
     {
510 510
         foreach ($class->getPropertiesIterator() as $fieldName => $property) {
511
-            if (! ($property instanceof AssociationMetadata)) {
511
+            if ( ! ($property instanceof AssociationMetadata)) {
512 512
                 continue;
513 513
             }
514 514
 
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
                 continue;
517 517
             }
518 518
 
519
-            if (! $property->isOwningSide()) {
519
+            if ( ! $property->isOwningSide()) {
520 520
                 continue;
521 521
             }
522 522
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
         $idColumns        = $class->getIdentifierColumns($this->em);
607 607
         $idColumnNameList = \array_keys($idColumns);
608 608
 
609
-        if (! \in_array($referencedColumnName, $idColumnNameList, true)) {
609
+        if ( ! \in_array($referencedColumnName, $idColumnNameList, true)) {
610 610
             return null;
611 611
         }
612 612
 
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
         foreach ($class->getIdentifierFieldNames() as $fieldName) {
615 615
             $property = $class->getProperty($fieldName);
616 616
 
617
-            if (! ($property instanceof AssociationMetadata)) {
617
+            if ( ! ($property instanceof AssociationMetadata)) {
618 618
                 continue;
619 619
             }
620 620
 
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
                 $joinColumn->getReferencedColumnName()
671 671
             );
672 672
 
673
-            if (! $definingClass) {
673
+            if ( ! $definingClass) {
674 674
                 throw MissingColumnException::fromColumnSourceAndTarget(
675 675
                     $joinColumn->getReferencedColumnName(),
676 676
                     $mapping->getSourceEntity(),
@@ -685,14 +685,14 @@  discard block
 block discarded – undo
685 685
             $localColumns[]      = $quotedColumnName;
686 686
             $foreignColumns[]    = $quotedReferencedColumnName;
687 687
 
688
-            if (! $theJoinTable->hasColumn($quotedColumnName)) {
688
+            if ( ! $theJoinTable->hasColumn($quotedColumnName)) {
689 689
                 // Only add the column to the table if it does not exist already.
690 690
                 // It might exist already if the foreign key is mapped into a regular
691 691
                 // property as well.
692 692
                 $property  = $definingClass->getProperty($referencedFieldName);
693 693
                 $columnDef = null;
694 694
 
695
-                if (! empty($joinColumn->getColumnDefinition())) {
695
+                if ( ! empty($joinColumn->getColumnDefinition())) {
696 696
                     $columnDef = $joinColumn->getColumnDefinition();
697 697
                 } elseif ($property->getColumnDefinition()) {
698 698
                     $columnDef = $property->getColumnDefinition();
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
                 $uniqueConstraints[] = ['columns' => [$quotedColumnName]];
725 725
             }
726 726
 
727
-            if (! empty($joinColumn->getOnDelete())) {
727
+            if ( ! empty($joinColumn->getOnDelete())) {
728 728
                 $fkOptions['onDelete'] = $joinColumn->getOnDelete();
729 729
             }
730 730
         }
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
             $theJoinTable->addUniqueIndex($unique['columns'], \is_numeric($indexName) ? null : $indexName);
736 736
         }
737 737
 
738
-        $compositeName = $theJoinTable->getName() . '.' . \implode('', $localColumns);
738
+        $compositeName = $theJoinTable->getName().'.'.\implode('', $localColumns);
739 739
 
740 740
         if (isset($addedFks[$compositeName])
741 741
             && ($foreignTableName !== $addedFks[$compositeName]['foreignTableName']
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
             }
753 753
 
754 754
             $blacklistedFks[$compositeName] = true;
755
-        } elseif (! isset($blacklistedFks[$compositeName])) {
755
+        } elseif ( ! isset($blacklistedFks[$compositeName])) {
756 756
             $addedFks[$compositeName] = [
757 757
                 'foreignTableName' => $foreignTableName,
758 758
                 'foreignColumns'   => $foreignColumns,
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
         $fullSchema = $sm->createSchema();
852 852
 
853 853
         foreach ($fullSchema->getTables() as $table) {
854
-            if (! $schema->hasTable($table->getName())) {
854
+            if ( ! $schema->hasTable($table->getName())) {
855 855
                 foreach ($table->getForeignKeys() as $foreignKey) {
856 856
                     /** @var $foreignKey ForeignKeyConstraint */
857 857
                     if ($schema->hasTable($foreignKey->getForeignTableName())) {
@@ -876,7 +876,7 @@  discard block
 block discarded – undo
876 876
                 if ($table->hasPrimaryKey()) {
877 877
                     $columns = $table->getPrimaryKey()->getColumns();
878 878
                     if (\count($columns) === 1) {
879
-                        $checkSequence = $table->getName() . '_' . $columns[0] . '_seq';
879
+                        $checkSequence = $table->getName().'_'.$columns[0].'_seq';
880 880
                         if ($fullSchema->hasSequence($checkSequence)) {
881 881
                             $visitor->acceptSequence($fullSchema->getSequence($checkSequence));
882 882
                         }
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Tools/SchemaValidator.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $ce = [];
80 80
 
81 81
         foreach ($class->getPropertiesIterator() as $fieldName => $association) {
82
-            if (! ($association instanceof AssociationMetadata)) {
82
+            if ( ! ($association instanceof AssociationMetadata)) {
83 83
                 continue;
84 84
             }
85 85
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         }
88 88
 
89 89
         foreach ($class->getSubClasses() as $subClass) {
90
-            if (! \in_array($class->getClassName(), \class_parents($subClass), true)) {
90
+            if ( ! \in_array($class->getClassName(), \class_parents($subClass), true)) {
91 91
                 $message = "According to the discriminator map class, '%s' has to be a child of '%s', but these entities are not related through inheritance.";
92 92
 
93 93
                 $ce[] = \sprintf($message, $subClass, $class->getClassName());
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $fieldName       = $association->getName();
107 107
         $targetEntity    = $association->getTargetEntity();
108 108
 
109
-        if (! \class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) {
109
+        if ( ! \class_exists($targetEntity) || $metadataFactory->isTransient($targetEntity)) {
110 110
             $message = "The target entity '%s' specified on %s#%s is unknown or not an entity.";
111 111
 
112 112
             return [\sprintf($message, $targetEntity, $class->getClassName(), $fieldName)];
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 
126 126
         /** @var ClassMetadata $targetMetadata */
127 127
         $targetMetadata    = $metadataFactory->getMetadataFor($targetEntity);
128
-        $containsForeignId = \array_filter($targetMetadata->identifier, static function ($identifier) use ($targetMetadata) {
128
+        $containsForeignId = \array_filter($targetMetadata->identifier, static function($identifier) use ($targetMetadata) {
129 129
             $targetProperty = $targetMetadata->getProperty($identifier);
130 130
 
131 131
             return $targetProperty instanceof AssociationMetadata;
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             /** @var AssociationMetadata $targetAssociation */
142 142
             $targetAssociation = $targetMetadata->getProperty($mappedBy);
143 143
 
144
-            if (! $targetAssociation) {
144
+            if ( ! $targetAssociation) {
145 145
                 $message = 'The association %s#%s refers to the owning side property %s#%s which does not exist.';
146 146
 
147 147
                 $ce[] = \sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $mappedBy);
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             /** @var AssociationMetadata $targetAssociation */
166 166
             $targetAssociation = $targetMetadata->getProperty($inversedBy);
167 167
 
168
-            if (! $targetAssociation) {
168
+            if ( ! $targetAssociation) {
169 169
                 $message = 'The association %s#%s refers to the inverse side property %s#%s which does not exist.';
170 170
 
171 171
                 $ce[] = \sprintf($message, $class->getClassName(), $fieldName, $targetEntity, $inversedBy);
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                 $joinTable               = $association->getJoinTable();
210 210
 
211 211
                 foreach ($joinTable->getJoinColumns() as $joinColumn) {
212
-                    if (! \in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) {
212
+                    if ( ! \in_array($joinColumn->getReferencedColumnName(), $classIdentifierColumns, true)) {
213 213
                         $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
214 214
 
215 215
                         $ce[] = \sprintf($message, $joinColumn->getReferencedColumnName(), $class->getClassName());
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                 }
219 219
 
220 220
                 foreach ($joinTable->getInverseJoinColumns() as $inverseJoinColumn) {
221
-                    if (! \in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) {
221
+                    if ( ! \in_array($inverseJoinColumn->getReferencedColumnName(), $targetIdentifierColumns, true)) {
222 222
                         $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
223 223
 
224 224
                         $ce[] = \sprintf($message, $inverseJoinColumn->getReferencedColumnName(), $targetMetadata->getClassName());
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 
229 229
                 if (\count($targetIdentifierColumns) !== \count($joinTable->getInverseJoinColumns())) {
230 230
                     $columnNames = \array_map(
231
-                        static function (JoinColumnMetadata $joinColumn) {
231
+                        static function(JoinColumnMetadata $joinColumn) {
232 232
                             return $joinColumn->getReferencedColumnName();
233 233
                         },
234 234
                         $joinTable->getInverseJoinColumns()
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
                 if (\count($classIdentifierColumns) !== \count($joinTable->getJoinColumns())) {
245 245
                     $columnNames = \array_map(
246
-                        static function (JoinColumnMetadata $joinColumn) {
246
+                        static function(JoinColumnMetadata $joinColumn) {
247 247
                             return $joinColumn->getReferencedColumnName();
248 248
                         },
249 249
                         $joinTable->getJoinColumns()
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 $joinColumns       = $association->getJoinColumns();
261 261
 
262 262
                 foreach ($joinColumns as $joinColumn) {
263
-                    if (! \in_array($joinColumn->getReferencedColumnName(), $identifierColumns, true)) {
263
+                    if ( ! \in_array($joinColumn->getReferencedColumnName(), $identifierColumns, true)) {
264 264
                         $message = "The referenced column name '%s' has to be a primary key column on the target entity class '%s'.";
265 265
 
266 266
                         $ce[] = \sprintf($message, $joinColumn->getReferencedColumnName(), $targetMetadata->getClassName());
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                     continue;
292 292
                 }
293 293
 
294
-                if (! ($targetProperty instanceof AssociationMetadata)) {
294
+                if ( ! ($targetProperty instanceof AssociationMetadata)) {
295 295
                     $message = "The association %s#%s is ordered by a property '%s' that is non-existing field on the target entity '%s'.";
296 296
 
297 297
                     $ce[] = \sprintf($message, $class->getClassName(), $fieldName, $orderField, $targetMetadata->getClassName());
Please login to merge, or discard this patch.