Completed
Pull Request — master (#5841)
by Peter
07:19
created
lib/Doctrine/ORM/UnitOfWork.php 3 patches
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
     /**
1238 1238
      * Schedules an entity for being updated.
1239 1239
      *
1240
-     * @param object $entity The entity to schedule for being updated.
1240
+     * @param \Doctrine\Tests\Models\Forum\ForumUser $entity The entity to schedule for being updated.
1241 1241
      *
1242 1242
      * @return void
1243 1243
      *
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
     /**
1306 1306
      * Checks whether an entity is registered to be checked in the unit of work.
1307 1307
      *
1308
-     * @param object $entity
1308
+     * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity
1309 1309
      *
1310 1310
      * @return boolean
1311 1311
      */
@@ -3121,7 +3121,7 @@  discard block
 block discarded – undo
3121 3121
      *
3122 3122
      * @param object $entity       The entity that owns the property.
3123 3123
      * @param string $propertyName The name of the property that changed.
3124
-     * @param mixed  $oldValue     The old value of the property.
3124
+     * @param null|integer  $oldValue     The old value of the property.
3125 3125
      * @param mixed  $newValue     The new value of the property.
3126 3126
      *
3127 3127
      * @return void
@@ -3321,7 +3321,7 @@  discard block
 block discarded – undo
3321 3321
     /**
3322 3322
      * Verifies if two given entities actually are the same based on identifier comparison
3323 3323
      *
3324
-     * @param object $entity1
3324
+     * @param Proxy $entity1
3325 3325
      * @param object $entity2
3326 3326
      *
3327 3327
      * @return bool
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -26,7 +26,6 @@  discard block
 block discarded – undo
26 26
 use Exception;
27 27
 use InvalidArgumentException;
28 28
 use UnexpectedValueException;
29
-
30 29
 use Doctrine\Common\Collections\ArrayCollection;
31 30
 use Doctrine\Common\Collections\Collection;
32 31
 use Doctrine\Common\NotifyPropertyChanged;
@@ -34,14 +33,12 @@  discard block
 block discarded – undo
34 33
 use Doctrine\Common\Persistence\ObjectManagerAware;
35 34
 use Doctrine\ORM\Mapping\ClassMetadata;
36 35
 use Doctrine\ORM\Proxy\Proxy;
37
-
38 36
 use Doctrine\ORM\Event\LifecycleEventArgs;
39 37
 use Doctrine\ORM\Event\PreUpdateEventArgs;
40 38
 use Doctrine\ORM\Event\PreFlushEventArgs;
41 39
 use Doctrine\ORM\Event\OnFlushEventArgs;
42 40
 use Doctrine\ORM\Event\PostFlushEventArgs;
43 41
 use Doctrine\ORM\Event\ListenersInvoker;
44
-
45 42
 use Doctrine\ORM\Cache\Persister\CachedPersister;
46 43
 use Doctrine\ORM\Persisters\Entity\BasicEntityPersister;
47 44
 use Doctrine\ORM\Persisters\Entity\SingleTablePersister;
Please login to merge, or discard this 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.
tests/Doctrine/Tests/Mocks/ConcurrentRegionMock.php 1 patch
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,6 @@
 block discarded – undo
38 38
      * Dequeue an exception for a specific method invocation
39 39
      *
40 40
      * @param string $method
41
-     * @param mixed $default
42 41
      *
43 42
      * @return mixed
44 43
      */
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Mocks/UnitOfWorkMock.php 1 patch
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -28,6 +28,7 @@
 block discarded – undo
28 28
 
29 29
     /**
30 30
      * {@inheritdoc}
31
+     * @param \Doctrine\Tests\ORM\NotifyChangedEntity $entity
31 32
      */
32 33
     public function getEntityChangeSet($entity)
33 34
     {
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Models/Cache/Token.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -51,6 +51,9 @@
 block discarded – undo
51 51
      */
52 52
     public $complexAction;
53 53
 
54
+    /**
55
+     * @param string $token
56
+     */
54 57
     public function __construct($token, Client $client = null)
55 58
     {
56 59
         $this->logins    = new ArrayCollection();
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Models/Company/CompanyCar.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -19,6 +19,9 @@
 block discarded – undo
19 19
      */
20 20
     private $brand;
21 21
 
22
+    /**
23
+     * @param string $brand
24
+     */
22 25
     public function __construct($brand = null) {
23 26
         $this->brand = $brand;
24 27
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Models/Company/CompanyFlexContract.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -79,6 +79,9 @@  discard block
 block discarded – undo
79 79
         return $this->hoursWorked;
80 80
     }
81 81
 
82
+    /**
83
+     * @param integer $hoursWorked
84
+     */
82 85
     public function setHoursWorked($hoursWorked)
83 86
     {
84 87
         $this->hoursWorked = $hoursWorked;
@@ -89,6 +92,9 @@  discard block
 block discarded – undo
89 92
         return $this->pricePerHour;
90 93
     }
91 94
 
95
+    /**
96
+     * @param integer $pricePerHour
97
+     */
92 98
     public function setPricePerHour($pricePerHour)
93 99
     {
94 100
         $this->pricePerHour = $pricePerHour;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Models/DDC117/DDC117Article.php 1 patch
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -33,6 +33,9 @@  discard block
 block discarded – undo
33 33
      */
34 34
     private $links;
35 35
 
36
+    /**
37
+     * @param string $title
38
+     */
36 39
     public function __construct($title)
37 40
     {
38 41
         $this->title = $title;
@@ -60,6 +63,10 @@  discard block
 block discarded – undo
60 63
         return $this->references;
61 64
     }
62 65
 
66
+    /**
67
+     * @param string $language
68
+     * @param string $title
69
+     */
63 70
     public function addTranslation($language, $title)
64 71
     {
65 72
         $this->translations[] = new DDC117Translation($this, $language, $title);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Models/DDC117/DDC117Link.php 1 patch
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -23,6 +23,11 @@
 block discarded – undo
23 23
      */
24 24
     public $target;
25 25
 
26
+    /**
27
+     * @param DDC117Article $source
28
+     * @param DDC117Article $target
29
+     * @param string $description
30
+     */
26 31
     public function __construct($source, $target, $description)
27 32
     {
28 33
         $this->source = $source;
Please login to merge, or discard this patch.
tests/Doctrine/Tests/Models/DDC3579/DDC3579Group.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
     }
60 60
 
61 61
     /**
62
-     * @return ArrayCollection
62
+     * @return DDC3579Admin[]
63 63
      */
64 64
     public function getAdmins()
65 65
     {
Please login to merge, or discard this patch.