Completed
Pull Request — master (#5841)
by Peter
11:07
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.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         $state = $this->getEntityState($entity);
465 465
 
466 466
         if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) {
467
-            throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity));
467
+            throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity));
468 468
         }
469 469
 
470 470
         $class = $this->em->getClassMetadata(get_class($entity));
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
         $oid  = spl_object_hash($entity);
521 521
         $data = array();
522 522
 
523
-        if (!isset($this->entityChangeSets[$oid])) {
523
+        if ( ! isset($this->entityChangeSets[$oid])) {
524 524
             return $data;
525 525
         }
526 526
 
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
                     if ($owner === null) { // cloned
684 684
                         $actualValue->setOwner($entity, $assoc);
685 685
                     } else if ($owner !== $entity) { // no clone, we have to fix
686
-                        if (!$actualValue->isInitialized()) {
686
+                        if ( ! $actualValue->isInitialized()) {
687 687
                             $actualValue->initialize(); // we have to do this otherwise the cols share state
688 688
                         }
689 689
                         $newValue = clone $actualValue;
@@ -829,7 +829,7 @@  discard block
 block discarded – undo
829 829
         $targetClass    = $this->em->getClassMetadata($assoc['targetEntity']);
830 830
 
831 831
         foreach ($unwrappedValue as $key => $entry) {
832
-            if (! ($entry instanceof $targetClass->name)) {
832
+            if ( ! ($entry instanceof $targetClass->name)) {
833 833
                 throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry);
834 834
             }
835 835
 
@@ -1688,7 +1688,7 @@  discard block
 block discarded – undo
1688 1688
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted");
1689 1689
 
1690 1690
             default:
1691
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1691
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1692 1692
         }
1693 1693
 
1694 1694
         $this->cascadePersist($entity, $visited);
@@ -1758,7 +1758,7 @@  discard block
 block discarded – undo
1758 1758
             case self::STATE_DETACHED:
1759 1759
                 throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed");
1760 1760
             default:
1761
-                throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity));
1761
+                throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity));
1762 1762
         }
1763 1763
 
1764 1764
     }
@@ -1909,7 +1909,7 @@  discard block
 block discarded – undo
1909 1909
      */
1910 1910
     private function isLoaded($entity)
1911 1911
     {
1912
-        return !($entity instanceof Proxy) || $entity->__isInitialized();
1912
+        return ! ($entity instanceof Proxy) || $entity->__isInitialized();
1913 1913
     }
1914 1914
 
