Completed
Pull Request — 2.7 (#7950)
by Mathieu
07:44
created
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         $reflField = $class->reflFields[$fieldName];
190 190
         $value     = null;
191 191
 
192
-        if (! method_exists($reflField, 'isInitialized') || $reflField->isInitialized($entity)) {
192
+        if ( ! method_exists($reflField, 'isInitialized') || $reflField->isInitialized($entity)) {
193 193
             $value = $reflField->getValue($entity);
194 194
         }
195 195
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             $class->reflFields[$fieldName]->setValue($entity, $value);
207 207
             $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value);
208 208
 
209
-            $this->initializedCollections[$oid . $fieldName] = $value;
209
+            $this->initializedCollections[$oid.$fieldName] = $value;
210 210
         } else if (
211 211
             isset($this->_hints[Query::HINT_REFRESH]) ||
212 212
             isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) &&
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
             $value->setInitialized(true);
218 218
             $value->unwrap()->clear();
219 219
 
220
-            $this->initializedCollections[$oid . $fieldName] = $value;
220
+            $this->initializedCollections[$oid.$fieldName] = $value;
221 221
         } else {
222 222
             // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN!
223
-            $this->existingCollections[$oid . $fieldName] = $value;
223
+            $this->existingCollections[$oid.$fieldName] = $value;
224 224
         }
225 225
 
226 226
         return $value;
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
             $idHash = '';
295 295
 
296 296
             foreach ($class->identifier as $fieldName) {
297
-                $idHash .= ' ' . (isset($class->associationMappings[$fieldName])
297
+                $idHash .= ' '.(isset($class->associationMappings[$fieldName])
298 298
                     ? $data[$class->associationMappings[$fieldName]['joinColumns'][0]['name']]
299 299
                     : $data[$fieldName]);
300 300
             }
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                 $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias];
351 351
                 // we need the $path to save into the identifier map which entities were already
352 352
                 // seen for this parent-child relationship
353
-                $path = $parentAlias . '.' . $dqlAlias;
353
+                $path = $parentAlias.'.'.$dqlAlias;
354 354
 
355 355
                 // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs
356 356
                 if ( ! isset($nonemptyComponents[$parentAlias])) {
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
                 $oid            = spl_object_hash($parentObject);
386 386
                 $reflFieldValue = null;
387 387
 
388
-                if (! method_exists($reflField, 'isInitialized') || $reflField->isInitialized($parentObject)) {
388
+                if ( ! method_exists($reflField, 'isInitialized') || $reflField->isInitialized($parentObject)) {
389 389
                     $reflFieldValue = $reflField->getValue($parentObject);
390 390
                 }
391 391
 
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                 if ( ! ($relation['type'] & ClassMetadata::TO_ONE)) {
394 394
                     // PATH A: Collection-valued association
395 395
                     if (isset($nonemptyComponents[$dqlAlias])) {
396
-                        $collKey = $oid . $relationField;
396
+                        $collKey = $oid.$relationField;
397 397
                         if (isset($this->initializedCollections[$collKey])) {
398 398
                             $reflFieldValue = $this->initializedCollections[$collKey];
399 399
                         } else if ( ! isset($this->existingCollections[$collKey])) {
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 
440 440
                 } else {
441 441
                     // PATH B: Single-valued association
442
-                    if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && !$reflFieldValue->__isInitialized__)) {
442
+                    if ( ! $reflFieldValue || isset($this->_hints[Query::HINT_REFRESH]) || ($reflFieldValue instanceof Proxy && ! $reflFieldValue->__isInitialized__)) {
443 443
                         // we only need to take action if this value is null,
444 444
                         // we refresh the entity or its an uninitialized proxy.
445 445
                         if (isset($nonemptyComponents[$dqlAlias])) {
@@ -484,7 +484,7 @@  discard block
 block discarded – undo
484 484
                 $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0;
485 485
 
486 486
                 // if this row has a NULL value for the root result id then make it a null result.
487
-                if ( ! isset($nonemptyComponents[$dqlAlias]) ) {
487
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
488 488
                     if ($this->_rsm->isMixed) {
489 489
                         $result[] = [$entityKey => null];
490 490
                     } else {
@@ -540,13 +540,13 @@  discard block
 block discarded – undo
540 540
             }
541 541
         }
542 542
 
543
-        if ( ! isset($resultKey) ) {
543
+        if ( ! isset($resultKey)) {
544 544
             $this->resultCounter++;
545 545
         }
546 546
 
547 547
         // Append scalar values to mixed result sets
548 548
         if (isset($rowData['scalars'])) {
549
-            if ( ! isset($resultKey) ) {
549
+            if ( ! isset($resultKey)) {
550 550
                 $resultKey = (isset($this->_rsm->indexByMap['scalars']))
551 551
                     ? $row[$this->_rsm->indexByMap['scalars']]
552 552
                     : $this->resultCounter - 1;
@@ -559,19 +559,19 @@  discard block
 block discarded – undo
559 559
 
560 560
         // Append new object to mixed result sets
561 561
         if (isset($rowData['newObjects'])) {
562
-            if ( ! isset($resultKey) ) {
562
+            if ( ! isset($resultKey)) {
563 563
                 $resultKey = $this->resultCounter - 1;
564 564
             }
565 565
 
566 566
 
567
-            $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0);
567
+            $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0);
568 568
 
569 569
             foreach ($rowData['newObjects'] as $objIndex => $newObject) {
570 570
                 $class  = $newObject['class'];
571 571
                 $args   = $newObject['args'];
572 572
                 $obj    = $class->newInstanceArgs($args);
573 573
 
574
-                if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) {
574
+                if ($scalarCount == 0 && count($rowData['newObjects']) == 1) {
575 575
                     $result[$resultKey] = $obj;
576 576
 
577 577
                     continue;
Please login to merge, or discard this patch.