Completed
Pull Request — master (#5841)
by Peter
07:19
created
tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2016Test.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@
 block discarded – undo
241 241
     public $test = 'valami';
242 242
 
243 243
     /**
244
-     * @return mixed
244
+     * @return string
245 245
      */
246 246
     public function toPhpValue()
247 247
     {
Please login to merge, or discard this patch.
lib/Doctrine/ORM/UnitOfWork.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
         $state = $this->getEntityState($entity);
464 464
 
465 465
         if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) {
466
-            throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity));
466
+            throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity));
467 467
         }
468 468
 
469 469
         $class = $this->em->getClassMetadata(get_class($entity));
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
         $oid  = spl_object_hash($entity);
520 520
         $data = array();
521 521
 
522
-        if (!isset($this->entityChangeSets[$oid])) {
522
+        if ( ! isset($this->entityChangeSets[$oid])) {
523 523
             return $data;
524 524
         }
525 525
 
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 
627 627
             foreach ($actualData as $propName => $actualValue) {
628 628
                 if ( ! isset($class->associationMappings[$propName])) {
629
-                    $changeSet[$propName] = array(null, (!$actualValue instanceof DoctrineValueObject) ?: $actualValue->toPhpValue());
629
+                    $changeSet[$propName] = array(null, ( ! $actualValue instanceof DoctrineValueObject) ?: $actualValue->toPhpValue());
630 630
 
631 631
                     continue;
632 632
                 }
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
                 $assoc = $class->associationMappings[$propName];
635 635
 
636 636
                 if ($assoc['isOwningSide'] && $assoc['type'] & ClassMetadata::TO_ONE) {
637
-                    $changeSet[$propName] = array(null, (!$actualValue instanceof DoctrineValueObject) ?: $actualValue->toPhpValue());
637
+                    $changeSet[$propName] = array(null, ( ! $actualValue instanceof DoctrineValueObject) ?: $actualValue->toPhpValue());
638 638
                 }
639 639
             }
640 640
 
@@ -690,7 +690,7 @@  discard block
 block discarded – undo
690 690
                     if ($owner === null) { // cloned
691 691
                         $actualValue->setOwner($entity, $assoc);
692 692
                     } else if ($owner !== $entity) { // no clone, we have to fix
693
-                        if (!$actualValue->isInitialized()) {
693
+                        if ( ! $actualValue->isInitialized()) {
694 694
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
695 695
                         }
696 696
                         $newValue = clone $actualValue;
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
         $targetClass    = $this->em->getClassMetadata($assoc['targetEntity']);
837 837
 
838 838
         foreach ($unwrappedValue as $key => $entry) {
839
-            if (! ($entry instanceof $targetClass->name)) {
839
+            if ( ! ($entry instanceof $targetClass->name)) {
840 840
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry);
841 841
             }
842 842
 
@@ -1695,7 +1695,7 @@  discard block
 block discarded – undo
1695 1695
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
1696 1696
 
1697 1697
             default:
1698
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1698
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1699 1699
         }
1700 1700
 
1701 1701
         $this->cascadePersist($entity, $visited);
@@ -1765,7 +1765,7 @@  discard block
 block discarded – undo
1765 1765
             case self::STATE_DETACHED:
1766 1766
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
1767 1767
             default:
1768
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1768
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1769 1769
         }
1770 1770
 
1771 1771
     }
@@ -1916,7 +1916,7 @@  discard block
 block discarded – undo
1916 1916
      */
1917 1917
     private function isLoaded($entity)
1918 1918
     {
1919
-        return !($entity instanceof Proxy) || $entity->__isInitialized();
1919
+        return ! ($entity instanceof Proxy) || $entity->__isInitialized();
1920 1920
     }
1921 1921
 
1922 1922
     /**
@@ -2074,7 +2074,7 @@  discard block
 block discarded – undo
2074 2074
 
2075 2075
         $associationMappings = array_filter(
2076 2076
             $class->associationMappings,
2077
-            function ($assoc) { return $assoc['isCascadeRefresh']; }
2077
+            function($assoc) { return $assoc['isCascadeRefresh']; }
2078 2078
         );
2079 2079
 
2080 2080
         foreach ($associationMappings as $assoc) {
@@ -2117,7 +2117,7 @@  discard block
 block discarded – undo
2117 2117
 
2118 2118
         $associationMappings = array_filter(
2119 2119
             $class->associationMappings,
2120
-            function ($assoc) { return $assoc['isCascadeDetach']; }
2120
+            function($assoc) { return $assoc['isCascadeDetach']; }
2121 2121
         );
2122 2122
 
2123 2123
         foreach ($associationMappings as $assoc) {
@@ -2161,7 +2161,7 @@  discard block
 block discarded – undo
2161 2161
 
2162 2162
         $associationMappings = array_filter(
2163 2163
             $class->associationMappings,
2164
-            function ($assoc) { return $assoc['isCascadeMerge']; }
2164
+            function($assoc) { return $assoc['isCascadeMerge']; }
2165 2165
         );
2166 2166
 
2167 2167
         foreach ($associationMappings as $assoc) {
@@ -2200,7 +2200,7 @@  discard block
 block discarded – undo
2200 2200
 
2201 2201
         $associationMappings = array_filter(
2202 2202
             $class->associationMappings,
2203
-            function ($assoc) { return $assoc['isCascadePersist']; }
2203
+            function($assoc) { return $assoc['isCascadePersist']; }
2204 2204
         );
2205 2205
 
2206 2206
         foreach ($associationMappings as $assoc) {
@@ -2229,7 +2229,7 @@  discard block
 block discarded – undo
2229 2229
                     break;
2230 2230
 
2231 2231
                 case ($relatedEntities !== null):
2232
-                    if (! $relatedEntities instanceof $assoc['targetEntity']) {
2232
+                    if ( ! $relatedEntities instanceof $assoc['targetEntity']) {
2233 2233
                         throw ORMInvalidArgumentException::invalidAssociation(
2234 2234
                             $this->em->getClassMetadata($assoc['targetEntity']),
2235 2235
                             $assoc,
@@ -2260,13 +2260,13 @@  discard block
 block discarded – undo
2260 2260
 
2261 2261
         $associationMappings = array_filter(
2262 2262
             $class->associationMappings,
2263
-            function ($assoc) { return $assoc['isCascadeRemove']; }
2263
+            function($assoc) { return $assoc['isCascadeRemove']; }
2264 2264
         );
2265 2265
 
2266 2266
         $entitiesToCascade = array();
2267 2267
 
2268 2268
         foreach ($associationMappings as $assoc) {
2269
-            if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2269
+            if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2270 2270
                 $entity->__load();
2271 2271
             }
2272 2272
 
@@ -2330,7 +2330,7 @@  discard block
 block discarded – undo
2330 2330
                     return;
2331 2331
                 }
2332 2332
 
2333
-                if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2333
+                if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2334 2334
                     $entity->__load();
2335 2335
                 }
2336 2336
 
@@ -2345,7 +2345,7 @@  discard block
 block discarded – undo
2345 2345
             case LockMode::NONE === $lockMode:
2346 2346
             case LockMode::PESSIMISTIC_READ === $lockMode:
2347 2347
             case LockMode::PESSIMISTIC_WRITE === $lockMode:
2348
-                if (!$this->em->getConnection()->isTransactionActive()) {
2348
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
2349 2349
                     throw TransactionRequiredException::transactionRequired();
2350 2350
                 }
2351 2351
 
@@ -2690,7 +2690,7 @@  discard block
 block discarded – undo
2690 2690
                             // then we can append this entity for eager loading!
2691 2691
                             if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER &&
2692 2692
                                 isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2693
-                                !$targetClass->isIdentifierComposite &&
2693
+                                ! $targetClass->isIdentifierComposite &&
2694 2694
                                 $newValue instanceof Proxy &&
2695 2695
                                 $newValue->__isInitialized__ === false) {
2696 2696
 
@@ -3002,7 +3002,7 @@  discard block
 block discarded – undo
3002 3002
      */
3003 3003
     public function size()
3004 3004
     {
3005
-        $countArray = array_map(function ($item) { return count($item); }, $this->identityMap);
3005
+        $countArray = array_map(function($item) { return count($item); }, $this->identityMap);
3006 3006
 
3007 3007
         return array_sum($countArray);
3008 3008
     }
@@ -3061,7 +3061,7 @@  discard block
 block discarded – undo
3061 3061
     public function getCollectionPersister(array $association)
3062 3062
     {
3063 3063
         $role = isset($association['cache'])
3064
-            ? $association['sourceEntity'] . '::' . $association['fieldName']
3064
+            ? $association['sourceEntity'].'::'.$association['fieldName']
3065 3065
             : $association['type'];
3066 3066
 
3067 3067
         if (isset($this->collectionPersisters[$role])) {
@@ -3279,7 +3279,7 @@  discard block
 block discarded – undo
3279 3279
      */
3280 3280
     private function afterTransactionComplete()
3281 3281
     {
3282
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3282
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3283 3283
             $persister->afterTransactionComplete();
3284 3284
         });
3285 3285
     }
@@ -3289,7 +3289,7 @@  discard block
 block discarded – undo
3289 3289
      */
3290 3290
     private function afterTransactionRolledBack()
3291 3291
     {
3292
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3292
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3293 3293
             $persister->afterTransactionRolledBack();
3294 3294
         });
3295 3295
     }
@@ -3388,7 +3388,7 @@  discard block
 block discarded – undo
3388 3388
                     if ($other === null) {
3389 3389
                         $prop->setValue($managedCopy, null);
3390 3390
                     } else {
3391
-                        if ($other instanceof Proxy && !$other->__isInitialized()) {
3391
+                        if ($other instanceof Proxy && ! $other->__isInitialized()) {
3392 3392
                             // do not merge fields marked lazy that have not been fetched.
3393 3393
                             continue;
3394 3394
                         }
Please login to merge, or discard this patch.