1915 1915
     /**
@@ -2067,7 +2067,7 @@  discard block
 block discarded – undo
2067 2067
 
2068 2068
         $associationMappings = array_filter(
2069 2069
             $class->associationMappings,
2070
-            function ($assoc) { return $assoc['isCascadeRefresh']; }
2070
+            function($assoc) { return $assoc['isCascadeRefresh']; }
2071 2071
         );
2072 2072
 
2073 2073
         foreach ($associationMappings as $assoc) {
@@ -2110,7 +2110,7 @@  discard block
 block discarded – undo
2110 2110
 
2111 2111
         $associationMappings = array_filter(
2112 2112
             $class->associationMappings,
2113
-            function ($assoc) { return $assoc['isCascadeDetach']; }
2113
+            function($assoc) { return $assoc['isCascadeDetach']; }
2114 2114
         );
2115 2115
 
2116 2116
         foreach ($associationMappings as $assoc) {
@@ -2154,7 +2154,7 @@  discard block
 block discarded – undo
2154 2154
 
2155 2155
         $associationMappings = array_filter(
2156 2156
             $class->associationMappings,
2157
-            function ($assoc) { return $assoc['isCascadeMerge']; }
2157
+            function($assoc) { return $assoc['isCascadeMerge']; }
2158 2158
         );
2159 2159
 
2160 2160
         foreach ($associationMappings as $assoc) {
@@ -2193,7 +2193,7 @@  discard block
 block discarded – undo
2193 2193
 
2194 2194
         $associationMappings = array_filter(
2195 2195
             $class->associationMappings,
2196
-            function ($assoc) { return $assoc['isCascadePersist']; }
2196
+            function($assoc) { return $assoc['isCascadePersist']; }
2197 2197
         );
2198 2198
 
2199 2199
         foreach ($associationMappings as $assoc) {
@@ -2222,7 +2222,7 @@  discard block
 block discarded – undo
2222 2222
                     break;
2223 2223
 
2224 2224
                 case ($relatedEntities !== null):
2225
-                    if (! $relatedEntities instanceof $assoc['targetEntity']) {
2225
+                    if ( ! $relatedEntities instanceof $assoc['targetEntity']) {
2226 2226
                         throw ORMInvalidArgumentException::invalidAssociation(
2227 2227
                             $this->em->getClassMetadata($assoc['targetEntity']),
2228 2228
                             $assoc,
@@ -2253,13 +2253,13 @@  discard block
 block discarded – undo
2253 2253
 
2254 2254
         $associationMappings = array_filter(
2255 2255
             $class->associationMappings,
2256
-            function ($assoc) { return $assoc['isCascadeRemove']; }
2256
+            function($assoc) { return $assoc['isCascadeRemove']; }
2257 2257
         );
2258 2258
 
2259 2259
         $entitiesToCascade = array();
2260 2260
 
2261 2261
         foreach ($associationMappings as $assoc) {
2262
-            if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2262
+            if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2263 2263
                 $entity->__load();
2264 2264
             }
2265 2265
 
@@ -2323,7 +2323,7 @@  discard block
 block discarded – undo
2323 2323
                     return;
2324 2324
                 }
2325 2325
 
2326
-                if ($entity instanceof Proxy && !$entity->__isInitialized__) {
2326
+                if ($entity instanceof Proxy && ! $entity->__isInitialized__) {
2327 2327
                     $entity->__load();
2328 2328
                 }
2329 2329
 
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
             case LockMode::NONE === $lockMode:
2339 2339
             case LockMode::PESSIMISTIC_READ === $lockMode:
2340 2340
             case LockMode::PESSIMISTIC_WRITE === $lockMode:
2341
-                if (!$this->em->getConnection()->isTransactionActive()) {
2341
+                if ( ! $this->em->getConnection()->isTransactionActive()) {
2342 2342
                     throw TransactionRequiredException::transactionRequired();
2343 2343
                 }
2344 2344
 
@@ -2683,7 +2683,7 @@  discard block
 block discarded – undo
2683 2683
                             // then we can append this entity for eager loading!
2684 2684
                             if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER &&
2685 2685
                                 isset($hints[self::HINT_DEFEREAGERLOAD]) &&
2686
-                                !$targetClass->isIdentifierComposite &&
2686
+                                ! $targetClass->isIdentifierComposite &&
2687 2687
                                 $newValue instanceof Proxy &&
2688 2688
                                 $newValue->__isInitialized__ === false) {
2689 2689
 
@@ -2995,7 +2995,7 @@  discard block
 block discarded – undo
2995 2995
      */
2996 2996
     public function size()
2997 2997
     {
2998
-        $countArray = array_map(function ($item) { return count($item); }, $this->identityMap);
2998
+        $countArray = array_map(function($item) { return count($item); }, $this->identityMap);
2999 2999
 
3000 3000
         return array_sum($countArray);
3001 3001
     }
@@ -3054,7 +3054,7 @@  discard block
 block discarded – undo
3054 3054
     public function getCollectionPersister(array $association)
3055 3055
     {
3056 3056
         $role = isset($association['cache'])
3057
-            ? $association['sourceEntity'] . '::' . $association['fieldName']
3057
+            ? $association['sourceEntity'].'::'.$association['fieldName']
3058 3058
             : $association['type'];
3059 3059
 
3060 3060
         if (isset($this->collectionPersisters[$role])) {
@@ -3272,7 +3272,7 @@  discard block
 block discarded – undo
3272 3272
      */
3273 3273
     private function afterTransactionComplete()
3274 3274
     {
3275
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3275
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3276 3276
             $persister->afterTransactionComplete();
3277 3277
         });
3278 3278
     }
@@ -3282,7 +3282,7 @@  discard block
 block discarded – undo
3282 3282
      */
3283 3283
     private function afterTransactionRolledBack()
3284 3284
     {
3285
-        $this->performCallbackOnCachedPersister(function (CachedPersister $persister) {
3285
+        $this->performCallbackOnCachedPersister(function(CachedPersister $persister) {
3286 3286
             $persister->afterTransactionRolledBack();
3287 3287
         });
3288 3288
     }
@@ -3381,7 +3381,7 @@  discard block
 block discarded – undo
3381 3381
                     if ($other === null) {
3382 3382
                         $prop->setValue($managedCopy, null);
3383 3383
                     } else {
3384
-                        if ($other instanceof Proxy && !$other->__isInitialized()) {
3384
+                        if ($other instanceof Proxy && ! $other->__isInitialized()) {
3385 3385
                             // do not merge fields marked lazy that have not been fetched.
3386 3386
                             continue;
3387 3387
                         }
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.
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.