Failed Conditions
Pull Request — master (#6649)
by Marco
62:58
created
lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -325,7 +325,7 @@
 block discarded – undo
325 325
      *
326 326
      * @param string $className
327 327
      *
328
-     * @return callable
328
+     * @return \Closure
329 329
      */
330 330
     public function buildEntityTryGet(string $className) : callable
331 331
     {
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             $class->reflFields[$fieldName]->setValue($entity, $value);
222 222
             $this->_uow->setOriginalEntityProperty($oid, $fieldName, $value);
223 223
 
224
-            $this->initializedCollections[$oid . $fieldName] = $value;
224
+            $this->initializedCollections[$oid.$fieldName] = $value;
225 225
         } else if (
226 226
             isset($this->_hints[Query::HINT_REFRESH]) ||
227 227
             isset($this->_hints['fetched'][$parentDqlAlias][$fieldName]) &&
@@ -232,10 +232,10 @@  discard block
 block discarded – undo
232 232
             $value->setInitialized(true);
233 233
             $value->unwrap()->clear();
234 234
 
235
-            $this->initializedCollections[$oid . $fieldName] = $value;
235
+            $this->initializedCollections[$oid.$fieldName] = $value;
236 236
         } else {
237 237
             // Is already PersistentCollection, and DON'T REFRESH or FETCH-JOIN!
238
-            $this->existingCollections[$oid . $fieldName] = $value;
238
+            $this->existingCollections[$oid.$fieldName] = $value;
239 239
         }
240 240
 
241 241
         return $value;
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
         // anyway, as we need to call `createEntity` with the data
301 301
         // in any case to allow refreshing proxy information, for
302 302
         // example
303
-        if (! $managedEntity) {
303
+        if ( ! $managedEntity) {
304 304
             $entity = $this->_uow->createEntity($className, $data, $this->_hints);
305 305
 
306 306
             $this->trackedWritableEntities[\spl_object_hash($entity)] = true;
@@ -344,11 +344,11 @@  discard block
 block discarded – undo
344 344
         /**
345 345
          * @return object|Proxy|null
346 346
          */
347
-        return function (array $data) use ($idColumns, $rootEntityName) {
347
+        return function(array $data) use ($idColumns, $rootEntityName) {
348 348
             $idHashData = [];
349 349
 
350 350
             foreach ($idColumns as $idColumn) {
351
-                if (! isset($data[$idColumn])) {
351
+                if ( ! isset($data[$idColumn])) {
352 352
                     return null;
353 353
                 }
354 354
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
                 $parentAlias = $this->_rsm->parentAliasMap[$dqlAlias];
403 403
                 // we need the $path to save into the identifier map which entities were already
404 404
                 // seen for this parent-child relationship
405
-                $path = $parentAlias . '.' . $dqlAlias;
405
+                $path = $parentAlias.'.'.$dqlAlias;
406 406
 
407 407
                 // We have a RIGHT JOIN result here. Doctrine cannot hydrate RIGHT JOIN Object-Graphs
408 408
                 if ( ! isset($nonemptyComponents[$parentAlias])) {
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
                     $reflFieldValue = $reflField->getValue($parentObject);
443 443
 
444 444
                     if (isset($nonemptyComponents[$dqlAlias])) {
445
-                        $collKey = $oid . $relationField;
445
+                        $collKey = $oid.$relationField;
446 446
                         if (isset($this->initializedCollections[$collKey])) {
447 447
                             $reflFieldValue = $this->initializedCollections[$collKey];
448 448
                         } else if ( ! isset($this->existingCollections[$collKey])) {
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
                 $entityKey = $this->_rsm->entityMappings[$dqlAlias] ?: 0;
535 535
 
536 536
                 // if this row has a NULL value for the root result id then make it a null result.
537
-                if ( ! isset($nonemptyComponents[$dqlAlias]) ) {
537
+                if ( ! isset($nonemptyComponents[$dqlAlias])) {
538 538
                     if ($this->_rsm->isMixed) {
539 539
                         $result[] = [$entityKey => null];
540 540
                     } else {
@@ -590,13 +590,13 @@  discard block
 block discarded – undo
590 590
             }
591 591
         }
592 592
 
593
-        if ( ! isset($resultKey) ) {
593
+        if ( ! isset($resultKey)) {
594 594
             $this->resultCounter++;
595 595
         }
596 596
 
597 597
         // Append scalar values to mixed result sets
598 598
         if (isset($rowData['scalars'])) {
599
-            if ( ! isset($resultKey) ) {
599
+            if ( ! isset($resultKey)) {
600 600
                 $resultKey = (isset($this->_rsm->indexByMap['scalars']))
601 601
                     ? $row[$this->_rsm->indexByMap['scalars']]
602 602
                     : $this->resultCounter - 1;
@@ -609,19 +609,19 @@  discard block
 block discarded – undo
609 609
 
610 610
         // Append new object to mixed result sets
611 611
         if (isset($rowData['newObjects'])) {
612
-            if ( ! isset($resultKey) ) {
612
+            if ( ! isset($resultKey)) {
613 613
                 $resultKey = $this->resultCounter - 1;
614 614
             }
615 615
 
616 616
 
617
-            $scalarCount = (isset($rowData['scalars'])? count($rowData['scalars']): 0);
617
+            $scalarCount = (isset($rowData['scalars']) ? count($rowData['scalars']) : 0);
618 618
 
619 619
             foreach ($rowData['newObjects'] as $objIndex => $newObject) {
620 620
                 $class  = $newObject['class'];
621 621
                 $args   = $newObject['args'];
622 622
                 $obj    = $class->newInstanceArgs($args);
623 623
 
624
-                if ($scalarCount == 0 && count($rowData['newObjects']) == 1 ) {
624
+                if ($scalarCount == 0 && count($rowData['newObjects']) == 1) {
625 625
                     $result[$resultKey] = $obj;
626 626
 
627 627
                     continue;
Please login to merge, or discard this patch.
lib/Doctrine/ORM/Internal/Hydration/Cache/LazyPropertyMap.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 
4 4
 namespace Doctrine\ORM\Internal\Hydration\Cache;
5 5
 
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         // Note: the reason why we use dynamic access to create a private-ish property is
17 17
         //       that we do not want this property to be statically defined. If that
18 18
         //       happens, then a consumer of `__get` may access it, and that's no good
19
-        $this->{self::class . "\0callback"} = $instantiate;
19
+        $this->{self::class."\0callback"} = $instantiate;
20 20
     }
21 21
 
22 22
     /**
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function __get(string $name)
28 28
     {
29
-        $this->$name = ($this->{self::class . "\0callback"})($name);
29
+        $this->$name = ($this->{self::class."\0callback"})($name);
30 30
 
31 31
         return $this->$name;
32 32
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/ORM/Internal/Cache/LazyPropertyMapTest.php 1 patch
Spacing   +3 added lines, -3 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 LazyMapTest;
6 6
 
@@ -40,10 +40,10 @@  discard block
 block discarded – undo
40 40
             ->callback
41 41
             ->expects(self::exactly(3))
42 42
             ->method('__invoke')
43
-            ->will(self::returnCallback(function ($name) use (& $count) {
43
+            ->will(self::returnCallback(function($name) use (& $count) {
44 44
                 $count += 1;
45 45
 
46
-                return $name . ' - ' . $count;
46
+                return $name.' - '.$count;
47 47
             }));
48 48
 
49 49
         $this->assertSame('foo - 1', $this->lazyMap->foo);
Please login to merge, or discard this patch.